Advanced Ping Template for Cacti 0.8.6f
Moderators: Developers, Moderators
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Donations are always welcome. They would be for my kids.
Larry
Larry
- Attachments
-
- ss_fping.zip
- (1.1 KiB) Downloaded 1145 times
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Hello,
In addition to my last message, I have done some tests. I set in hard in the script the timeout value to 10 ms. I try to ping www.google.com (about 20ms) and it works : I think my problem is that the ss_fping script (maybe the call to Net_Ping();) never time out. So if there is a lost packet, the script never ends.
Thanks for your help.
Fanu.
In addition to my last message, I have done some tests. I set in hard in the script the timeout value to 10 ms. I try to ping www.google.com (about 20ms) and it works : I think my problem is that the ss_fping script (maybe the call to Net_Ping();) never time out. So if there is a lost packet, the script never ends.
Thanks for your help.
Fanu.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
fanu,
This may be the issue within the ping.php program caused by the set_scoket_option command. Look for it and then review the timeout issues. In some versions of PHP, it acutally works properly. But in windows (where I code) it does not work as expected.
Read the comments on seconds and microseconds. I think you just have to reverse the order and it will work properly. Try that and let me know.
I could write some detection logic to compare unix vs. windows and modify the commands, but I am not sure what platforms PHP is broken on.
TheWitness
This may be the issue within the ping.php program caused by the set_scoket_option command. Look for it and then review the timeout issues. In some versions of PHP, it acutally works properly. But in windows (where I code) it does not work as expected.
Read the comments on seconds and microseconds. I think you just have to reverse the order and it will work properly. Try that and let me know.
I could write some detection logic to compare unix vs. windows and modify the commands, but I am not sure what platforms PHP is broken on.
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Here is the code:
It would be changed to:
It occurs in a few places. Please let me know.
TheWitness
Code: Select all
/* set the socket timeout */
socket_set_option($this->socket,
SOL_SOCKET, // socket level
SO_RCVTIMEO, // timeout option
array(
"sec"=>$this->timeout, // I assume timeout in microseconds
"usec"=>0 // Timeout in seconds
));
Code: Select all
/* set the socket timeout */
socket_set_option($this->socket,
SOL_SOCKET, // socket level
SO_RCVTIMEO, // timeout option
array(
"sec"=>0, // I assume timeout in microseconds
"usec"=>$this->timeout // Timeout in seconds
));
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Hello,
Thank you for your response.
I try to do what you wrote but the problem is still here.
I try to force the timeout to 10ms in the ss_fping script but the directive seems to be ignored (I ping some hosts with 300ms of latency, but if there is a packet loss, the script still never end).
I don't know where to search ...
Thank you for your help.
Fanu.
Thank you for your response.
I try to do what you wrote but the problem is still here.
I try to force the timeout to 10ms in the ss_fping script but the directive seems to be ignored (I ping some hosts with 300ms of latency, but if there is a packet loss, the script still never end).
I don't know where to search ...
Thank you for your help.
Fanu.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I have a new version of ping.php attached. Please test ss_fping.php especially using UDP pings if you can spare the testing time. Timeouts work like they should now. I abandoned the set option call for the socket select, which appears to be much better developed.
TheWitness
TheWitness
- Attachments
-
- ping.zip
- (2.92 KiB) Downloaded 1408 times
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
JJX,
What Ping method? Have you loaded the sockets.so PHP extension?
TheWitness
What Ping method? Have you loaded the sockets.so PHP extension?
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
-
- Posts: 26
- Joined: Fri Sep 30, 2005 4:23 am
can you explain a bit more?lard wrote:Isn't it amazing after searching forums e.t.c. and then posting a query....you answer it yourself within minutes???!!
Turns out that after chacking the data template for advanced ping the "per device hostname" field was checked.... ....after unchecking and adding the data template to an existing host it then asked me for the IP to poll..
I'll go and turn it back to snmp-reliable now
Lard
I'm playing around with this, but didn't find exactly what you are talking about....
call to undefined function socket_create() ???
When I tried to run this:
PHP Script Server has Started - Parent is cmd
scripts/ss_fping.php ss_fping www.google.com 20 TCP 80
Fatal error: Call to undefined function: socket_create() in /usr/local/cacti-0.8.6g/lib/ping.php on line 298
Im using cacti 0.8.6g and applied the latest ss_fping.zip and ping.zip from this thread but still no luck. . Im running on SuSE 9.3 OS
PHP Script Server has Started - Parent is cmd
scripts/ss_fping.php ss_fping www.google.com 20 TCP 80
Fatal error: Call to undefined function: socket_create() in /usr/local/cacti-0.8.6g/lib/ping.php on line 298
Im using cacti 0.8.6g and applied the latest ss_fping.zip and ping.zip from this thread but still no luck. . Im running on SuSE 9.3 OS
"Knowledge is Power"
Who is online
Users browsing this forum: No registered users and 0 guests