Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
icetoad
Cacti User
Posts: 65
Joined: Wed Oct 18, 2006 6:20 pm
Location: Orlando
Contact:

Post by icetoad »

wow divagater, you have been busy!

Cant wait to try this out on my new server build. I was using your old NPC on the old nagios server.

Looks really good! <shakes with anticipation>
Quote from Bash.org: "I was once thrown out of barnes and noble for moving the bibles to the fiction section."
schweet
Posts: 13
Joined: Thu Jun 04, 2009 11:12 am

to data on npc dashboard

Post by schweet »

Hi Guys;

You all seem to have resolved your issues by hacking many things:

inserting this line into lib/Doctrine/Connection.php:
$this->dbh = new PDO('mysql:host=localhost;dbname=test','root','xxxxxxxxxx');

modifying file config.php:
and replacing...
#$dsn = "$database_type://$database_username:$database_password@$database_hostname:$database_port/$database_default";

With

$dsn = "$database_type://'$database_username':'$database_password'@'$database_hostname':$database_port/$database_default";


I have done all this and yet, i see nothing, when I tail "/usr/local/nagios/var/ndo2db.debug" I am seeing data being written to the db. However, nothing appears on npc dashboard.

PLEASE Help.
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: to data on npc dashboard

Post by divagater »

schweet wrote:I have done all this and yet, i see nothing, when I tail "/usr/local/nagios/var/ndo2db.debug" I am seeing data being written to the db. However, nothing appears on npc dashboard.

PLEASE Help.
Hi. First, grab the latest config.php from trunk here: http://trac2.assembla.com/npc/export/20 ... config.php

This is the config.php which will go out with 2.0.3 soon and fixes any issues with special characters in mysql usernames or passwords. Drop config.php into <cacti_dir>/plugins/npc/ overwriting the original.

Once that is in place reload npc while tailing your apache error log (not the access log). Watch for any error statements and post them here. Also please verify that PDO, MySQL, and JSON support are installed for your version of PHP which should be at least 5.1.x

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

icetoad wrote:wow divagater, you have been busy!

Cant wait to try this out on my new server build. I was using your old NPC on the old nagios server.

Looks really good! <shakes with anticipation>
It warms my heart to know that the old 0.1 version of NPC was still running somewhere but talk about waiting to upgrade :) That is some really old code and has little in common with this version. Let me know how it goes getting up and running.

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
schweet
Posts: 13
Joined: Thu Jun 04, 2009 11:12 am

to data on npc dashboard

Post by schweet »

Hi Guys;

I have now resolved this issue by deleting the database, recreating it, reimporting my old cacti.sql dump and adding this change to resolve one other BUG in mysql:

ALTER TABLE `npc_configfilevariables` DROP INDEX `instance_id` , ADD INDEX `instance_id` ( `instance_id` , `configfile_id` );

The line above is to resolve error with ndo2db not able to write to this table.

problem 1/ Just another questions, any ideas why when I click on NPC tab, select a host, then click on the "view graph" a popup opens, sometimes this popup has a drop down list of hosts etc and other times it does not? Also, when i click on a host to bring up the graphs, nothing happens, I see no graphs and no button to click i.e. "OK" or anything of that sort...

Problem 2/ I also get a bunch of error from php in apache_error log:

[error] [client 127.0.0.1] script '/var/www/html/graph_image.php' not found or unable to stat, referer: http://bendalg-xp.galadirectory.co.uk/c ... drawLayout

[error] [client 127.0.0.1] PHP Notice: Undefined index: action in /var/www/html/cacti/plugins/npc/top_graph_header.php on line 95, referer: http://bendalg-xp.galadirectory.co.uk/c ... eaf_id=121
Attachments
npc screenshot.doc
Screenshot of the popup with nothing showing...
(1.19 KiB) Downloaded 329 times
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: to data on npc dashboard

Post by divagater »

schweet wrote:Hi Guys;

...adding this change to resolve one other BUG in mysql:

ALTER TABLE `npc_configfilevariables` DROP INDEX `instance_id` , ADD INDEX `instance_id` ( `instance_id` , `configfile_id` );

The line above is to resolve error with ndo2db not able to write to this table.
Good catch on that bad index. I have updated trunk so the index will be correct in the next release. That table is not currently used by NPC which is most likely why its gone uncaught for so long.

As far as the graphs go it looks like NPC is not getting your base cacti path correctly as shown by the error referencing this path: '/var/www/html/graph_image.php'

I will take a look to see why that is happening.

The graphing handling was thrown in at the last minute before NPC 2 was first released and it shows. I have been working on some ideas on how to actually integrate NPC and Cacti a little more tightly in terms of tying graphs to services and hosts. I have 1 more bug and performance fix to get out and then I will really dig into graphing and syncing of hosts and services. If ya have any ideas on what you would like to see I am all ears.

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
schweet
Posts: 13
Joined: Thu Jun 04, 2009 11:12 am

