EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

:o
anyone can help??
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

In order or ICMP to work, the poller must be running as Root. UDP is often referred to as the Unreliable Datagram Protocol. The ping relies on an error message to be generated at the remote device indicating that the port is not open.

Often times, operating systems do not provide this response, or it is blocked by certain devices.

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?
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

TheWitness wrote:In order or ICMP to work, the poller must be running as Root. UDP is often referred to as the Unreliable Datagram Protocol. The ping relies on an error message to be generated at the remote device indicating that the port is not open.

Often times, operating systems do not provide this response, or it is blocked by certain devices.

TheWitness

well thans for you respond
but HOw you run icmp on root?????
please
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

su -
crontab -e
i (for insert)
*/5 * * * * php -q /var/www/html/cacti/poller.php > /dev/null 2>&1
<escape>
:wq

Done.

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?
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

I write what you says i make it:

thanks i try but i have this on my graph all packet loss (atchement)
my cactiLog information:
06/07/2007 10:40:04 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (160, '', '2007-06-07 10:40:03', 'loss:100.00')"
06/07/2007 10:40:04 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (54, 'hdd_free', '2007-06-07 10:40:03', '79676')"
06/07/2007 10:40:04 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (54, 'hdd_used', '2007-06-07 10:40:03', '16191')"
06/07/2007 10:40:04 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (34, 'ping', '2007-06-07 10:40:03', '0.053')"
06/07/2007 10:40:04 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (6, 'users', '2007-06-07 10:40:03', '1')"
06/07/2007 10:40:03 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (5, '', '2007-06-07 10:40:03', '1min:0.47 5min:0.59 10min:0.44')"
06/07/2007 10:40:03 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (4, 'mem_swap', '2007-06-07 10:40:03', '291576')"
06/07/2007 10:40:03 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "insert into poller_output (local_data_id, rrd_name, time, output) values (3, 'mem_buffers', '2007-06-07 10:40:03', '1480')"
06/07/2007 10:36:31 AM - SYSTEM STATS: Time:89.3382 Method:cmd.php Processes:1 Threads:N/A Hosts:9 HostsPerProcess:9 DataSources:90 RRDsProcessed:102
06/07/2007 10:36:31 AM - SYSTEM STATS: Time:89.4301 Method:cmd.php Processes:1 Threads:N/A Hosts:9 HostsPerProcess:9 DataSources:90 RRDsProcessed:95
and when i lunch the ss_fping on command line:
[root@localhost scripts]# php ss_fping.php 192.168.0.2
Content-type: text/html
X-Powered-By: PHP/4.3.9

min:0.9600 avg:1.7083 max:4.0200 dev:1.0893 loss:0.0000[
Attachments
advancedPing00.jpg
advancedPing00.jpg (50.85 KiB) Viewed 9165 times
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Perform a repair table on that database.

TheWitness

Code: Select all

mysql cacti
> repair table poller_output;
> quit;
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?
creposukre
Posts: 15
Joined: Sat May 12, 2007 5:51 am
Location: Niort, FRANCE

Post by creposukre »

Hi, i have some questions about this script.
What does "Dev:" means on the graph ?
Why "Avg Latency" doesn't work ?
and why there's "Unknown" in the graph caption ?

That's all.

Thanks,
Matthieu.
RedShift
Posts: 5
Joined: Sun Jan 07, 2007 6:06 pm

Post by RedShift »

Very nice! Cacti ping on fire!
dexter001
Posts: 4
Joined: Sun Jul 08, 2007 11:08 am
Contact:

not working :\

Post by dexter001 »

hey .. I got the xml .. imported it .. clicked on devices .. selected a modem ..clicked on add graph template .. added it .. then Create Graphs for this Host .. checked the ping script .. and clicked on create .. left the default values .. and finished .. now .. after waiting 5 minutes ..

GODZILLA:/srv/www/htdocs/cacti/scripts # php5 ss_fping.php 10.2.0.240 20 ICMP
min:30.2300 avg:50.1965 max:66.5500 dev:11.0063 loss:0.0000

GODZILLA:/srv/www/htdocs/cacti/scripts # cd ..

GODZILLA:/srv/www/htdocs/cacti # php5 scripts/ss_fping.php 10.2.0.240 20 ICMP
min:49.6700 avg:71.0905 max:141.5700 dev:19.5374 loss:0.0000

GODZILLA:/srv/www/htdocs/cacti # head -n 2 scripts/ss_fping.php
<?php
#!/usr/bin/php5 -q

GODZILLA:/srv/www/htdocs/cacti # whereis php5
php5: /usr/bin/php5 /etc/php5 /usr/lib/php5 /usr/include/php5 /usr/share/php5 /usr/share/man/man1/php5.1.gz

GODZILLA:/srv/www/htdocs/cacti #

hmm .. seems to be working just fine ..

http://10.3.0.254/cacti/data_input.php? ... edit&id=13 is showing as the command ..

<path_cacti>/ss_fping.php <hostname> <attempts> <protocol> <port>

so I got to I got to graph management .. clicked on the graph .. clicked for debug .. and here is the result :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="modem-emil - Advanced Ping" \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=10 \
--lower-limit=0 \
--units-exponent=1 \
--vertical-label="milliseconds" \
--slope-mode \
DEF:a="/srv/www/htdocs/cacti/rra/modememil_min_81.rrd":min:AVERAGE \
DEF:b="/srv/www/htdocs/cacti/rra/modememil_min_81.rrd":avg:AVERAGE \
DEF:c="/srv/www/htdocs/cacti/rra/modememil_min_81.rrd":max:AVERAGE \
DEF:d="/srv/www/htdocs/cacti/rra/modememil_min_81.rrd":loss:AVERAGE \
DEF:e="/srv/www/htdocs/cacti/rra/modememil_min_81.rrd":dev:AVERAGE \
CDEF:cdefg=d,0,GT,d,2,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefh=d,3,GT,d,5,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefi=d,5,GT,d,10,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefj=d,10,GT,d,15,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefba=d,15,GT,d,50,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefbb=d,50,GT,d,95,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefbc=d,95,GT,d,100,GT,UNKN,INF,IF,UNKN,IF \
CDEF:cdefbd=d,UN,1,EQ,TIME,300,+,NOW,GT,UNKN,INF,IF,d,95,GT,INF,UNKN,IF,IF \
CDEF:cdefbf=e,2,/ \
CDEF:cdefbh=c,b,-,e,-,3,/ \
CDEF:cdefcd=d,0,GT,d,2,GT,UNKN,b,IF,UNKN,IF \
CDEF:cdefce=d,3,GT,d,5,GT,UNKN,b,IF,UNKN,IF \
CDEF:cdefcf=d,5,GT,d,10,GT,UNKN,b,IF,UNKN,IF \
CDEF:cdefcg=d,10,GT,d,15,GT,UNKN,b,IF,UNKN,IF \
CDEF:cdefch=d,15,GT,d,50,GT,b,INF,IF,UNKN,IF \
CDEF:cdefci=d,50,GT,d,95,GT,UNKN,b,IF,UNKN,IF \
CDEF:cdefcj=d,95,GT,d,100,GT,UNKN,b,IF,UNKN,IF \
LINE1:a:"" \
LINE1:b:"" \
LINE1:c:"" \
LINE1:d:"" \
LINE1:e:"" \
COMMENT:" Pkt Loss\:" \
AREA:cdefg#AFECED:"1-2%" \
AREA:cdefh#55D6D3:"3-5%" \
AREA:cdefi#7CB3F1:"6-10%" \
AREA:cdefj#4668E4:"11-15%" \
AREA:cdefba#A150AA:"16-50%" \
AREA:cdefbb#FF00FF:"51-95%" \
AREA:cdefbc#F51D30:"96-100%" \
COMMENT:"Unknown\n" \
AREA:b#FFFFFF:"" \
AREA:cdefbf#333333:"":STACK \
AREA:cdefbf#555555:"":STACK \
AREA:cdefbh#888888:"":STACK \
AREA:cdefbh#AAAAAA:"":STACK \
AREA:cdefbh#CCCCCC:"":STACK \
GPRINT:d:AVERAGE:" Avg Loss\:%6.2lf%%" \
GPRINT:d:MAX:"Max Loss\:%6.2lf%%\n" \
COMMENT:" Latency\:" \
AREA:cdefcd#AFECED:"" \
AREA:cdefce#55D6D3:"" \
AREA:cdefcf#7CB3F1:"" \
AREA:cdefcg#4668E4:"" \
AREA:cdefch#A150AA:"" \
AREA:cdefci#FF00FF:"" \
AREA:cdefcj#F51D30:"" \
GPRINT:a:AVERAGE:"Min\:%8.2lf ms" \
GPRINT:b:AVERAGE:"Avg\:%8.2lf ms" \
GPRINT:c:MAX:"Max\:%8.2lf ms" \
GPRINT:e:AVERAGE:"Dev\:%8.2lf ms\n" \
COMMENT:"Avg Latency\:" \
LINE1:b#00BD27:"
"

RRDTool Says:

OK

but .. nothing ! .. the graph just shows 100.00% loss .. and no graph to even show the 100%
Attachments
my screenshot
my screenshot
Screenshot.png (156.89 KiB) Viewed 8512 times
MoreDakka
Posts: 44
Joined: Wed Jul 04, 2007 12:57 pm

Post by MoreDakka »

This may be a dumb problem but I'm not sure how to pass it. When I'm trying to debug it:

a) Start the Script Server

Code: Select all

[cactiuser@monitor ~]$ php /var/www/html/cacti/script_server.php
X-Powered-By: PHP/5.2.0
Content-type: text/html

[cactiuser@monitor ~]$

or

Code: Select all

[root@monitor cacti]# php script_server.php ss_fping 127.0.0.1 20 ICMP
X-Powered-By: PHP/5.2.0
Content-type: text/html

[root@monitor cacti]#
I can't seem to get anything out of that script_server.php :-/
kopecek
Posts: 5
Joined: Wed Jul 11, 2007 11:44 am

Post by kopecek »

TheWitness wrote:If you are running UNIX, the script_server has to have rights to create a RAW socket (aka root or asroot). Otherwise use something like "TCP 80" or something similar. Windows does not care.

TheWitness
And is any way to do ICMP ping on linux?
sys0p
Posts: 48
Joined: Sun Jan 14, 2007 3:46 pm
Location: Europe

Post by sys0p »

Hello ,

I have a problem, whenever I try to add a new device with Host Template None and I choose Advanced Ping template at Associated Graph Templates I cacti doesnt want to pool it because the device appears as down.

Can you please shed some light as how I should do this ? I am runing 0.8.6j
.

Thanks !
ring8668
Posts: 1
Joined: Mon Jul 23, 2007 11:26 am

Post by ring8668 »

I got a problem...

the Advanced Ping V1.3 scirpt has been installed properly, Graph Debug and Data Source Debug are OK now, and when It launched from the script server:

[root@localhost ~]# php /var/www/html/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
/var/www/html/cacti/scripts/ss_fping.php ss_fping 210.51.46.69 20 ICMP
min:0.1900 avg:0.5560 max:3.7300 dev:0.9968 loss:0.0000
/var/www/html/cacti/scripts/ss_fping.php ss_fping 210.51.46.69 20 TCP 80
min:0.3000 avg:0.3675 max:0.4600 dev:0.0431 loss:0.0000


no any errors or warnings ,It seems that everything goes well ,but I don't get any data in my graphs.

the cactilog says:

07/25/2007 10:05:06 AM - CACTID: Poller[0] ERROR: SS[999] Script Server did not start properly return message was: 'U'
07/25/2007 10:05:06 AM - CACTID: Poller[0] ERROR: SS[0] PHP Script Server communications lost.
07/25/2007 10:05:06 AM - CACTID: Poller[0] Host[2] DS[48] SS[0] WARNING: Result from SERVER not valid. Partial Result: ...
07/25/2007 10:05:11 AM - SYSTEM STATS: Time:5.5737 Method:cactid Processes:1 Threads:1 Hosts:3 HostsPerProcess:3


How do I solve this? Thanks!
Federic
Posts: 1
Joined: Tue Oct 17, 2006 9:06 pm

Post by Federic »

The scripts is running, but I have three question,
What does "Dev:" means on the graph ?
What does the gray mass represent in the graph? I'm not very clear about it.
Whether the "Avg Latency:" is unwanted,because the "Avg:" can stand for it. The Avg Latency always empty in my graph...

Thanks,
Federic
fairlylarge
Posts: 3
Joined: Wed Aug 08, 2007 6:53 am

Post by fairlylarge »

Just wondered if anybody had come across this.

I've tried reinstalling, tweaking settings, etc. and I can't seem to fathom why this happens. I have installed the Advanced Ping v1.3 template and it works great. However in Preview mode the graph appears as a broken image. All the other graphs are fine. I've tracked it down to the nolegend=true tag in the img src, it is only when this tag is passed that the image cannot be generated.

Permissions are correct and I've done the usual checks. I've seen a few people have this issue with other scripts, etc. but they say a DB clean/reinstall seems to resolve it. I've tried this and it hasn't helped sadly :(

Any ideas?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest