Dicovery not discovering from cron

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
dvg_lab
Posts: 3
Joined: Sun Apr 19, 2009 3:13 am

Dicovery not discovering from cron

Post by dvg_lab »

Something strange going in my discovery installation. I've been set all necessary settings in misc/discovery tab and filled out the discovery template. So it runs by poller (spine) and claims me about no respond from all hosts.

Code: Select all

DISCOVER: Poller[0] 254 IPs Scanned, 0 IPs Responded to Ping, 0 Responded to SNMP, 0 Device Added, 0 Graphs Added to Cacti 
and all 254 IPs it has pinged for less then 1 sec. At the same time when I run it from console:

Code: Select all

# php findhosts.php
or even
# php poller.php
and it runs for about 10min and found all the hosts.

And sure, poller runs from the root crontab.

I can't debug it, I don't know what to do.
Any help would be appreciated.

UPD: forgot something important - FreeBSD 8.1R, cacti 0.8.7g, PIA 2.8, spine 0.8.7g, Discovery 1.1.
dvg_lab
Posts: 3
Joined: Sun Apr 19, 2009 3:13 am

Re: Dicovery not discovering from cron

Post by dvg_lab »

I think the problem was in path to the external ping.
I remove from cron redirect all output to /dev/null and it sends on email "ping: not found".

Here is the code from lib/ping.php:

Code: Select all

 if (substr_count(strtolower(PHP_OS), "freebsd")) {
        $result = shell_exec("ping -t " . ceil($this->timeout/1000) . " -c " . $this->retries . " " . $this->host["hostname"]);
After change "ping -t" to "/sbin/ping -t" it starts to discover :)

And yes, execution from FreeBSD crontab is not inlclude any path environment. I don't understand how it works on another FreeBSD installations.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests