Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Tue Jul 22, 2014 4:14 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 500 posts ]  Go to page 1, 2, 3, 4, 5 ... 34  Next
Author Message
 Post subject: EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g
PostPosted: Thu Oct 27, 2005 9:50 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14861
Location: MI, USA
All,

With the release of 0.8.6i, the ping.php is not longer required. I am removing.

TheWitness

________________________________________________

All,

I have revised the Advanced Ping Template to version 1.3. In this new version, I have added the following:

1) Ability to ping using either ICMP, TCP, or UDP protocols
2) Ability to choose the port number to ping (TCP, UDP)
3) Improved timeout logic so that you don't get gaps in your graph when a host in not available.
4) Improved Ping.php by using socket_select call whose timeout syntax is consistent between various PHP OS platforms
5) Cleaned up the Template that was causing issues with graph performance

In order to use this template properly, you will need to use the attached/updated files in addition to importing the new version of the template. Your prior template will be overwritten. So, make a backup of your database first.

I would also like to acknowledge Predou, the original author of the Ping template, who provided the inspiration for the whole thing. It appears through all the thousands of posts I have read and reviewed, I loose track of who posted what and where. Here is his original post: Smoke-ping 0.86c

Regards,

TheWitness

Edit:
this post deep into the thread contains v2.2 which has been updated for 0.8.7 (BSOD2600)


Attachments:
ss_fping.zip [1.1 KiB]
Downloaded 30390 times
cacti_graph_template_ping_advanced_ping_v1_3.zip [5.49 KiB]
Downloaded 33330 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
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Last edited by TheWitness on Mon Aug 11, 2008 8:10 pm, edited 2 times in total.
Top
 Profile  
 
 Post subject: NEW Advanced Ping Template Version 1.3 for Cacti 0.8.6g
PostPosted: Sat Oct 29, 2005 12:50 am 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
hmm, I don't get any data in my graphs.
Do I need to add a line to my crontab to call the ping.php or ss_ping.php or something?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 3:44 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
TheWitness,
thank you for this next version of Advanced Ping.
I'd like to add a few words about installing this for those, who do not remember the original post.
- download and unpack ping.zip to <path_cacti>/lib/ping.php
- download and unpack ss_fping.php to <path_cacti/scripts/ss_fping.php
- download and unpack cacti_graph_template_ping_advanced_ping_v1_3.zip to a place of your own choice. Use the cacti web interface to import this template.
- generate graphs for your host using this Graph Template. You will be prompted to enter the protocol, the port (not for ICMP usage) and the number of pings to use.

For those who upgraded from V1.2:
- If you used only the "number of pings" as input to the scripts, there's no need to change the Data Source inputs.
- If you are using the extended input to V1.2, specifying e.g. "20 TCP 80" for checking port 80 with protocol TCP, there's again no need to modify the input parms. But it may be better to do so for clarity. Select Data Sources and filter for Advanced Ping. Select eachh of the displayed data sources and modify the Custom Data input fields accordingly. Please Clear Poller cache when done

Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 10:23 am 
Offline

Joined: Sat Oct 29, 2005 10:18 am
Posts: 2
Location: St. John's Preparatory School
I am trying to measure ping latency times from my cacti server inside my network to
1 - the intranet port on my proxy server
2 - our public IP gateway
3 - our off-site web site

I'd like to have a separate tree in my graph set for just these three and the three hosts do not have SNMP enabled. What is the best way to set this up using this add-on? Do I have to have a host? Or can I just create the three ping graphs? How?

Thanks
Christopher


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 11:13 am 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
IVR: Putting ping.php in the correct dir has helped.
<path_cacti>/lib/ping.php

I still get errors from ping.php, a test from the command line:
root@dhssnms1# /usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1
Notice: Undefined variable: method in /opt/apache/htdocs/cacti/scripts/ss_fping.php on line 56
Fatal error: Call to undefined function socket_create() in /opt/apache/htdocs/cacti/lib/ping.php on line 218

Now, ss_fping.php can find and include ping.php
It looks like ping.php can't perform:
function socket_create()
I am running as root.

I think getting the command line working will solve this.

On a side note, these new files are filled with ^M on the end of each line.
It looks like CR-LF from being edited within Windows.
I didn't edit them and they still run that way, just FYI


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 12:47 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
N3NCY wrote:
root@dhssnms1# /usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1
AFAIK at least the number of requests MUST be given as input parm (do not know exactly). Try
Code:
/opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
for ICMP requests (btw: does ICMP need root privs?). Or
Code:
/opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 TCP 80
for querying the http port of host 10.0.0.1 (well, this seems to be a router :wink: )
Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 12:57 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
cbutler-SJP wrote:
I am trying to measure ping latency times from my cacti server inside my network to
1 - the intranet port on my proxy server
2 - our public IP gateway
3 - our off-site web site

I'd like to have a separate tree in my graph set for just these three and the three hosts do not have SNMP enabled. What is the best way to set this up using this add-on? Do I have to have a host? Or can I just create the three ping graphs? How?

Thanks
Christopher

Christopher,
you will need to
- create a device (host entry) for your proxy, for your gateway and for your webserver
- from the device screen, select the Advanced Ping from Associated Graph Templates and Add. Specify Protocol, optional port and number of requests from the next screen and you're done (please allow time for some polling cycles, at least about 10 min).
Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 12:58 pm 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
hmm, same exact thing:
/usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
Notice: Undefined variable: method in /opt/apache/htdocs/cacti/scripts/ss_fping.php on line 56
Fatal error: Call to undefined function socket_create() in /opt/apache/htdocs/cacti/lib/ping.php on line 218

Still can't create: socket_create()

_________________
Thank you,

Ernie
http://www.NMSWorld.com
Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5
Cacti Version - 0.8.7b
Poller Type - cactid 0.8.7 with Boost v1.7
Server Info - FreeBSD 7.0-RELEASE
Web Server - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
PHP - 5.2.6
MySQL - 5.0.51b Mod: poller_output ENGINE = MEMORY
RRDTool - 1.3.0
SNMP - 5.4.1
Plugins - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 1:12 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
N3NCY wrote:
hmm, same exact thing:
/usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
Notice: Undefined variable: method in /opt/apache/htdocs/cacti/scripts/ss_fping.php on line 56
Fatal error: Call to undefined function socket_create() in /opt/apache/htdocs/cacti/lib/ping.php on line 218

Still can't create: socket_create()

:o (slapping hand on forehead) :o :o :o
Did not realize that this is a php script server script. To run this from cli, either use
Code:
php /usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php 10.0.0.1 20 ICMP
(ATTENTION: omit parm ss_fping here) or start the script server and run the script there:
Code:
php /opt/apache/htdocs/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/opt/apache/htdocs//cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
min:0.3600 avg:0.4995 max:2.3800 dev:0.4372 loss:0.0000
quit
PHP Script Server Shutdown request received, exiting
Content-type: text/html
X-Powered-By: PHP/4.3.9

Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 1:26 pm 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
Same deal:
/usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
Notice: Undefined variable: method in /opt/apache/htdocs/cacti/scripts/ss_fping.php on line 56
Fatal error: Call to undefined function socket_create() in /opt/apache/htdocs/cacti/lib/ping.php on line 218


Or this way:
/opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
: No such file or directoryripts/ss_fping.php: line 1: ?php
: command not foundcacti/scripts/ss_fping.php: line 3:
/opt/apache/htdocs/cacti/scripts/ss_fping.php: line 4: //STANDARD: No such file or directory
/opt/apache/htdocs/cacti/scripts/ss_fping.php: line 5: =: command not found
: command not foundcacti/scripts/ss_fping.php: line 5:
: command not foundcacti/scripts/ss_fping.php: line 6:
/opt/apache/htdocs/cacti/scripts/ss_fping.php: line 7: /COPYRIGHT: Permission denied
/opt/apache/htdocs/cacti/scripts/ss_fping.php: line 8: syntax error near unexpected token `E_ERROR'
'opt/apache/htdocs/cacti/scripts/ss_fping.php: line 8: `error_reporting(E_ERROR);


Or even if launched from the script server:
root@dhssnms1# /usr/local/bin/php /opt/apache/htdocs/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/opt/apache/htdocs/cacti/scripts/ss_fping.php ss_fping 10.0.0.1 20 ICMP
Fatal error: Call to undefined function socket_create() in /opt/apache/htdocs/cacti/lib/ping.php on line 96


ping.php just can't seem to socket_create()

_________________
Thank you,

Ernie
http://www.NMSWorld.com
Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5
Cacti Version - 0.8.7b
Poller Type - cactid 0.8.7 with Boost v1.7
Server Info - FreeBSD 7.0-RELEASE
Web Server - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
PHP - 5.2.6
MySQL - 5.0.51b Mod: poller_output ENGINE = MEMORY
RRDTool - 1.3.0
SNMP - 5.4.1
Plugins - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 3:17 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Perhaps you need to activate the sockets option in php, see http://forums.cacti.net/viewtopic.php?t=8733&start=90&postdays=0&postorder=asc&highlight=
Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 29, 2005 3:57 pm 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
Ivm: Rock on! You nailed it!

Back when I compiled PHP, I missed socket support!

So I recompiled and re-installed PHP:
cd /usr/src/php-5.0.5
make clean
./configure --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql --with-openssl=/usr/local/ssl --with-mssql=/usr/local --with-zlib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-exif --with-png-dir=/usr/local/lib --enable-calendar --enable-ftp --with-libxml-dir=/usr/local/lib --with-snmp=/opt/net-snmp/ --enable-fastcgi --enable-magic-quotes --enable-mbstring --enable-sockets
make install

And now:
/usr/local/bin/php /opt/apache/htdocs/cacti/scripts/ss_fping.php 10.0.0.1 20 ICMP
min:0.2400 avg:0.3340 max:0.4800 dev:0.0649 loss:0.0000


Note: If this was on my Windows 2003 server, I would have edited PHP.ini
and uncommented:
;extension=php_sockets.dll

Thanks again Ivm!

_________________
Thank you,

Ernie
http://www.NMSWorld.com
Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5
Cacti Version - 0.8.7b
Poller Type - cactid 0.8.7 with Boost v1.7
Server Info - FreeBSD 7.0-RELEASE
Web Server - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
PHP - 5.2.6
MySQL - 5.0.51b Mod: poller_output ENGINE = MEMORY
RRDTool - 1.3.0
SNMP - 5.4.1
Plugins - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 30, 2005 8:01 am 
Offline

Joined: Sat Oct 29, 2005 10:18 am
Posts: 2
Location: St. John's Preparatory School
lvm -- thanks!

After sending my message I did poke around a bit more and found an even better way to do this. Instead of creating extra hosts, I just went back to the Data Template and the Graph Template for "PING - Advanced 1.3" and checked the "Use Per-Device" check boxes and voila! I could create a data source and be allowed to pick the IP/hostname that I wanted to ping. I then had to create a Graph Source to match, but I've now got my sequence of hosts that I am pinging to measure where the slowdowns are leaving my network.

Thanks to everyone for the code and the help!

lvm wrote:
cbutler-SJP wrote:
I am trying to measure ping latency times from my cacti server inside my network to
1 - the intranet port on my proxy server
2 - our public IP gateway
3 - our off-site web site

I'd like to have a separate tree in my graph set for just these three and the three hosts do not have SNMP enabled. What is the best way to set this up using this add-on? Do I have to have a host? Or can I just create the three ping graphs? How?

Thanks
Christopher

Christopher,
you will need to
- create a device (host entry) for your proxy, for your gateway and for your webserver
- from the device screen, select the Advanced Ping from Associated Graph Templates and Add. Specify Protocol, optional port and number of requests from the next screen and you're done (please allow time for some polling cycles, at least about 10 min).
Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 30, 2005 8:10 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
cbutler-SJP wrote:
Instead of creating extra hosts, I just went back to the Data Template and the Graph Template for "PING - Advanced 1.3" and checked the "Use Per-Device" check boxes and voila! I could create a data source and be allowed to pick the IP/hostname that I wanted to ping. I then had to create a Graph Source to match, but I've now got my sequence of hosts that I am pinging to measure where the slowdowns are leaving my network.

For resolviong just that single approach, well.
But if you want to know more about your devices (e.g. if you're using a squid proxy, you way want to implement the squid templates to be found in the forum, traffic stats, errors, info about your apache webserver and the like), it would be easier to create a host and associate all graphs you need to that host. You may group your graphs using the "tree" function and more.
Have fun discovering the features of cacti!
Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 30, 2005 8:58 am 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14861
Location: MI, USA
LVM is correct. The idea is to create an object called a "device/host" and then associate graphs with it. The other approach works, but, is well..., problematic in that everything I am writing right now is based upon the "device/host" approach. The host_id=0 is depricated.

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
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 500 posts ]  Go to page 1, 2, 3, 4, 5 ... 34  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: lan9203 and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group