Advanced Ping Template for Cacti 0.8.6f

Addons for Cacti and discussion about those addons

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#91 Post by TheWitness » Thu Oct 06, 2005 12:51 pm

Donations are always welcome. They would be for my kids.

Larry
Attachments
ss_fping.zip
(1.1 KiB) Downloaded 1104 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

#92 Post by fanu » Fri Oct 07, 2005 2:09 am

Give us a wishlist ! :wink:

Thanks a lot !

Fanu.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#93 Post by TheWitness » Fri Oct 07, 2005 4:55 am

True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

#94 Post by fanu » Fri Oct 07, 2005 6:40 am

Re-Hello,

I put the new ss_fping. It seems to be better, but there is still a problem :
when the first packet is lost, the script does not stop (same problem).

What can I do to help you to resolve this ?

Thanks for your help.

Fanu.

fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

#95 Post by fanu » Fri Oct 07, 2005 8:19 am

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.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#96 Post by TheWitness » Fri Oct 07, 2005 7:08 pm

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
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#97 Post by TheWitness » Fri Oct 07, 2005 7:12 pm

Here is the code:

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
));
It would be changed to:

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
));
It occurs in a few places. Please let me know.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

#98 Post by fanu » Sun Oct 09, 2005 12:14 pm

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.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#99 Post by TheWitness » Sun Oct 09, 2005 2:06 pm

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
Attachments
ping.zip
(2.92 KiB) Downloaded 1366 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

fanu
Posts: 18
Joined: Thu Oct 07, 2004 2:53 pm
Location: Paris, France

#100 Post by fanu » Mon Oct 10, 2005 1:37 am

It works!
Thank you very much for this update.
Everything seems to be fine now.

Merci beaucoup !!!

Fanu.

JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

#101 Post by JJX » Tue Oct 11, 2005 8:08 am

I am using the script but always i get 100% packet loss! (even to lan)
nothing weird to the logs...
any idea?

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#102 Post by TheWitness » Tue Oct 11, 2005 9:42 pm

JJX,

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

lightningbit
Posts: 26
Joined: Fri Sep 30, 2005 4:23 am

#103 Post by lightningbit » Wed Oct 12, 2005 10:57 am

lard wrote:Isn't it amazing after searching forums e.t.c. and then posting a query....you answer it yourself within minutes???!! :evil:

Turns out that after chacking the data template for advanced ping the "per device hostname" field was checked.... :oops: ....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 :wink:

Lard
can you explain a bit more?
I'm playing around with this, but didn't find exactly what you are talking about....

User avatar
foxtratz
Posts: 14
Joined: Thu Sep 29, 2005 12:03 am
Location: Cagayan de Oro,Philippines
Contact:

call to undefined function socket_create() ???

#104 Post by foxtratz » Wed Oct 12, 2005 11:19 pm

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
"Knowledge is Power"

User avatar
foxtratz
Posts: 14
Joined: Thu Sep 29, 2005 12:03 am
Location: Cagayan de Oro,Philippines
Contact:

#105 Post by foxtratz » Thu Oct 13, 2005 12:41 am

Its ok now! :-) I just need the PHP-SOCKETS service. :lol:
"Knowledge is Power"

Post Reply