Once phpIPAM is installed and subnets have been added, in order to keep subnets up to date we can create Cronjobs to run discovery and checks on each subnet. To do so, following the steps below. The following configuration focuses on the configuration required on the CLI. Additionally you need to ensure that each subnet has the following flags enabled:
- Check host status
- Discover new hosts
- Resolve DNS names
Note
The following steps were carried out and tested on Ubuntu.
Enter crontab
crontab -e
Enter the following configuration and ensure that the paths are correct for your deployment
Note
The following configuration will run cronjobs every 15 minutes to see if devices are still connected, to see if any new devices have been discovered and also to see whether any of the IP addresses can be resolved.
*/15 * * * * /usr/bin/php /var/www/html/phpipam/functions/scripts/pingCheck.php
*/15 * * * * /usr/bin/php /var/www/html/phpipam/functions/scripts/discoveryCheck.php
*/15 * * * * /usr/bin/php /var/www/html/phpipam/functions/scripts/resolveIPaddresses.php
If you’re not sure of the php path, run the following configuration
which php
Once the above has been configured, the relevant subnets will be automatically updated.