graphing on npc

Post by schweet »

Hi Billy;

Marvellous job mate. If everyone contributes as much as they can, this will no doubt become the de facto tool for monitoring in the opensource community.

A few of us reviewed cacti graphing and thought the entire graphing functionality within cacti can be brought into NPC, this would be awesome. I.e. new graphs created or existing graphs within the graphing section of cacti be made available within NPC. SO if a host has several graphs already, then NPC should make it possible to view it when a host is selected.

Another separate point, within the dashboard area, you have below the tabs "status" information detailing no of critical warnings, hosts down and so on... it would be great if one can click on that cell and have a look at which hosts have failed or are in critical state? Hope you know what I mean...

Another bug: I think: when viewing dashboard, if you click on "x" to close a service window, there is no way to get that back?

Should further clarifications be required, please let me know.

Thanks again for all your help.

Ali.
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: graphing on npc

Post by divagater »

schweet wrote:A few of us reviewed cacti graphing and thought the entire graphing functionality within cacti can be brought into NPC, this would be awesome. I.e. new graphs created or existing graphs within the graphing section of cacti be made available within NPC. SO if a host has several graphs already, then NPC should make it possible to view it when a host is selected.
I was thinking along these same lines as well so its good to know others would like to see this. This will be a "must" for the release that includes the integration updates sometime in the next couple months.
Another separate point, within the dashboard area, you have below the tabs "status" information detailing no of critical warnings, hosts down and so on... it would be great if one can click on that cell and have a look at which hosts have failed or are in critical state? Hope you know what I mean...
Great recommendation. I think I can sneak this one into one of the next 2.0.x releases.
Another bug: I think: when viewing dashboard, if you click on "x" to close a service window, there is no way to get that back?


To get the portlets back click on the 'Portlets' button on the far right of the toolbar under the Dashboard tab.

Thanks for all the feedback Ali.

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

NPC 2.0.3 Released

Post by divagater »

This release just fixes a few bugs that have popped up. See the first thread for the download.

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
erickbe
Cacti User
Posts: 52
Joined: Sat Jan 17, 2009 1:01 am

Mysql error on upgrade sql file

Post by erickbe »

When I run the upgrade_scheme against my db, I get a duplicate key error. Not sure if this is a big deal or not. I had this with previous updates from 2.x to newer 2.x releases so the key is probably already there. Everything is working fine, just not sure if this is a big deal or not.

mysql -u nagios -p cacti < upgrade_schema.sql
Enter password:
ERROR 1061 (42000) at line 2: Duplicate key name 'idx1'
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

The duplicate key error is ok. That just means you have that particular index already. I have left that index script out there because I want to make sure that people who were running NPC below 2.0.2 get the indexes added.

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
therockyb
Posts: 3
Joined: Mon Jun 08, 2009 4:24 pm

Post by therockyb »

Hi,

NPC is a great plugin, good work !

My question is regarding to N2C, I am trying to import the thousands of host from my nagios to cacti by using N2C but without success.

When selecting the hostgroup then the template I click on import and then I see the list of host with no status ''imported'' nor ''mapped'' and the hosts are not in cacti.

I tried to elevate the logging from npc and cacti but both without success, I don't have any relevant details.

I had a look at error.log from apache2 and other logs without finding anything relevant.

Anybody would have an idea ?

Thank you
terjet
Posts: 1
Joined: Mon Apr 06, 2009 7:34 am

Cannot get host icons

Post by terjet »

Hi,,

Just upgraded from NPC 2.0.0 to 2.0.3..Everything works fine, but with the new release I should be able to see my Nagios icons... However no icons are displayed in NPC,, only the usual red,green, yellow dots.

I have also checked the NPC settings and made sure that they are ticked.

Any suggenstions?

/tt
ZarayK
Posts: 3
Joined: Wed Apr 29, 2009 4:37 pm

Hi

Post by ZarayK »

Great! use the same requirements for NPC 2.0.2?
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Re: Cannot get host icons

Post by divagater »

terjet wrote:Hi,,

Just upgraded from NPC 2.0.0 to 2.0.3..Everything works fine, but with the new release I should be able to see my Nagios icons... However no icons are displayed in NPC,, only the usual red,green, yellow dots.

I have also checked the NPC settings and made sure that they are ticked.

Any suggenstions?

/tt
You probably need to include the full URL to the icons in your service and host definitions. If you are using a relative path that worked with Nagios that same path is unlikely to work with Cacti. And by full URL I mean http://<your_comany>/path/to/icon

Cheers,
Billy
[url=http://forums.cacti.net/viewtopic.php?t=26540][b]NPC 2.0.4[/b][/url]
[url=http://trac2.assembla.com/npc][size=75]Trac[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=defect][size=75]Bugs[/size][/url] | [url=http://trac2.assembla.com/npc/newticket?type=enhancement][size=75]Requests[/size][/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests