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

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

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

Post by phalek »

Hm, that sounds like it can't find the perl interpreter of the script "/var/www/cgi-bin/getSmokePingPath.pl"

The first two lines of that script actually has the windows path and the linux path in it. AS you're using Linux, you should make sure the Linux one is at the very top of that script.
Execute the following on the shell to know the right path to your perl installation:

Code: Select all

which perl
It should give you the following

Code: Select all

/usr/bin/perl
so the very first line of the above script should be

Code: Select all

#!/usr/bin/perl
depending on what "which perl" returns ...

In addition you can call that perl script from the comand line:

Code: Select all

perl /var/www/cgi-bin/getSmokePingPath.pl

It should provide you with some additional info.

Also make sure you actually did make that script executable:

Code: Select all

chmod +x /var/www/cgi-bin/getSmokePingPath.pl
post here if you still got any errors.
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

phalek, thanks for the reply,

Code: Select all

which perl
returns

Code: Select all

/usr/bin/perl
and I already removed the first line intended for windows.

the x bit was set and executing...

Code: Select all

perl /var/www/cgi-bin/getSmokePingPath.pl
returns

Code: Select all

Content-type: image/png
any other thoughts?

On an unrelated note, I downloaded nmid_plugin_0.3.9a_Build_126 and tried to install the Nagios Plugin. I do not have the getNagiosPath.pl file. Can you point me to where I get it?

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

Post by phalek »

Seems like I forgot to include that one in the cgi-bin dir, I've added it here and will update the tar later.

Btw, did you fill in the following lines in the perl script:

Code: Select all

### START OF WEB SERVCE SETTINGS ###
my $webservice_password = '';
my $webservice_url = '';
my $tmp_dir = '';
### END OF WEB SERVCE SETTINGS ###
it needs to look like:

Code: Select all

### START OF WEB SERVCE SETTINGS ###
my $webservice_password = 'mypassword';
my $webservice_url = 'http://servername/cacti/plugins/nmidWebService/webservice.php?wsdl';
my $tmp_dir = '/tmp/';
### END OF WEB SERVCE SETTINGS ###
Attachments
getNagiosPNPGraph.pl
Nagios Cacti plugin
(1.61 KiB) Downloaded 174 times
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

yes, I have modified the script, and when I navigate to the webservice_url, I get a page without errors?

let me ask a few quick questions?
My install of smokeping is in /usr/local/smokeping, and I put just the smokeping.cgi in /var/www/cgi-bin. Everything, including the htdocs folder is in /usr/local/smokeping. In reading about installing smokeping, I have seen a few different models. Since my http error_log indicates that cropper cannot be found, could it be something in my smokeping install???

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

Post by phalek »

hm ... wait a second, I think I know the "probable" error of this.

Did you actually create the smokeping config (the target section of it) using the webservice function ?

I've created a perl script for doing this and separated the smokeping config in a "config.header" file and the target stuff.

The Script then takes the config.header and the output from the webservice to create the final smokeping config.

Maybe that's the problem.

the smokpeing URL path and the cacti tree path needs to be the exact same. otherwise the plugin is unable to find the smokeping graph and doesn't return anything
Attachments
createSmokePingConfig.pl
(1.07 KiB) Downloaded 231 times
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

phalek wrote:hm ... wait a second, I think I know the "probable" error of this.

Did you actually create the smokeping config (the target section of it) using the webservice function ?
I discovered a txt file in my cacti root that was produced whenever I added hosts to be smokepinged and used that to create my target section.
phalek wrote:I've created a perl script for doing this and separated the smokeping config in a "config.header" file and the target stuff.
The Script then takes the config.header and the output from the webservice to create the final smokeping config.
I made the following mods to the script to get it to run, do these look correct?

Code: Select all

### START OF WEB SERVCE SETTINGS ###
my $webservice_password = 'admin';
my $webservice_url = 'http://xx.xx.xx.xx/cacti2/plugins/nmidWebService/webservice.php?wsdl';
my $tmp_dir = '/tmp/';
### END OF WEB SERVCE SETTINGS ###

