Smoke-ping 0.86c

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

Moderators: Developers, Moderators

Post Reply
metos
Posts: 16
Joined: Fri Mar 11, 2005 9:46 am

Post by metos »

This answer is not very helpful.... at the begining of the post the answer was: upgrade to 0.8.6.c .... :lol: the script is always the same.
boran11
Posts: 27
Joined: Mon Mar 21, 2005 8:52 am

Post by boran11 »

I had a similar problem noted in the thread higher up, and upgrading to "d" solved it. At least use the newest version? The script is not necessarily the problem.
roger69
Posts: 19
Joined: Mon Apr 04, 2005 2:05 pm

Fping script not returning properly

Post by roger69 »

I'm using the fping script from earlier in this thread, and I get

# perl /var/www/html/cacti/scripts/ping-latency.pl 66.121.1.37
66.121.1.37 : xmt/rcv/%loss = 10/10/0%, min/avg/max = 23.4/63.4/105
min:0.000 avg:0.000 max:0.000 dev:0.000 loss:0

This is on a Fedora Core box. I know fping works okay because I am
running smokeping itself on the same machine.

Anyone know what the problem might be? Obviously I have to get this
fixed before cacti will work.

Roger
roger69
Posts: 19
Joined: Mon Apr 04, 2005 2:05 pm

Better!

Post by roger69 »

Well, this script returns accurate results, and on a single line. So that's a huge improvement. And running a diff between it and the script back a ways in this thread shows tiny tiny differences.

Don'tcha just love scripting?

Thanks. Now I've got to get cacti to graph the output.

Roger
roger69
Posts: 19
Joined: Mon Apr 04, 2005 2:05 pm

Okay this is very odd

Post by roger69 »

Any idea about why this is happening? I'm using your the from just above. I don't understand why there are parts of data and then red. I've had this running for several days now.

The second image is from the smokeping script in cacti.

By comparison, the first image is from my live smokeping install.

Both are talking to the same Cisco router on the other end of a T1.

Roger
Attachments
GualalaCable_last_86400.png
GualalaCable_last_86400.png (15.96 KiB) Viewed 14818 times
graph_image.php.png
graph_image.php.png (7.3 KiB) Viewed 14821 times
_alex_
Posts: 17
Joined: Wed Feb 02, 2005 12:20 pm

Post by _alex_ »

I have a little problem with the graph
it seems that the rra is populated only when the collected values is equal to 9.0 .

here is my graph.

cacti version is 0.8.6d
Attachments
Sans titre.jpg
Sans titre.jpg (39.85 KiB) Viewed 14765 times
magnetyk
Posts: 34
Joined: Tue May 10, 2005 10:04 am

Post by magnetyk »

Hi,

When i try to add smokeping in the Associated data queries of a host it said :
Notice: Undefined index: arg_index in /usr/share/cacti/lib/data_query.php on line 97

Notice: Undefined index: script_path in /usr/share/cacti/lib/data_query.php on line 97

Warning: Variable passed to each() is not an array or object in /usr/share/cacti/lib/data_query.php on line 106

Warning: Variable passed to each() is not an array or object in /usr/share/cacti/lib/data_query.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/lib/data_query.php:97) in /usr/share/cacti/host.php on line 104
I read the .php file but i'm a nOob ;)
predou
Posts: 45
Joined: Fri Jan 07, 2005 8:42 am

Post by predou »

Roger69 > pour le rouge, çà veut dire que sur les 5 pings effectués durant la phase de pool, il n'a eu aucun réponse de l'équipement !!!
Vu que c un ping icmp sous fedora core 3 au départ, peut être tu as une distrib différente et ke le ping ne fonctionne pas pareil OU vérifies les valeurs récoltés par le ping au niveau du RRD et des logs cactis.

alex > I don't know why it blank, see logs and RRD file and ask me if necessary.

mangetyk > Don't try to add smokeping to associeted data query, it's not this.
My smoke ping script is composed from graph template, data source template, CDEF, GPRINT and a data input method ( script/command).
For your php's error, i can't debug that ( maybe php version , cacti version ... )
You just need to import and if you want to associated this with a device type, go to the device template directly and add Smokeping graph into it.
magarwal2
Posts: 6
Joined: Wed Jun 01, 2005 11:53 am

getting error in smokeping!

Post by magarwal2 »

i was trying to use smokeping template but i am getting an error that says:

RRDTool Says:

ERROR: invalid rpn expression in: a,g,-,0.2,*

I have downloaded the cacti_graph_template_smoke_ping.xml and added that to my list of templates , also I have also downloaded fping.

Am i doing the right thing??
Thanks!!
tightcode
Posts: 4
Joined: Fri Jun 03, 2005 2:57 am

Post by tightcode »

First of all I am new to cacti and have just been reading up on new templates. If someone needs help translating with predou back and forth let me know. (Predou si tu veux un coup de main pour comprendre ces anglophones, je suis disponible en tant que traducteur ;) )

To magnetyk:
You are getting those errors because of a missing check (well two in your example) in data_query.php. I have opened a bug for this already, but the quick fix is in data_query.php to make the following changes:
Starting at line 106 replace:

Code: Select all

	while (list($field_name, $field_array) = each($script_queries["fields"])) {
		if ($field_array["direction"] == "input") {
			$script_path = get_script_query_path((isset($script_queries["arg_prepend"]) ? $script_queries["arg_prepend"] . " ": "") . $script_queries["arg_query"] . " " . $field_array["query_name"], $script_queries["script_path"], $host_id);

			$script_data_array = exec_into_array($script_path);

			debug_log_insert("data_query", "Executing script query '$script_path'");

			for ($i=0;($i<sizeof($script_data_array));$i++) {
				if (preg_match("/(.*)" . preg_quote($script_queries["output_delimeter"]) . "(.*)/", $script_data_array[$i], $matches)) {
					$script_index = $matches[1];
					$field_value = $matches[2];

					db_execute("replace into host_snmp_cache
						(host_id,snmp_query_id,field_name,field_value,snmp_index,oid)
						values ($host_id,$snmp_query_id,'$field_name','$field_value','$script_index','')");

					debug_log_insert("data_query", "Found item [$field_name='$field_value'] index: $script_index");
				}
			}
		}
	}

	return true;
with

Code: Select all

	if (is_array($script_queries["fields"])) {
		while (list($field_name, $field_array) = each($script_queries["fields"])) {
			if ($field_array["direction"] == "input") {
				$script_path = get_script_query_path((isset($script_queries["arg_prepend"]) ? $script_queries["arg_prepend"] . " ": "") . $script_queries["arg_query"] . " " . $field_array["query_name"], $script_queries["script_path"], $host_id);
	
				$script_data_array = exec_into_array($script_path);
	
				debug_log_insert("data_query", "Executing script query '$script_path'");
	
				for ($i=0;($i<sizeof($script_data_array));$i++) {
					if (preg_match("/(.*)" . preg_quote($script_queries["output_delimeter"]) . "(.*)/", $script_data_array[$i], $matches)) {
						$script_index = $matches[1];
						$field_value = $matches[2];
	
						db_execute("replace into host_snmp_cache
							(host_id,snmp_query_id,field_name,field_value,snmp_index,oid)
							values ($host_id,$snmp_query_id,'$field_name','$field_value','$script_index','')");
	
						debug_log_insert("data_query", "Found item [$field_name='$field_value'] index: $script_index");
					}
				}
			}
		}
		return true;
	}
	else {
		debug_log_insert("data_query","script_queries['fields'] not an array");
		return false;
	}
And starting at line ~490 replace:

Code: Select all

	/* list each of the input fields for this snmp query */
	while (list($field_name, $field_array) = each($raw_xml["fields"])) {
		if ($field_array["direction"] == "input") {
			/* create a list of all values for this index */
			if (sizeof($data_query_index_array) == 0) {
				$field_values = db_fetch_assoc("select field_value from host_snmp_cache where host_id=$host_id and snmp_query_id=$data_query_id and field_name='$field_name'");
			}else{
				$field_values = db_fetch_assoc("select field_value from host_snmp_cache where host_id=$host_id and snmp_query_id=$data_query_id and field_name='$field_name' and $sql_or");
			}

			/* aggregate the above list so there is no duplicates */
			$aggregate_field_values = array_rekey($field_values, "field_value", "field_value");

			/* fields that contain duplicate or empty values are not suitable to index off of */
			if (!((sizeof($aggregate_field_values) < sizeof($field_values)) || (in_array("", $aggregate_field_values) == true) || (sizeof($aggregate_field_values) == 0))) {
				array_push($xml_outputs, $field_name);
			}
		}
	}
with

Code: Select all

	/* list each of the input fields for this snmp query */
	if (is_array($raw_xml["fields"])) {
		while (list($field_name, $field_array) = each($raw_xml["fields"])) {
			if ($field_array["direction"] == "input") {
				/* create a list of all values for this index */
				if (sizeof($data_query_index_array) == 0) {
					$field_values = db_fetch_assoc("select field_value from host_snmp_cache where host_id=$host_id and snmp_query_id=$data_query_id and field_name='$field_name'");
				}else{
					$field_values = db_fetch_assoc("select field_value from host_snmp_cache where host_id=$host_id and snmp_query_id=$data_query_id and field_name='$field_name' and $sql_or");
				}
	
				/* aggregate the above list so there is no duplicates */
				$aggregate_field_values = array_rekey($field_values, "field_value", "field_value");
	
				/* fields that contain duplicate or empty values are not suitable to index off of */
				if (!((sizeof($aggregate_field_values) < sizeof($field_values)) || (in_array("", $aggregate_field_values) == true) || (sizeof($aggregate_field_values) == 0))) {
					array_push($xml_outputs, $field_name);
				}
			}
		}
	}
Now this will not specifically fix your problem but it will catch those errors so that you can see cacti's output to see what your actual problem is since the errors thrown are preventing you from seeing anything.

Cheers everyone, TC

Post Scriptum: there are more elegant and optimal ways of handling that bug, I just think that is the easiest to cut and paste without reviewing more of the code to see what function returns are expected where etc...
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

tightcode,

In addition to fixing the error outlined in bug#0000481, I also fixed the errors you mentioned in this thread. Both fixes will appear in the soon to be released 0.8.6e.

-Ian
tightcode
Posts: 4
Joined: Fri Jun 03, 2005 2:57 am

Post by tightcode »

Thank you raX (Ian) I am really quite pleased with cacti, I look forward to using it more and more so I can discover the features I am not yet using.

Take care and thanks again for fixing those little errors.

Cheers, TC
mlist
Cacti User
Posts: 50
Joined: Thu May 26, 2005 3:12 pm

import xml fails with cacti 0.8.6d

Post by mlist »

I have cacti 0.8.6d+thold 2.1a+monitor plugin of fedora c3. All work fine but, when I try to import (through my browser, menu "import template") cacti_graph_template_smoke_ping.xml, the error is:

Error: XML: Cacti version does not exist

If I try to import template from text, the error is:
Error: XML: Cacti version does not exist

I read some posts about this type of problems but I didn't find a solution.

Can someone help me please?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It would appear that you file include/config_arrays.php is damaged. You need to look to the maintainers of those addons for support. We are trying to get them more prepared for our upcomming releases as we don't like to see people suffer.

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?
mlist
Cacti User
Posts: 50
Joined: Thu May 26, 2005 3:12 pm

Post by mlist »

TheWitness

I'll try to contact authors but I think :-? that the problem could be more serious because I'm sure that my config_arrays.php is not corrupted because I tried to import various template (not only smokeping) from 2 different machines (both fedora c3 with cacti 0.8.6d+thold 2.1a+monitor plugin).
I thing all modules should be updated from authors in order to work with cacti 0.8.6d or, instead, it could be a problem related to cacti 0.8.6d that needs something.
What do you think???


As usual....thanks for you kind reply.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest