Menu

#366 unable to get automatic host availability check working

1.1
closed
nobody
None
1
2016-02-02
2015-10-29
Anonymous
No

I followed this step by step, yet it's still not working. What else might I have to do, I am useing centos 7.

Discussion

  • Anonymous

    Anonymous - 2015-10-29

    Also I am unfamiliar with cron.

     
  • Jim Julson

    Jim Julson - 2015-11-09

    Hello,

    Can you provide some info to start?

    1. Can you please tell us how your crontab job is setup, as well which user? A copy/paste of the CRON entry would be nice.

    2. Have you tried to manually run the files via the CLI, or even via the GUI to ensure they are picking up the hosts in the first place?

     
  • Anonymous

    Anonymous - 2015-11-10

    Hi Jim,

    I have a similar case. The crontab does not execute but from CLI it refreshes the db correctly. Running as root. Any idea what the cause might be?

     
  • Anonymous

    Anonymous - 2015-11-10
    # discover new hosts
    * */4 *  *  * root '/usr/bin/php -f /var/www/html/phpipam/functions/scripts/discoveryCheck.php'
    # update host statuses every 15 minutes
    */15 *  *  *  * root '/usr/bin/php -f /var/www/html/phpipam/functions/scripts/pingCheck.php'
    # resolve dns names
    */40 *  *  *  * root '/usr/bin/php -f /var/www/html/phpipam/functions/scripts/resolveIPaddresses.php'
    
     
  • Miha Petkovsek

    Miha Petkovsek - 2015-11-10

    Remove '

    # discover new hosts
    * */4 *  *  * root /usr/bin/php -f /var/www/html/phpipam/functions/scripts/discoveryCheck.php
    

    Also try without root, if you edit crontab as root it will run as root.

     
  • Miha Petkovsek

    Miha Petkovsek - 2015-11-10

    This is mine from CentOS:

    [root@ipam ~]# more /etc/centos-release
    CentOS Linux release 7.1.1503 (Core) 
    [root@ipam ~]# 
    
    # phpipam
    */15 * * * *  /usr/bin/php /var/www/functions/scripts/pingCheck.php > /dev/null 2>&1
    #0 4 * * * *  /usr/bin/php /var/www/functions/scripts/discoveryCheck.php > /dev/null 2>&1
    
     
  • Jim Julson

    Jim Julson - 2015-11-10

    Yep, that should do it if you remove the apostrophe. Also, if you aren't familiar with cron, it's worth mentioning that you'll need to ensure you are setting up the crontab job while logged in as root ideally. Here's my crontab:

    #  NEWLY ADDED SUBNET SCANS
    */30 * * * *  /usr/bin/php /var/www/phpipam/functions/scripts/discoveryCheck.php
    #
    #  EXISTING HOSTS HEALTH-CHECK
    */15 * * * *  /usr/bin/php /var/www/phpipam/functions/scripts/pingCheck.php
    #
    #  DNS NAME CHECK
    */30 * * * *  /usr/bin/php /var/www/phpipam/functions/scripts/dnsCheck.php
    #
    # RESOLVE IP ADDRESSES THAT ARE FOUND (NOTE:  This is a separate process all together from the host up/down check)
    */30 * * * *  /usr/bin/php /var/www/phpipam/functions/scripts/resolveIPaddresses.php
    #
    # BACKUP PHPIPAM IP ADDRESS TABLE, AND PURGE BACKUPS OLDER THAN 10 DAYS
    #
    @daily /usr/bin/mysqldump -u svc-phpipam -passwordhere phpipam_ecsops > /var/www/phpipam/db/bkp/phpipam_bkp_$(date +"\%y\%m\%d").db
    @daily /usr/bin/find /var/www/phpipam/db/bkp/ -ctime +10 -exec rm {} \;
    
     

    Last edit: Jim Julson 2015-11-10
  • Anonymous

    Anonymous - 2015-11-11

    Miha / Jim,

    Extremely helpful please add this to the install docs!

    -Matt

     
  • Anonymous

    Anonymous - 2016-01-05

    Hello, I seem to be having a similar issue. After reading this bug report, I formatted my cron to-

    /
    set cronjob:
    # update host statuses every 15 minute
    /60 * * root /usr/bin/php /var/www/phpipam/functions/scripts/pingCheck.php > /dev/null 2>&1
    /

    Then ran a check-
    php -f pingCheck.php
    PHP Parse error: syntax error, unexpected '*' in /var/www/phpipam/functions/scripts/pingCheck.php on line 12

    I formatted it back, and did not get the error but it does not seem to be updating host availability. Current Cron looks like this:

    /
    set cronjob:
    # update host statuses every 15 minutes
    /60 *
    * root /usr/bin/php /var/www/phpipam/functions/scripts/pingCheck.php > /dev/null 2>&1
    /

    Any help would be appreciated! Thanks again for all the hard work.

     
  • Miha Petkovsek

    Miha Petkovsek - 2016-02-02
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.