Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
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.
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
[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
### 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 ###
### 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.
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.
[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]#
[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
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: