Advanced ping and script problem

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
pwzero
Posts: 3
Joined: Tue Oct 09, 2012 3:46 pm

Advanced ping and script problem

Post by pwzero »

Hi,

I'm having a problem with advanced ping that I'm trying to set up for a host on my network. I added the advanced ping template into my Cacti and created a graph for my host. I then rebuilt the poller cache and got a couple of errors, shown below.

10/09/2012 09:55:09 PM - CMDPHP: Poller[0] Host[4] DS[14] WARNING: Result from SERVER not valid. Partial Result: Warning: strtotime()
10/09/2012 09:55:02 PM - POLLER: Poller[0] WARNING: Poller Output Table not Empty. Issues Found: 1, Data Sources: (DS[14])


I'm very new to Linux and can just about make my way around the file system. I do work in IT so I have been able to pick up a few things.
I was trying to debug the problem I'm having and I've run the script in CLI with the below errors. This, I'm afraid, is where I get stuck.

This is the command I ran to test the script:

/share/MD0_DATA/Web/cacti/scripts/ss_fping.php ss_fping 192.168.10.51 10 UDP 23

and this is the output I got:

/share/MD0_DATA/Web/cacti/scripts/ss_fping.php: line 1: ?php: No such file or directory
/share/MD0_DATA/Web/cacti/scripts/ss_fping.php: line 4: /Qmultimedia: is a directory
/share/MD0_DATA/Web/cacti/scripts/ss_fping.php: line 5: syntax error near unexpected token `$_SERVER["argv"][0]'
/share/MD0_DATA/Web/cacti/scripts/ss_fping.php: line 5: `if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) {'


So. I'm guessing it found the correct script? I know /Qmultimedia is a share on my system but why is it referencing it? Is the first problem that it doesn't know the path for php? The syntax hasn't been changed from the template available here so I don't know what's wrong with it.

Thanks in advance for any help.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Advanced ping and script problem

Post by gandalf »

Please try
php -q /share/MD0_DATA/Web/cacti/scripts/ss_fping.php ss_fping 192.168.10.51 10 UDP 23
R.
pwzero
Posts: 3
Joined: Tue Oct 09, 2012 3:46 pm

Re: Advanced ping and script problem

Post by pwzero »

Thanks Gandalf,

I ran the command you suggested. Now I get the following output (several times):

PHP Notice: Undefined variable: method in /share/MD0_DATA/Web/cacti/scripts/ss_fping.php on line 60

I can see the preceding lines 45 to 54 where $method is set by the command switch ICMP,UDP or TCP. So it looks like the switch isn't working. I've changed the three $method variables to 'ICMP_Ping', 'TCP_Ping' and 'UDP_Ping' and provided I don't enter the number of pings switch I'm getting a better result.

Now I get:

PHP Warning: Division by zero in /share/MD0_DATA/Web/cacti/scripts/ss_fping.php on line 97
min:9999.9900 avg:0.0000 max:0.0000 dev:0.0000 loss:100.4330[~]


Now I'm stuck. I'm presuming this is to do with the strtotime warnings or am I totally off? I tried reading the forum about that issue and didn't get it. :o Am I on the right track or is it something else?

Thanks,
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Advanced ping and script problem

Post by gandalf »

Sorry, the test from cli would have been
php -q /share/MD0_DATA/Web/cacti/scripts/ss_fping.php 192.168.10.51 10 UDP 23

When testing under script server (see 1st link of my sig to learn how to do that), the additional parameter is required.
You may receive php STRICT warnings, which you may safely ignore for now
R.
pwzero
Posts: 3
Joined: Tue Oct 09, 2012 3:46 pm

Re: Advanced ping and script problem

Post by pwzero »

Thanks Gandalf,

So I've now acheived what I set out to do which was test the script from CLI. I get a a good result:

min:0.5800 avg:0.6560 max:0.7500 dev:0.0589 loss:0.0000

Now I know it works, I don't know why I'm getting a partial result in the log. I've checked the DS and everything looks fine. I've read the troubleshooting documentation but I don't know what to check next.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests