lib/ping.php problem??

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Jayso
Posts: 18
Joined: Mon Aug 23, 2004 4:58 pm
Location: Los Angeles CA
Contact:

lib/ping.php problem??

Post by Jayso »

Warning: socket_set_option() unable to set socket option [33]: Numerical argument out of domain in /usr/local/share/cacti/lib/ping.php on line 218


And it stops there..
Funny thing is it repeates the msg a few times before hand. but keeps going..
then it gets to the one and stops..
Any ideas?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Are you running PHP in safe_mode?

Check your php.ini file for the setting.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Brian Blood
Posts: 10
Joined: Sat Apr 30, 2005 2:40 pm

Post by Brian Blood »

I kept getting these errors too:

PHP Warning: socket_set_option() unable to set socket option [33]: Numerical argument out of domain in /www/Tools/cacti/lib/ping.php on line 217


so I tracked it down....

socket_set_option($this->socket,
SOL_SOCKET, // socket level
SO_RCVTIMEO, // timeout option
array(
"sec"=>$this->timeout, // Timeout in seconds
"usec"=>0 // I assume timeout in microseconds
));


in the ping_udp and ping_icmp sections


from what I can see...

$this->timeout is being set from:
cmd.php:169 - read_config_option("ping_timeout")
in the call to ping.

I'm assuming that ping_timeout comes from the "Ping Timeout Value" field on the Poller screen in "Settings".

That doesn't field does specify whether the value is in seconds or milliseconds, however, mine has a value of 400. Which sounds more like milliseconds.

So the code for socket_set_option is trying to set a timeout of 400 seconds.

I've swapped the two values in my ping.php
Brian Blood
http://www.macserve.net/
Brian Blood
Posts: 10
Joined: Sat Apr 30, 2005 2:40 pm

Post by Brian Blood »

ok, I apparently need to read closer.
That option says MICROSECONDS.
Not milliseconds.
So, I've multipled the this_timeout value by 1000
Brian Blood
http://www.macserve.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests