(topic closed) ZOND plugin v0.32 released (beta)

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
johnrembo
Cacti User
Posts: 216
Joined: Mon Apr 24, 2006 3:33 am

Re: ERROR:could not parse graph template (68)

Post by johnrembo »

danwdoo wrote:Hello,
I was getting the same error as X505 and then I noticed it was on all graphs where Area was set to Last instead of average. Now maybe it is because of a misunderstanding I have in Cacti but I want all my graphs to display the last value and not anything averaged so I set them this way. Is this not the correct way to handle this? Should this be a valid entry for Zond to handle in a graph template? Even when I change the templates and the graphs come up the chart icons are only showing red x's =(. I could not help but notice X505 also has his set to Last instead of average as well on the screen shot he included.

Thanks!
No, don't adopt your graph templates to zond plug-in. I've almost finished new version which should handle complex templates easily. As soon as I will fix some pending security issues - I will upload it.
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

Re: Problem with Zond

Post by kwabbernoot »

Hi,
zorrosam wrote:Hi all,

i have two server with cacti and plugin zond.

The first has no problem ... when i click on zond i get the data in real time ... apart from the network interfaces.

On the second instead for all the graph i can't obtain any graph... the popup is blank and has no data.

Can you help me?

thanks!

sam
I have the same results, empty pages using Zond on Linux

Debugging zond delivers me this:
The generated URL when clicking on the Zond button is

Code: Select all

http://cacti_URL/plugins/zond/zond_init.php?lgid=1751&s_i_d=itqftdvasboqblrf41behf0rd7
When executing the command "php -v zond_init.php 1751" I get as output

Code: Select all

>php zon
d_init.php 1751
<HTML>
 <HEAD>
    <TITLE>NAGIOSPROD01 - CPU Usage</TITLE>
 </HEAD>
  <SCRIPT LANGUAGE=javascript>
    function resize_window(w,h) {
        var refresh=2;
        var wW = screen.width;
        var wH = screen.height;

        while (1) {

            if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                var ww = document.body.clientWidth;
                var wh = document.body.clientHeight;
            } else {
                var ww = window.innerWidth;
                var wh = window.innerHeight;
            }

            var diff_w = Math.round((w - ww)/refresh);
            var diff_h = Math.round((h - wh)/refresh);
            
            if (diff_w <1 && diff_h <1) {
                self.resizeBy(diff_w,diff_h);
                self.moveTo((wW-ww)/2,(wH-wh)/2);
                return;
            }
            
            self.moveTo((wW-ww)/2,(wH-wh)/2);
            self.resizeBy(diff_w,diff_h);
        }
    }
 </SCRIPT>
 <BODY onLoad=resize_window(600,258) style='background-color:#F9F9F9;margin:0'>
 <APPLET id = 'applet' codebase='http:///plugins/zond/' code='netzond.class' width=600 height=258'>
    <PARAM name='dataParams' value='time,time,mm:ss,,'>
    <PARAM name='SWParams' value=',1000,2,true,false,100,true,0,3'>
    <PARAM name='outerParams' value='1,1,Courier New,8,8,8,NAGIOSPROD01 - CPU Usage,,,,percent,netzond,true,1500,http:///plugins/zond/zond_process.php?s_i_d=c5kup0o07jkp9s3it40lfo9lq4&tasks=YTo1OntzOjQ2OiIzN...'>
    <PARAM name='innerParams' value='2,5,5,40,10,40,10,0,-1,false,true,false,false,solid,1,6,1,static,false'>
    <PARAM name='colorParams' value='208,208,208;240,240,240;232,232,232;245,202,202;0,0,0;255,255,255;255,0,0;0,0,255;0,255,0;0,0,0'>
    <PARAM name='objcolsParams' value='0,0,1,1,4,2,3,0,4,4,4,4,4,5,5,4'>
    <PARAM name='swString' value='0,plot,6,6,188,true,true,System,true,true,solid,1,false,false,false;1,stack-plot,7,7,188,true,true,User,true,true,solid,1,false,false,false;2,stack-plot,8,8,188,true,true,Nice,true,true,solid,1,false,false,false;3,line,9,9,255,true,true,Total,true,true,solid,1,false,false,false'>
 </APPLET>
 </BODY>