system ('cat /usr/local/smokeping/etc/config.header > /usr/local/smokeping/etc/config');

open(CONFIG, ">>".'/usr/local/smokeping/etc/config');
I ran this script. First I got an error because config.header did not exist, so I create a blank one. Then it ran, the contents of config.header were still empty, buy my config file contained

Code: Select all

Error: Invalid Server
so I rolled back to a backup

in NMID in cacti, I have set my webservices password (typed in twice) the same as in this file. but, I do not have anything in the Smokeping UserID/Password (.htaccess) field because I do not use any security here. Is that OK??

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

Post by phalek »

well, the config.header file is just a file I created.

Look at your normal smokeping config and remove everything after the target section. That's the config.header file.

You could then do the following:

cat config.header > config
cat /path/to/the/text/file/you/mentioned >> config

then you should have a config file containing the smokeping setting (probes, email, html template stuff like that) plus the Target section with all the hosts in it.

The invalid server sais that the web-service was unable to retrieve the path to your Smokeping installation ( maybe it isn't setup in the nmid config section within cacti ?) But you can indeed use the txt file you mentioned instead of the web-service stuff.


for the htaccess stuff, it's ok if it is empty.
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

here is my nmid setup, additionally my WebService Password is set to the same thing as in the getSmokePingPath.pl file?

Also, Smokeping URL - Server 1 = http://localhost
What am I missing???
Attachments
cacti_smoke.jpg
cacti_smoke.jpg (72.99 KiB) Viewed 4565 times
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Please exchange the webservice.php file in cacti/plugins/nmidWebService with the one in the attached Tar GZ archive.

I had the very same problem weeks ago, but simply forgot to create a new Build including that file ... :-( sorry.
Attachments
webservice.php.tgz
(1.54 KiB) Downloaded 322 times
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

phalek,

I applied the new file but it had no effect.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

H. Do you have a txt file in /tmp ? It should be called "smokeping_nmid_spserver1_config.txt"

what's the content of that file ?

Also, If you got to the URL "/cacti/plugins/nmidWebService/webservice.php" you should see some webpage displaying the webservice stuff. The title of that page is "InteropTest". Is that the case ?
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

phalek wrote:H. Do you have a txt file in /tmp ? It should be called "smokeping_nmid_spserver1_config.txt"

what's the content of that file ?
I've trimmed some stuff out, but it is my cacti tree. I have used this to build my targets list in smokeping

Code: Select all


+ External
menu = External
title = External

++ VA
menu = VA
title = Location/Devices in VA

+++ VA_Firewall
menu = VAFirewall
title = Device VAFirewall
host = xx.xx.xx.xx

++ MD
menu = MD
title = Location/Devices in MD

+++ MD_Firewall
menu = MDFirewall
title = Device MDFirewall
host = xx.xx.xx.xx

Also, If you got to the URL "/cacti/plugins/nmidWebService/webservice.php" you should see some webpage displaying the webservice stuff. The title of that page is "InteropTest". Is that the case ?
Yep, I get an Interop tet page with links to
getsmokepingconfig
getciscoworksconfig
getsmokepinguser
etc

One thing to note, If I click on the magnifying glass on the cacti graph page, it takes me to the correct smokeping page/graph.

Thanks for all the help troubleshooting.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

ok, seems like something isn't working correctly with the webservice stuff
just do me favour then and create a config file for smokeping using that txt file.
So do a "cat /tmp/smokeping_nmid_spserver1_config.txt >> /path/to/smokeping/etc/config" replacing the target section with the one from that file

If you restart smokeping you should (hopefully ) be able to see the graphs in cacti ... ?
frasketi
Posts: 12
Joined: Tue Sep 16, 2008 7:59 pm

Post by frasketi »

I did all this, including restarting smokeping, no luck.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Man, if only I could logon to your box and have a look at this. It's probably something totally simple ... :-(

In Cacti, when the graphd isn't showing up, what's the URL to that image ? Should be something like

Code: Select all

http://server/cgi-bin/getSmokePingPath.pl?start=12314&end=123141&graphtype=example&target=MY.PATH.TO.THE.DEVICE 
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests