Network Management Integration Plugin ( v0.3.9a Build 129 )

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

I installed the WebService Plugin this morning and have been having a difficult time getting it to work. My Cacti install is version 0.8.7d with PA 2.4. I installed the WebService via Plugin Management, set a password, and made the password and url changes to the getGraph.pl file.

When I try to pull up a graph via url (http://cacti.mydomain.com/cgi-bin/getGraph.pl?lgid=4714) I get :

Code: Select all

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.59 (CentOS) Server at x.x.x.x Port 80
The httpd error log shows:

Code: Select all

[Wed Jul 01 11:37:54 2009] [error] [client x.x.x.x] (8)Exec format error: exec of '/var/www/cgi-bin/getGraph.pl' failed
[Wed Jul 01 11:37:54 2009] [error] [client x.x.x.x] Premature end of script headers: getGraph.pl
Any suggestions would be helpful. I can't seem to find what's causing the failure.

Thanks,

Mike
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

run it via the cli and post the output here. it gives more info on what is wrong than http.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

Code: Select all

[cgi-bin]# perl /var/www/cgi-bin/getGraph.pl
multiple roots, wrong element 'b'
<br />
<b>Warning</b>:  fread() [<a href='function.fread'>function.fread</a>]: Length parameter must be greater than 0 in <b>/var/www/html/plugins/nmidWebService/webservice.php</b> on line <b>82</b><br />
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getGraphResponse xmlns:ns1="http://soapinterop.org/"><return xsi:type="xsd:string"></return></ns1:getGraphResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> at /var/www/cgi-bin/getGraph.pl line 21
phalek, thanks for the assistance.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

what is configured in the following section:

Code: Select all

### START OF WEB SERVCE SETTINGS ###
my $webservice_password = 'guest';
my $webservice_url = 'http://redmine.nmid-plugins.de:8080/cacti/plugins/nmidWebService/webservice.php?wsdl';
my $tmp_dir = '/tmp/';
### END OF WEB SERVCE SETTINGS ###
?

It should match your server, password and tmp dir
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

Code: Select all

### START OF WEB SERVCE SETTINGS ###
my $webservice_password = '123456';
my $webservice_url = 'http://x.x.x.x/plugins/nmidWebService/webservice.php?wsdl';
my $tmp_dir = '/tmp/';
### END OF WEB SERVCE SETTINGS ###
The password matches what has been entered under the NMID tab in the Cacti settings. URL matches Cacti install, and if I browse to http://x.x.x.x/plugins/nmidWebService/webservice.php I get the InteropTest page. The "/tmp" directory exists with root as owner/group.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

ok,

where did you get the nmidWebService from ?

http://redmine.nmid-plugins.de/projects ... webservice

or from this post ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

Yes. from that link. Actually from the link at the bottom of this post, which redirects to the download here.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Ok, this might be a permission problem.

The tmp dir in the nmidWebService plugin must be writeable by the webserver:

Code: Select all

[root@redmine cacti]# ls -l  plugins/nmidWebService/
total 32
-rwxr-xr-x 1 root   root    633 Jun  9 21:28 create_image.php
-rw-rw-rw- 1 apache apache   44 Feb 28  2008 index.php
drwxrwxrwx 2 apache apache 4096 Dec  2  2008 lib
-rw-rw-rw- 1 apache apache 2986 Jun  9 22:11 setup.php
drwxrwx--- 2 apache apache 4096 Jul  1 21:06 tmp
-rw-rw-rw- 1 apache apache 8694 Jun  9 22:10 webservice.php
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Odd. phpBB doesn't display my last post in Google Chrome :-)
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

I've changed the permissions to match what you provided in the last post.

Code: Select all

 [root@cacti nmidWebService]# ls -l
total 32
-rwxr-xr-x  1 root   root    633 Jul  1 08:34 create_image.php
-rw-rw-rw-  1 apache apache   44 Jul  1 08:34 index.php
drwxrwxrwx  2 apache apache 4096 Jul  1 08:34 lib
-rw-rw-rw-  1 apache apache 2986 Jul  1 08:34 setup.php
drwxrwx---  2 apache apache 4096 Jul  2 10:11 tmp
-rw-rw-rw-  1 apache apache 8694 Jul  1 08:34 webservice.php
I still get an Internal Server Error when trying to display from the browser. However, I'm getting a different error now when I try to run getGraph.pl from the CLI.

Code: Select all

[root@cacti httpd]# perl /var/www/cgi-bin/getGraph.pl

junk after document element at line 2, column 0, byte 7 at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/XML/Parser.pm line 187
<br />
<b>Warning</b>:  fread() [<a href='function.fread'>function.fread</a>]: Length parameter must be greater than 0 in <b>/var/www/html/plugins/nmidWebService/webservice.php</b> on line <b>82</b><br />
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getGraphResponse xmlns:ns1="http://soapinterop.org/"><return xsi:type="xsd:string"></return></ns1:getGraphResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> at /var/www/cgi-bin/getGraph.pl line 21
[root@cacti httpd]# 
httpd error_log output

Code: Select all

[Thu Jul 02 10:11:11 2009] [error] [client x.x.x.x] PHP Warning:  fread() [<a href='function.fread'>function.fread</a>]: Leng
th parameter must be greater than 0 in /var/www/html/plugins/nmidWebService/webservice.php on line 82
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

I cannot reproduce this error on my server(s).

Neovox, can we schedule a web-meeting to work on this error ?

Basically, the error "Length parameter must be greater than 0" error sais, that you're trying to get a non-existing graph graph.

The CLI interface takes a default value if you didn't specify anything, go edit the getGraph.pl file and change the number at the end of following line to something that is existing in your environment:

Code: Select all

...
my $lgid = $query->param('lgid') || 697;
...
Then re-run the perl /var/www/cgi-bin/getGraph.pl script and see what it is putting out then ...
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

Ok. Tired changing the default image from 1 to 2933, which is an active graph, and got output that looks like it's likely correct.

Code: Select all

[root@cacti cgi-bin]# perl ./getGraph.pl
Content-type: image/png

‰PNG

IHDR‡6`aGItEXtSoftwareRRDtool, Tobias Oetiker <tobi@oetike.ch>, http://tobi.oetiker.chƒ\aà IDATxí½y´U™þϨdè@K£Ì$Ih €È ÍjífA#*
üífI3ô‚ì^m+ˆ°¤»],‘¹›a”Y!d"@Büçû÷þ婳öIÝ“:Ó'÷¾÷ֽϹëÜ:§ªžý>ûÙÏ®ª·vªufÏžü¶ö€=`Øö€=`Øö€=`Œ]üú׿NëØc×n{·½=`Øö€=`Øö€=`(1þùÏN~[{À°ì{À°ì{À°Æ–   ETC....
Still getting internal server error from browser. Perhaps this is an Apache issue.
Last edited by neovox on Mon Jul 06, 2009 9:35 am, edited 1 time in total.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

but then it should show up in the log if it's an apache problem ...

i can provide a binary if you like and try it with the binary. I only need to know the operating system you use.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
User avatar
neovox
Cacti User
Posts: 52
Joined: Tue Jan 02, 2007 8:22 am
Location: MI

Post by neovox »

sure i'll give that a try. Running CentOS - a CactiEZ install.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

I've created a binary for the getGraph.pl file. It needs to be configured with the getGraph.ini file which needs to be placed in the same dir.

When installed just call it the usual way:

Code: Select all

http://myserver/cgi-bin/getGraph.bin?lgid=<local_graph_id>
e.g.
http://78.47.109.218/cgi-bin/getGraph.bin?lgid=1

replace the "<local_graph_id>" with a working/existing graph.

Nevertheless, I got the script working in CactiEz using the RHEL repository from Dag http://dag.wieers.com/rpm/FAQ.php#B.

How did you install the required perl-SOAP-Lite libs, via CPAN or yum ?

The binary files can be downloaded from the Project Page
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest