Nagios Plugin for Cacti (NPC) 2.0.4

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
andrewh
Posts: 6
Joined: Wed Oct 17, 2007 10:07 am
Location: London

Post by andrewh »

divagater wrote:Hey Andrew. I sent you a PM on the second with my email address on the 2nd. As there will be a bit of back and forth to figure this out I wanted to take it to email. My email address is in the PM. Check it out and lets get you up and running.

Cheers,
Billy
Sorry, didn't notice it. Will email you as soon as I can, thanks a lot.

I'll post back here with the results.

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

NPC 2.0.2 has been released

Post by divagater »

NPC 2.0.2 has been released.

Check out the first message in this thread for the download link. Here is a list of the updates:

* Host and status summary portlets have been moved above the dashboard and navigation panels (see updated screenshot).

* Added a Nagios Status portlet which displays whether or not Nagios is running and if global checks and notifications are enabled.

* Made the portlet refresh rate a global property under NPC settings.

* Fixed bug where NPC was preventing other pages from auto refreshing by including and overriding top_graph_header.

* Added a realm (permission) for executing global commands like disabling all notifications or checks. This must be enabled for all users that need to be able to globally disable notifications and checks.

* Fixed bug that was causing double checkboxes on various forms.

* Added a cog icon to represent when host/services are in scheduled downtime.

* Added support to represent the icons defined in the Nagios host/service definitions (see dashboard screenshot). This feature must be enabled in NPC settings.

* Added support for hostgroup commands. These are accessed via right click on a hostgroup name from the hostgroup dashboard portlets.

* Updated most portlets and the comments grids to use live scrolling rather than paging.

* Fixed bug with searching comments.

* Added an Additional Information tab to service and host detail. This tab activates automatically if the notes_url parameter is defined in the Nagios host/service definition. See notes_url screenshot.

* Upates to support additional list methods using perfdata.php. This script is slowly become a Nagios/NPC general purpose CLI script.
[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

Post by erickbe »

Thanks for the updates! I tried to update my NPC to this one but the NPC page is blank when I go to it on 2.0.2.

If I go back to the old 2.0.0 npc plugin it is all good.

In IE8, I get some warning about 'npc' being undefined and in Firefox it is just blank with no errors/warnings.

I did also try to uninstall the npc plugin from PA and verified all the npc_ tables dropped from the database then re-installed it via PA and same old thing. The tables are populating with data from ndo2db fine and if I go back to old plugin all is well.

Cacti 0.87d, PA 2.4

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

Post by divagater »

erickbe wrote:Thanks for the updates! I tried to update my NPC to this one but the NPC page is blank when I go to it on 2.0.2.
Sorry about that! The build process failed to minify the javascript but didn't throw any exceptions so the js include files were missing.

I rebuilt NPC and replaced the download files. Just remove your NPC directory and replace with the new version.

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

Post by erickbe »

Thanks, that update fixed the issue.

The status of nagios at top seems to be cut off, see attached screenshot. It looks this way in both IE and firefox.

Also, is there a way to just display the info in the Notes field without having a notes_url defined?

Thanks for the great plugin and updates.
Attachments
npc.jpg
npc.jpg (81.23 KiB) Viewed 5175 times
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

erickbe wrote:Thanks, that update fixed the issue.

The status of nagios at top seems to be cut off, see attached screenshot. It looks this way in both IE and firefox.

Also, is there a way to just display the info in the Notes field without having a notes_url defined?

Thanks for the great plugin and updates.
Looks like I am trying to squeeze a little too much info in for whatever resolution you are running at. The 'Service Checks' column wrapped in the nagios status pushing the panel down. In that screenshot is your browser maximized? Also what resolution are you running?

You do not need notes_url defined to see notes that have been directly added with the 'notes' option. You can see notes displayed in the services (or service problems) grid and in the detailed information. See screenshots.

if you can not see the notes column in your services grids then just hover your mouse over any of the column headings and you will see a drop down arrow appear to the right. Click that arrow then choose columns and you can check which columns you want hidden or visible. As an fyi columns can be dragged around to re-order. Any changes you make are saved for the user you logged in as.
Attachments
Add/remove columns
Add/remove columns
column_selection.PNG (45.4 KiB) Viewed 5162 times
service_detail.PNG
service_detail.PNG (15.87 KiB) Viewed 5167 times
[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

Post by erickbe »

Ok,

The nagios status shows up fine on my bigger LCD monitor, was my 15" laptop screen where it was doing that. Maybe if you move that to the right on top or have option to have it at all, or maybe put it at bottom of the navigation tree?

Is there a way to turn off notifications globally in NPC for everything since it has a thing for notifications being on/off? This is something I was working on a script for in nagios actually so I could disable notifications for a certain contact easily from GUI for when someone is doing work on a lot of equipment and that would be easier then going thru and disabling notifications or scheduling downtime for many sites site by site, etc.

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

Post by divagater »

erickbe wrote:The nagios status shows up fine on my bigger LCD monitor, was my 15" laptop screen where it was doing that. Maybe if you move that to the right on top or have option to have it at all, or maybe put it at bottom of the navigation tree?
The bottom of the navigation tree is not a bad idea. I will check it out.
Is there a way to turn off notifications globally in NPC for everything since it has a thing for notifications being on/off?
Yes, to do it you click the 'Process Information' link in the navigation tree. Each item with either a green check mark or a red X can be toggled with a double click. Everything on the Process Information screen is global meaning all services or hosts depending on the command.

In order to execute commands on that screen you have to enable the 'NPC Global Commands' realm for whichever user needs it.

As an FYI items with check marks and x's on the service or host detail screen can also be toggled with a double click and will just affect the service or host you are viewing.

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

Post by erickbe »

Ok, That works and is cool.

I noticed 2 other problems,

Under the Hosts view if notifications are disabled for a host it isn't showing the disabled speaker icon like in previous version. If I go into main nagios screen it shows disabled there.

I get an error window that pops up on some of the host/services views, Invalid argument on line 23463 with code 0. URL is http://172.16.0.170/cacti/plugins/npc/js/npc-all-min.js. This seems to happen in IE and not Firefox.

Also, is there a way to view Notes information on Hosts? I don't see a note field and tried to choose it from columns on host view but it isn't there. Just seems to be for services.
User avatar
divagater
Cacti User
Posts: 191
Joined: Wed Nov 17, 2004 5:22 pm
Location: Chapel Hill, NC.
Contact:

Post by divagater »

erickbe wrote:Under the Hosts view if notifications are disabled for a host it isn't showing the disabled speaker icon like in previous version. If I go into main nagios screen it shows disabled there.
This sounds like a bug but should be very easy to resolve.
I get an error window that pops up on some of the host/services views, Invalid argument on line 23463 with code 0. URL is http://172.16.0.170/cacti/plugins/npc/js/npc-all-min.js. This seems to happen in IE and not Firefox.
This is definitely a bug and one that I was aware of. Some where in the many thousands of lines of java script code I have a trailing comma probably in a few spots. IE is sadly lacking in an easy to use debugger like firebug so finding the exact location of the error is very difficult. I will find it eventually and get a patch out but honestly I have not looked at NPC in IE in quite a while.
Also, is there a way to view Notes information on Hosts? I don't see a note field and tried to choose it from columns on host view but it isn't there. Just seems to be for services.
Um there is supposed to be. I just checked the code for the hosts grid: http://trac2.assembla.com/npc/browser/t ... s/hosts.js and it looks like I forgot to add the Notes column to the column model :oops: All the rest of the business logic is there so this is a very trivial fix.

I will get a patch out in a few days to fix the hosts notification icon and notes column. I may even try to get IE working. As an FYI if you click the NPC tab a few times to reload it IE may break through the errors and load correctly.

Thanks for the comments and issues,
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]
schwermie
Posts: 3
Joined: Tue May 26, 2009 9:12 am
Location: Maastricht / The Netherlands

No info displayed in dashboard

Post by schwermie »

We just installed the NPC plugin. We see the tables beeing populated, but we can't get any info in presented in the dashboard.

Apache log doesn't show anything usefull. Any idea what other tests i can do?

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

Re: No info displayed in dashboard

Post by divagater »

schwermie wrote:We just installed the NPC plugin. We see the tables beeing populated, but we can't get any info in presented in the dashboard.

Apache log doesn't show anything usefull. Any idea what other tests i can do?

Thanks...
Hi, please verify that you have php-pdo and php-json modules installed for your distro. Missing one or the other of these libraries is the most common issue.

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]
schwermie
Posts: 3
Joined: Tue May 26, 2009 9:12 am
Location: Maastricht / The Netherlands

Re: No info displayed in dashboard

Post by schwermie »

Hi,

PhpInfo shows both enabled... So that shouldn't be the problem.

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

Re: No info displayed in dashboard

Post by divagater »

schwermie wrote:Hi,

PhpInfo shows both enabled... So that shouldn't be the problem.

Cheers.
I recall some one saying that special characters were not being properly escaped in the DSN string that gets built to allow npc to connect to your cacti database. I just looked at npc/config.php on line 11 and I can see that that is the case. Looks like special characters need to be escaped.

Find this lilne in npc/config.php

Code: Select all

 $dsn = "$database_type://$database_username:$database_password@$database_hostname:$database_port/$database_default";
Add these 2 lines above the dsn so the end result looks like:

Code: Select all

$database_username = urlencode($database_username);
$database_password = urlencode($database_password);

// Setup the DSN
$dsn = "$database_type://$database_username:$database_password@$database_hostname:$database_port/$database_default";
I am hoping it was a special character messing you up but if not this part still needs fixing.

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]
schwermie
Posts: 3
Joined: Tue May 26, 2009 9:12 am
Location: Maastricht / The Netherlands

Re: No info displayed in dashboard

Post by schwermie »

I added both lines and it looks fine. Thanks...

Code: Select all

// Setup the DSN
$database_hostname='localhost';
$database_port='3306';

$database_username=urlencode($database_username);
$database_password=urlencode($database_password);
$dsn = "$database_type://$database_username:$database_password@$database_hostname:$database_port/$database_default";
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests