Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


EDIT: Advanced Ping Template Version 1.3 for Cacti 0.8.6g
Goto page Previous  1, 2, 3 ... 23, 24, 25
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
DinSoft



Joined: 07 Oct 2008
Posts: 1

PostPosted: Tue Oct 07, 2008 7:10 am    Post subject: Weird issue _ Reply with quote

Hi all,

I have an unexplained behaviour in Catci with the advanced ping plugin:

I am in Vietnam, and I am pinging a host in Switzerland.

There is no way that the RTT is less than 300 ms. It is actually very often over 500 ms. This is why I changed the ping timeout setting from the default 500 ms to 1000 ms.

But, on the graph, it looks like there are RTTs of < 100ms (around 16:00 and 18:00 - 18:20)

How can this happen ?

(I also paste here cacti's log file, without the SNMP data I gather from another device since it is probably irrelevant)



cacti-smokeping.PNG
 Description:
The bogus graph
 Filesize:  38.29 KB
 Viewed:  2005 Time(s)

cacti-smokeping.PNG



cacti-log.txt
 Description:
Cacti's log file

Download
 Filename:  cacti-log.txt
 Filesize:  25.98 KB
 Downloaded:  36 Time(s)

Back to top
jhendrickson



Joined: 17 Oct 2008
Posts: 2

PostPosted: Fri Oct 17, 2008 2:17 pm    Post subject: Inconsistent graphs Reply with quote

I am getting inconsistent graphs using the Advanced Ping. I have a tcp ping to CNN on port 80 which doesn't graph anything but loss. I have other hosts like Yahoo and Google that graph just fine. I also have another graph that is not displaying anything.

Data Source Debug

/usr/bin/rrdtool create \
/usr/share/cacti/site/rra/cnn_tcp_loss_2277.rrd \
--step 300 \
DS:min:GAUGE:450:0:500 \
DS:dev:GAUGE:450:0:500 \
DS:max:GAUGE:450:0:500 \
DS:avg:GAUGE:450:0:500 \
DS:loss:GAUGE:450:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \

/usr/bin/rrdtool create \
/usr/share/cacti/site/rra/sprint_kc_ds3_loss_1862.rrd \
--step 300 \
DS:min:GAUGE:450:0:500 \
DS:dev:GAUGE:450:0:500 \
DS:loss:GAUGE:450:0:100 \
DS:avg:GAUGE:450:0:500 \
DS:max:GAUGE:450:0:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \



graph_image.php.png
 Description:
 Filesize:  29.03 KB
 Viewed:  1799 Time(s)

graph_image.php.png



graph_image.php.png
 Description:
 Filesize:  28.51 KB
 Viewed:  1799 Time(s)

graph_image.php.png


Back to top
jhendrickson



Joined: 17 Oct 2008
Posts: 2

PostPosted: Fri Oct 17, 2008 2:52 pm    Post subject: More Inconsistent Graphs Reply with quote

Running from the command line to another host I get different results. Also, the data listed at the bottom of the graph doesn't seem to match the graph.

/usr/share/cacti/site/scripts/ss_fping.php ss_fping sl-gw34-fw-6-0-TS9.sprintlink.net 20 ICMP
min:7.5800 avg:9.6450 max:27.1100 dev:4.6313 loss:0.0000



graph_image.php.png
 Description:
 Filesize:  40.04 KB
 Viewed:  1794 Time(s)

graph_image.php.png


Back to top
jug



Joined: 10 Oct 2008
Posts: 2
Location: Italy

PostPosted: Wed Oct 29, 2008 5:57 am    Post subject: Changed Advanced Ping Templates Reply with quote

Thanks a lot for this Template it gave me the base to have Latency graphs inside my CACTI installation. I changed them a bit so that all Comments are visible and also that the "smoke" is visible in both directions max -> avg -> min.

I also changed the ss_fping.php so that it can run with a non privileged user, using the fping binary which has to be installed (this is better than using normal ping).

If your interested in this changed graph templates and the modified ss_fping.php I will attach the files exported from a CACTI version 0.8.6j to this post.

ATTENTION: I have seen an error in the exported graph TEMPLATE and changed the attachement (just of the 1 person which already downloaded it Please have a look at the version number of the file!



cacti_graph_template_ping_advanced_ping_v2_1.xml
 Description:
Cacti v0.8.6j Advanced Ping v2.1 Template

Download
 Filename:  cacti_graph_template_ping_advanced_ping_v2_1.xml
 Filesize:  41.26 KB
 Downloaded:  373 Time(s)


ss_fping.zip
 Description:
Modified ss_fping.php file using /usr/sbin/fping when called as not privileged user.

Download
 Filename:  ss_fping.zip
 Filesize:  1.56 KB
 Downloaded:  278 Time(s)

Back to top
ryusez



Joined: 28 Sep 2006
Posts: 20

PostPosted: Fri Oct 31, 2008 10:05 pm    Post subject: Reply with quote

can i import new advance ping 2.1 into 0.8.7b

or any one , had import experence ....

thank you
Back to top
lozzd



Joined: 08 Dec 2005
Posts: 27

PostPosted: Wed Dec 03, 2008 9:30 am    Post subject: Re: Changed Advanced Ping Templates Reply with quote

jug wrote:
I also changed the ss_fping.php so that it can run with a non privileged user, using the fping binary which has to be installed (this is better than using normal ping).


GOOD LORD I read this entire thread thinking "There is no way in hell I'm running the poller as root why the hell has no one used 'fping' when the script is called 'fping'" and here I am, last page, the first person with the necessary level of intelligence. Installed and it worked straight off with no problems. THANK YOU!
Back to top
neteng30



Joined: 13 Nov 2008
Posts: 12

PostPosted: Thu Dec 04, 2008 1:49 pm    Post subject: after install Reply with quote

After install my graph will not appear because cacti says...+

ERROR: the RRD does not contain an RRA matching the chosen CF
any ideas?
Back to top
neteng30



Joined: 13 Nov 2008
Posts: 12

PostPosted: Thu Dec 04, 2008 1:52 pm    Post subject: also Reply with quote

The logs indicate this.

12/04/2008 02:05:03 PM - SPINE: Poller[0] Host[2] DS[874] SS[0] WARNING: Result from SERVER not valid. Partial Result: ...
12/04/2008 02:05:03 PM - PHPSVR: Poller[0] WARNING: Function does not exist
12/04/2008 02:05:03 PM - PHPSVR: Poller[0] WARNING: PHP Script File to be included, does not exist


I have imported the template and the ss_fping script. Am I missing something?
Back to top
neteng30



Joined: 13 Nov 2008
Posts: 12

PostPosted: Thu Dec 04, 2008 2:28 pm    Post subject: additional lines from log Reply with quote

12/04/2008 02:45:08 PM - SPINE: Poller[0] DEBUG: PHP Script Server Pipes Closed
12/04/2008 02:45:08 PM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
12/04/2008 02:45:08 PM - SPINE: Poller[0] DEBUG: SS[0] Script Server Shutdown Started
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DS[875] SS[0] SERVER: path_cacti/scripts/ss_fping.php ss_fping hostnameattemptsprotocolport, output: U
12/04/2008 02:45:02 PM - PHPSVR: Poller[0] WARNING: PHP Script File to be included, does not exist
12/04/2008 02:45:02 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_fping.php' FUNC: 'ss_fping' PARMS: 'hostnameattemptsprotocolport'
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DS[7] SCRIPT: perl /usr/share/cacti/scripts/unix_processes.pl, output: 118
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 9
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DS[6] SCRIPT: perl /usr/share/cacti/scripts/unix_users.pl , output: 1
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 9
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DS[5] SCRIPT: perl /usr/share/cacti/scripts/loadavg_multi.pl, output: 1min:0.21 5min:0.17 10min:0.21
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 9
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DS[4] SCRIPT: perl /usr/share/cacti/scripts/linux_memory.pl SwapFree:, output: 2031540
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 9
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DS[3] SCRIPT: perl /usr/share/cacti/scripts/linux_memory.pl MemFree:, output: 31000
12/04/2008 02:45:02 PM - SPINE: Poller[0] Host[1] DEBUG: The POPEN returned the following File Descriptor 9
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: SS[0] Confirmed PHP Script Server running
12/04/2008 02:45:02 PM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is spine
12/04/2008 02:45:02 PM - PHPSVR: Poller[0] DEBUG: FILENM: /usr/share/cacti/script_server.php
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: SS[0] PHP Script Server Child FORK Success
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: SS[0] PHP Script Server About to FORK Child Process
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: SS[0] PHP Script Server Routine Starting
12/04/2008 02:45:02 PM - SPINE: Poller[0] SPINE: Initializing PHP Script Server(s)
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: The PHP Script Server is Required
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: StartHost='0', EndHost='23', TotalPHPScripts='1'
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: The number of php script servers to run is 1
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: The script timeout is 25
12/04/2008 02:45:02 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'script_timeout''


Any help?
Back to top
neteng30



Joined: 13 Nov 2008
Posts: 12

PostPosted: Thu Dec 04, 2008 3:06 pm    Post subject: more info Reply with quote

If i try to run a php script I get no response.

[root@localhost cacti]# php script_server.php
PHP Script Server has Started - Parent is cmd


^C
[root@localhost cacti]# cd scripts
[root@localhost scripts]# php ss_fping.php 4.2.2.1 ICMP
[root@localhost scripts]#
Back to top
reboot



Joined: 05 Mar 2006
Posts: 16
Location: The Netherlands

PostPosted: Sat Dec 13, 2008 7:39 am    Post subject: Re: more info Reply with quote

neteng30 wrote:
After install my graph will not appear because cacti says...+

ERROR: the RRD does not contain an RRA matching the chosen CF
any ideas?


neteng30 wrote:
If i try to run a php script I get no response.

[root@localhost cacti]# php script_server.php
PHP Script Server has Started - Parent is cmd


^C
[root@localhost cacti]# cd scripts
[root@localhost scripts]# php ss_fping.php 4.2.2.1 ICMP
[root@localhost scripts]#


Got the same problem over here. I do not get anything.
I've commented line 12. (edited it to: //error_reporting(0);
This enables errors php is giving.
When I run the command it gives an error:

Fatal error: Call to undefined function read_config_option() in /usr/share/cacti/site/scripts/ss_fping.php on line 42.

This script seems to be old and some functions it needs do not exist in the included files (seems correct, because these are in lib/functions.php).

So I traced the function calls for read_config_option() in ss_fping.php.
I commented the rows by adding two slashes for the row and manually typed a value for the variable.

scripts/ss_fping.php line 42:
Code:

        $script_timeout = 10;
        $ping_timeout = 5;
//      $script_timeout = read_config_option("script_timeout");
//      $ping_timeout = read_config_option("ping_timeout");


There was also a function call at line 100. I replaced this call by a variable;

scripts/ss_fping.php line 100:
Code:

        $i = 0;
        while ($i < $ping_sweeps) {
                $result = $ping->ping(AVAIL_PING,
                                        $method,
                                        $ping_timeout,
                                        1);


Now, when I run the command: sudo /usr/bin/php ss_fping.php localhost
I get:
min:0.0600 avg:0.0683 max:0.1100 dev:0.0186 loss:0.0000

So this fixes my script problem. I've imported the latest script a few post above this one. But i'm not getting any graphs. I will debug for a while and report later.

I've found out cacti doesn't like the template:

Code:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="ping test - Advanced Ping" \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=10 \
--lower-limit=0 \
--units-exponent=1 \
--vertical-label="milliseconds" \
--slope-mode \
--font TITLE:9: \
--font AXIS:7: \
--font LEGEND:7: \
--font UNIT:7: \
DEF:a="/var/lib/cacti/rra/ping_test_max_328.rrd":min:AVERAGE \
DEF:b="/var/lib/cacti/rra/ping_test_max_328.rrd":avg:AVERAGE \
DEF:c="/var/lib/cacti/rra/ping_test_max_328.rrd":max:AVERAGE \
DEF:d="/var/lib/cacti/rra/ping_test_max_328.rrd":loss:AVERAGE \
DEF:e="/var/lib/cacti/rra/ping_test_max_328.rrd":dev:AVERAGE \
DEF:f="/var/lib/cacti/rra/ping_test_max_328.rrd":avg:MAX \
DEF:g="/var/lib/cacti/rra/ping_test_max_328.rrd":avg:LAST \
DEF:h="/var/lib/cacti/rra/ping_test_max_328.rrd":min:LAST \
DEF:i="/var/lib/cacti/rra/ping_test_max_328.rrd":loss:MAX \
DEF:j="/var/lib/cacti/rra/ping_test_max_328.rrd":min:MAX \
DEF:ba="/var/lib/cacti/rra/ping_test_max_328.rrd":max:MAX \
DEF:bb="/var/lib/cacti/rra/ping_test_max_328.rrd":dev:MAX \
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:cdefbe=e,2,/ \
CDEF:cdefbg=c,b,-,e,-,3,/ \
CDEF:cdefca=b,a,-,0.2,* \
CDEF:cdefch=d,0,GT,d,2,GT,UNKN,a,IF,UNKN,IF \
CDEF:cdefci=d,3,GT,d,5,GT,UNKN,a,IF,UNKN,IF \
CDEF:cdefcj=d,5,GT,d,10,GT,UNKN,a,IF,UNKN,IF \
CDEF:cdefda=d,10,GT,d,15,GT,UNKN,a,IF,UNKN,IF \
CDEF:cdefdb=d,15,GT,d,50,GT,a,INF,IF,UNKN,IF \
CDEF:cdefdc=d,50,GT,d,95,GT,UNKN,a,IF,UNKN,IF \
CDEF:cdefdd=d,95,GT,d,100,GT,UNKN,a,IF,UNKN,IF \
LINE1:a:""  \
LINE1:b:""  \
LINE1:c:""  \
LINE1:d:""  \
LINE1:e:""  \
COMMENT:"   Pkt Loss\:"  \
AREA:cdefg#AFECEDFF:"1-2%"  \
AREA:cdefh#55D6D3FF:"3-5%"  \
AREA:cdefi#7CB3F1FF:"6-10%"  \
AREA:cdefj#4668E4FF:"11-15%"  \
AREA:cdefba#A150AAFF:"16-50%"  \
AREA:cdefbb#FF00FFFF:"51-95%"  \
AREA:cdefbc#F51D30FF:"96-100%\n"  \
AREA:g#FFFFFFFF:""  \
AREA:cdefbe#333333FF:"":STACK \
AREA:cdefbe#555555FF:"":STACK \
AREA:cdefbg#888888FF:"":STACK \
AREA:cdefbg#AAAAAAFF:"":STACK \
AREA:cdefbg#CCCCCCFF:"":STACK \
AREA:h#FFFFFFFF:""  \
AREA:cdefca#CCCCCCFF:"":STACK \
AREA:cdefca#AAAAAAFF:"":STACK \
AREA:cdefca#888888FF:"":STACK \
AREA:cdefca#555555FF:"":STACK \
AREA:cdefca#333333FF:"":STACK \
GPRINT:d:AVERAGE:"   Avg Loss\:%6.2lf%%"  \
GPRINT:i:MAX:"Max Loss\:%6.2lf%%\n"  \
AREA:cdefch#AFECEDFF:""  \
AREA:cdefci#55D6D3FF:""  \
AREA:cdefcj#7CB3F1FF:""  \
AREA:cdefda#4668E4FF:""  \
AREA:cdefdb#A150AAFF:""  \
AREA:cdefdc#FF00FFFF:""  \
AREA:cdefdd#F51D30FF:""  \
COMMENT:"    Latency\:"  \
GPRINT:h:LAST:"Min\:%8.2lf ms"  \
GPRINT:g:LAST:"Avg\:%8.2lf ms"  \
GPRINT:c:LAST:"Max\:%8.2lf ms"  \
GPRINT:e:LAST:"Dev\:%8.2lf ms\n"  \
COMMENT:"Avg Latency\:"  \
GPRINT:a:MIN:"Min\:%8.2lf ms"  \
GPRINT:b:AVERAGE:"Avg\:%8.2lf ms"  \
GPRINT:ba:MAX:"Max\:%8.2lf ms"  \
GPRINT:e:AVERAGE:"Dev\:%8.2lf ms\n"  \
LINE1:g#00BD27FF:""

RRDTool Says:

ERROR: the RRD does not contain an RRA matching the chosen CF


I have no idea what this error means. Anyone?!
Back to top
plotting4fun



Joined: 11 Dec 2008
Posts: 23

PostPosted: Tue Dec 16, 2008 10:58 am    Post subject: Reply with quote

Quote:
12/16/2008 01:50:44 PM - PHPSVR: Poller[0] DEBUG: INC: 'lt;path_cactigt;/scripts/ss_fping.php' FUNC: 'ss_fping' PARMS: 'lt;hostnamegt; lt;attemptsgt; lt;prot
ocolgt; lt;portgt;'
12/16/2008 01:50:44 PM - PHPSVR: Poller[0] WARNING: PHP Script File to be included, does not exist
12/16/2008 01:50:44 PM - PHPSVR: Poller[0] WARNING: Function does not exist
12/16/2008 01:50:44 PM - CMDPHP: Poller[0] Host[30] DS[442] WARNING: Result from SERVER not valid. Partial Result: WARNING: Function do
12/16/2008 01:50:44 PM - CMDPHP: Poller[0] Host[30] DS[442] SERVER: lt;path_cactigt;/scripts/ss_fping.php ss_fping lt;hostnamegt; lt;attemptsgt; lt;protocolg
t; lt;portgt;, output: U


I've got this in my logs, and my graph is empty, what is the problem ?

Quote:
[root@ukmon002 cli]# cat /etc/cron.d/cacti
*/5 * * * * root /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
[root@ukmon002 cli]# php /var/lib/cacti/scripts/ss_fping.php ukjira001 20 ICMP
min:0.0200 avg:6.5525 max:30.1500 dev:9.2221 loss:0.0000
[root@ukmon002 cli]#
Back to top
reboot



Joined: 05 Mar 2006
Posts: 16
Location: The Netherlands

PostPosted: Tue Dec 16, 2008 2:39 pm    Post subject: Reply with quote

I've found the solution by using my modified php script (see previous post) and using the basic template in the start post of this topic.

When you get results by runnig the script through the command line, you should be able to get stats in cacti by using the correct template.
Back to top
plotting4fun



Joined: 11 Dec 2008
Posts: 23

PostPosted: Wed Dec 17, 2008 4:41 am    Post subject: Reply with quote

[root@ukmon002 ~]# php /var/lib/cacti/scripts/ss_fping.php ukmon001
min:0.8800 avg:4.9633 max:15.1300 dev:5.3669 loss:0.0000[root@ukmon002 ~]#

Thanks ! But in my case, the script works.
Back to top
andreagabellini



Joined: 29 Dec 2008
Posts: 1

PostPosted: Mon Dec 29, 2008 11:39 am    Post subject: Reply with quote

Hello,

I'm new in this forum and I just started to use this amazing template (version 2.1). To solve the error:

ERROR: the RRD does not contain an RRA matching the chosen CF

you have to add the "LAST" Consolidation Function to the rrd files. Cacti 0.8.7 defaults to only "AVERAGE" and "MAX". You can achieve this in two ways:

1) In "Data Sources" -> RRAs, modify the available RRAs adding LAST consolidation function. In this way you change the default.
2) In "Data Sources" -> RRAs, adds 5 RRAs cloning the existing and add LAST consolidation function as above, and in the Data Template modify "Associated RRA's" to use the new created RRAs.

Before the graphs works, you need to remove the rrd files and wait the poller...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page Previous  1, 2, 3 ... 23, 24, 25
Page 25 of 25

 



Powered by phpBB © 2001, 2005 phpBB Group