</HTML>
The assumption that follows is wrong, the output on / is normal it was executed on the console and not in a Browser. Please ignore it. Correct reason a few posts lower :cry:

The problem probably lies in this string

Code: Select all

codebase='http:///plugins/zond/' 
and
...true,1500,http:///plugins/zond/zond_process.php?s_i_d=c5kup0o07jkp9s3it40lfo9lq4&tasks=YTo1OntzOjQ2OiIzN...
If I check the setup.php file I noticed that the $config['url_path'] is taken from the cacti config.php variables. Due to the fact that my cacti runs in his own URL I use "/" as value for this string, thus the faulty URL in the Zond java code. Irt seems that the code does not use the real URL value.

Code: Select all

 $INITIAL_PATH = $PROTO.$_SERVER['HTTP_HOST'].(!empty($config['url_path']) ?
substr($config['url_path'],0,-1) : '');
Last edited by kwabbernoot on Mon Jul 30, 2007 6:21 am, edited 1 time in total.
Regards,
Kwabbernoot

OS : [b]Slackware 10.2.0[/b]
Cacti : [b]0.8.6j[/b]
Cactid : [b]0.8.6j[/b]
Apache : [b]1.3.34[/b]
PHP : [b]5.1.4[/b]
MySQL : [b]4.1.21[/b]
RRDTool : [b]1.2.12[/b]
Net-SNMP : [b]5.3.0[/b]
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I'm facing quite the same issues as kwabbernoot. It's a non-standard directory here, config.php is set to reflect this url, but $_SERVER['HTTP_HOST'] (zond_init.php line 261 in zond 0.31) seems not to be resolved correctly (well, in cli context this should be normal, but the web page is simply empty and no source code is shown).
Reinhard
User avatar
johnrembo
Cacti User
Posts: 216
Joined: Mon Apr 24, 2006 3:33 am

Re: Problem with Zond

Post by johnrembo »

kwabbernoot wrote:Hi,
zorrosam wrote:Hi all,

i have two server with cacti and plugin zond.

The first has no problem ... when i click on zond i get the data in real time ... apart from the network interfaces.

On the second instead for all the graph i can't obtain any graph... the popup is blank and has no data.

Can you help me?

thanks!

sam
I have the same results, empty pages using Zond on Linux

Debugging zond delivers me this:
The generated URL when clicking on the Zond button is

Code: Select all

http://cacti_URL/plugins/zond/zond_init.php?lgid=1751&s_i_d=itqftdvasboqblrf41behf0rd7
When executing the command "php -v zond_init.php 1751" I get as output

Code: Select all

>php zon
d_init.php 1751
<HTML>
 <HEAD>
    <TITLE>NAGIOSPROD01 - CPU Usage</TITLE>
 </HEAD>
  <SCRIPT LANGUAGE=javascript>
    function resize_window(w,h) {
        var refresh=2;
        var wW = screen.width;
        var wH = screen.height;

        while (1) {

            if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                var ww = document.body.clientWidth;
                var wh = document.body.clientHeight;
            } else {
                var ww = window.innerWidth;
                var wh = window.innerHeight;
            }

            var diff_w = Math.round((w - ww)/refresh);
            var diff_h = Math.round((h - wh)/refresh);
            
            if (diff_w <1 && diff_h <1) {
                self.resizeBy(diff_w,diff_h);
                self.moveTo((wW-ww)/2,(wH-wh)/2);
                return;
            }
            
            self.moveTo((wW-ww)/2,(wH-wh)/2);
            self.resizeBy(diff_w,diff_h);
        }
    }
 </SCRIPT>
 <BODY onLoad=resize_window(600,258) style='background-color:#F9F9F9;margin:0'>
 <APPLET id = 'applet' codebase='http:///plugins/zond/' code='netzond.class' width=600 height=258'>
    <PARAM name='dataParams' value='time,time,mm:ss,,'>
    <PARAM name='SWParams' value=',1000,2,true,false,100,true,0,3'>
    <PARAM name='outerParams' value='1,1,Courier New,8,8,8,NAGIOSPROD01 - CPU Usage,,,,percent,netzond,true,1500,http:///plugins/zond/zond_process.php?s_i_d=c5kup0o07jkp9s3it40lfo9lq4&tasks=YTo1OntzOjQ2OiIzN...'>
    <PARAM name='innerParams' value='2,5,5,40,10,40,10,0,-1,false,true,false,false,solid,1,6,1,static,false'>
    <PARAM name='colorParams' value='208,208,208;240,240,240;232,232,232;245,202,202;0,0,0;255,255,255;255,0,0;0,0,255;0,255,0;0,0,0'>
    <PARAM name='objcolsParams' value='0,0,1,1,4,2,3,0,4,4,4,4,4,5,5,4'>
    <PARAM name='swString' value='0,plot,6,6,188,true,true,System,true,true,solid,1,false,false,false;1,stack-plot,7,7,188,true,true,User,true,true,solid,1,false,false,false;2,stack-plot,8,8,188,true,true,Nice,true,true,solid,1,false,false,false;3,line,9,9,255,true,true,Total,true,true,solid,1,false,false,false'>
 </APPLET>
 </BODY>
</HTML>
The problem probably lies in this string

Code: Select all

codebase='http:///plugins/zond/' 
and
...true,1500,http:///plugins/zond/zond_process.php?s_i_d=c5kup0o07jkp9s3it40lfo9lq4&tasks=YTo1OntzOjQ2OiIzN...
If I check the setup.php file I noticed that the $config['url_path'] is taken from the cacti config.php variables. Due to the fact that my cacti runs in his own URL I use "/" as value for this string, thus the faulty URL in the Zond java code. Irt seems that the code does not use the real URL value.

Code: Select all

 $INITIAL_PATH = $PROTO.$_SERVER['HTTP_HOST'].(!empty($config['url_path']) ?
substr($config['url_path'],0,-1) : '');
thanks,
I will advertise this
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

... not solved ...

Post by zorrosam »

thanks to all for the reply to my post ...

i can't try yours recover procedure because the error is like this on my apache server :

[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Notice: Undefined index: argc in /var/www/cacti/plugins/zond/zond_init.php on line 13
[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Notice: Constant URL_PATH already defined in /var/www/cacti/include/config.php on line 106
[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Notice: A session had already been started - ignoring session_start() in /var/www/cacti/include/config.php on line 140
[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Fatal error: Cannot redeclare db_connect_real() (previously declared in /var/www/cacti/lib/database.php:36) in /var/www/cacti/lib/database.php on line 57

.... yours opinion?

thanks!

sam
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

Re: ... not solved ...

Post by kwabbernoot »

zorrosam wrote:thanks to all for the reply to my post ...

i can't try yours recover procedure because the error is like this on my apache server :

[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Notice: Undefined index: argc in /var/www/cacti/plugins/zond/zond_init.php on line 13
[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Notice: Constant URL_PATH already defined in /var/www/cacti/include/config.php on line 106
[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Notice: A session had already been started - ignoring session_start() in /var/www/cacti/include/config.php on line 140
[Mon Jul 30 11:29:58 2007] [error] [client xxxxxxxxxx] PHP Fatal error: Cannot redeclare db_connect_real() (previously declared in /var/www/cacti/lib/database.php:36) in /var/www/cacti/lib/database.php on line 57

.... yours opinion?

thanks!

sam
To quote zorrosam, my Apache error log shows the same

Code: Select all

[Mon Jul 30 13:00:54 2007] [error] PHP Notice:  Undefined index:  argc in /var/www/htdocs/cacti-plugin/plugins/zond/zond_init.php on line 13
[Mon Jul 30 13:00:54 2007] [error] PHP Notice:  Constant URL_PATH already defined in /var/www/htdocs/cacti-plugin/include/config.php on line 86
[Mon Jul 30 13:00:54 2007] [error] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/htdocs/cacti-plugin/include/config.php on line 120
[Mon Jul 30 13:00:54 2007] [error] PHP Fatal error:  Cannot redeclare addslashes_deep() (previously declared in /var/www/htdocs/cacti-plugin/include/config.php:124) in /var/www/htdocs/cacti-plugin/include/config.php on line 124
Maybe I made a mistake in my previous post, after posting it is came to my mind that the URL in the post maybe set to "/"because I was executing the commands in my console and not via the browser where the zond scripts take some info from the http session.
Regards,
Kwabbernoot

OS : [b]Slackware 10.2.0[/b]
Cacti : [b]0.8.6j[/b]
Cactid : [b]0.8.6j[/b]
Apache : [b]1.3.34[/b]
PHP : [b]5.1.4[/b]
MySQL : [b]4.1.21[/b]
RRDTool : [b]1.2.12[/b]
Net-SNMP : [b]5.3.0[/b]
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

Re: ... not solved ...

Post by kwabbernoot »

kwabbernoot wrote:

Code: Select all

[Mon Jul 30 13:00:54 2007] [error] PHP Notice:  Undefined index:  argc in /var/www/htdocs/cacti-plugin/plugins/zond/zond_init.php on line 13
[Mon Jul 30 13:00:54 2007] [error] PHP Notice:  Constant URL_PATH already defined in /var/www/htdocs/cacti-plugin/include/config.php on line 86
[Mon Jul 30 13:00:54 2007] [error] PHP Notice:  A session had already been started - ignoring session_start() in /var/www/htdocs/cacti-plugin/include/config.php on line 120
[Mon Jul 30 13:00:54 2007] [error] PHP Fatal error:  Cannot redeclare addslashes_deep() (previously declared in /var/www/htdocs/cacti-plugin/include/config.php:124) in /var/www/htdocs/cacti-plugin/include/config.php on line 124
The error in my case is due to the fact that my php.ini does not activate the setting "register_argc_argv", setting this to "On" enables the graph.

On most PHP systems however this settings is not activated in the php.ini file, this due to security/performance problems.
My personal advise towards PHP scripting is that you either develop your program that they do not need the functionality within the php.ini file or activate the global setting within your PHP scripts. this way other PHP environments on the same machine are not impacted.
Use the "ini_set" directive see URL http://de3.php.net/manual/en/function.ini-set.php
Unfortunately "argc-argv" settings can not be set by this option :cry:

The graph builds now, but I get the following output in my httpd error log

Code: Select all

tory
sh: IP_Address_of_device,CommunityString,.1.3.6.1.2.1.2.2.1.16.16777219: No such file or directory
sh: IP_Address_of_device,CommunityString,.1.3.6.1.2.1.2.2.1.10.16777219: No such file or directory
...
[/code]
Regards,
Kwabbernoot

OS : [b]Slackware 10.2.0[/b]
Cacti : [b]0.8.6j[/b]
Cactid : [b]0.8.6j[/b]
Apache : [b]1.3.34[/b]
PHP : [b]5.1.4[/b]
MySQL : [b]4.1.21[/b]
RRDTool : [b]1.2.12[/b]
Net-SNMP : [b]5.3.0[/b]
ABX
Cacti User
Posts: 68
Joined: Thu Mar 01, 2007 5:55 am

Post by ABX »

Thanks

Setting register_argc_argv to on in php.ini solved the issue.
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

... well done ...

Post by zorrosam »

well done my friend ....

for another time thanks to the community and yours members!

sam
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: ... not solved ...

Post by gandalf »

kwabbernoot wrote:...
The error in my case is due to the fact that my php.ini does not activate the setting "register_argc_argv", setting this to "On" enables the graph.

On most PHP systems however this settings is not activated in the php.ini file, this due to security/performance problems.
My personal advise towards PHP scripting is that you either develop your program that they do not need the functionality within the php.ini file or activate the global setting within your PHP scripts. this way other PHP environments on the same machine are not impacted.
Nice find. While I personally agree with most of your statements, I do not agree with activating them inside php scripts. IMHO, the security impact is too big and there should not be a need for it (without having investigated this very issue here)
Reinhard
User avatar
johnrembo
Cacti User
Posts: 216
Joined: Mon Apr 24, 2006 3:33 am

Re: ... not solved ...

Post by johnrembo »

kwabbernoot wrote: The error in my case is due to the fact that my php.ini does not activate the setting "register_argc_argv", setting this to "On" enables the graph.

On most PHP systems however this settings is not activated in the php.ini file, this due to security/performance problems.
My personal advise towards PHP scripting is that you either develop your program that they do not need the functionality within the php.ini file or activate the global setting within your PHP scripts. this way other PHP environments on the same machine are not impacted.
Use the "ini_set" directive see URL http://de3.php.net/manual/en/function.ini-set.php
Unfortunately "argc-argv" settings can not be set by this option :cry:

The graph builds now, but I get the following output in my httpd error log

Code: Select all

tory
sh: IP_Address_of_device,CommunityString,.1.3.6.1.2.1.2.2.1.16.16777219: No such file or directory
sh: IP_Address_of_device,CommunityString,.1.3.6.1.2.1.2.2.1.10.16777219: No such file or directory
...
Hello, firstly thanx for the accurate shot. I am deeply drowned in elimination of several previous problems so this "blank graphs" problem was still in queue.
I am trying ZOND on FreeBSD and Debian machines, where both php installations have register_argc_argv enabled by default.
Truth, I heard this is kind of security gap, but so is register_globals, or shell_exec. Moreover, cacti's cmd.php and script-server also uses this module. Currently I won't be able to force ZOND to work without this (maybe only in future releases), that also makes me to keep debugging as flexible as it can be.

Errors and notices are realy caused by command line debugging. I will try to eliminate them.

About last error - it seems part of string is missing while executing a command. Does this happend with all the graphs or only some special-ones (like those realated with external scripts or script-server) ?
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

Resolved in Zond v0.32

Post by kwabbernoot »

johnrembo wrote: About last error - it seems part of string is missing while executing a command. Does this happend with all the graphs or only some special-ones (like those realated with external scripts or script-server) ?
Well, that's the strange thing, the graphs are the Interface ones "Traffic bits/s" that are standard in Cacti and are using SNMP.

I actually added some screenshots where you will see:
- The actual graph in Cacti
- The Zond Graph
- Apache error log

This one taken from a Windows Device fails and generates the errors: see attached image zond_graph_error.jpg

This one, taken from a Cisco router works and thus generates no errors:
see attached image zond_graph_ok.jpg

this issue is resolved in Zond v0.32
Attachments
Graph Interface Traffic bits/s NOK
Graph Interface Traffic bits/s NOK
zond_graph_error.jpg (184.02 KiB) Viewed 7299 times
Graph Interface Traffic bits/s OK
Graph Interface Traffic bits/s OK
zond_graph_ok.jpg (189.38 KiB) Viewed 7299 times
Regards,
Kwabbernoot

OS : [b]Slackware 10.2.0[/b]
Cacti : [b]0.8.6j[/b]
Cactid : [b]0.8.6j[/b]
Apache : [b]1.3.34[/b]
PHP : [b]5.1.4[/b]
MySQL : [b]4.1.21[/b]
RRDTool : [b]1.2.12[/b]
Net-SNMP : [b]5.3.0[/b]
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

error on update

Post by zorrosam »

Hi all,

i obtain this error after the update of the plugin:

PHP Fatal error: Call to undefined function: str_split() in /var/www/cacti/plugins/zond/zond_functions.php

in my apache config ....

any idea?

sam
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

... update

Post by zorrosam »

Hi all,

i obtain this error after the update of the plugin:

PHP Fatal error: Call to undefined function: str_split() in /var/www/cacti/plugins/zond/zond_functions.php

in my apache config ....

any idea?

sam

---- update

The problem is on my Redhat 4 Linux Cacti.

On my other server with Redhat Linux 5 Cacti the plugin is ok.

.....
User avatar
zorrosam
Cacti User
Posts: 244
Joined: Thu May 03, 2007 3:17 pm
Location: Italy

ahh it seems str_split is a php 5 function only...

Post by zorrosam »

ahh it seems str_split is a php 5 function only... and im, guessin ur using php 4 or below...

i which way i can fix the code on my rehdat 4 with php4?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest