Version 5 (modified by divagater, 5 years ago)

--

General

General questions about NPC.

Q: What is Nagios Plugin for Cacti (NPC)?

NPC is a complete web based user interface replacement for  Nagios written as a plugin to  Cacti.

Q: Who develops NPC?

NPC is written and maintained by Billy Gunn (Divagater on most forums).

Q: Who can use Wifidog?

NPC is free software released under the GPL license and can be used by any person or company.

Q: What can it do?

It can do anything the current Nagios UI can do but with a much improved interface. Additionally, it has some additional features to integrate with Cacti like creating data input methods from Nagios performance data. For a complete list of features see the features page?.

Q: How does it work?

The Nagios folks provide a utility called ndo2db. ndo2db is made up of 2 pieces, a module that is loaded by Nagios and a daemon that is started and stopped independently. The module passes events from Nagios to the NDO2DB deamon which handles updating the NPC database tables. The NPC web interface (written using the  Ext javascript framework) uses regular ajax calls to the server to update the data displayed to the user. All the updates are done asynchronously so the NPC web page never needs to be "reloaded" like traditional web apps. This gives NPC the feel of a more traditional desktop application.

Q: What does it run on?

The server side components require a  LAMP environment.

The client side is known to work in Firefox 2.x and IE7.

Do Nagios and Cacti/NPC need to be installed on the same server?

No. The main consideration is that if you want to issue commands to the Nagios process from NPC, then NPC needs to be able to write commands to the Nagios command file.

Q: What does it look like?

There are various screenshots available here.

Q: Where can I find help?

For the current alpha release of NPC (npc-2.0.0a.127) please post requests for help on this  Cacti forum thread.

Q: Why has the NPC javascript been obfuscated?

This was simply done for performance reasons. Client side applications written in javascript can be quite large. To improve load times the NPC javascript is compressed using the  YUI Compressor.

Q: How can I alter the NPC javascript code for my own needs?

The full uncompressed javascript source code is provided. You can find it under the js/src/ directory. To configure NPC to load the uncompressed source code edit npc.php in the root of the npc plugin directory and make the following change:

Change this line:

$module = 'layout';

To this:

$module = 'layoutDev';

If you want to compress the javascript with your changes, a phing build script (build.xml) is provided in the js/src/ directory which will handle concatenating all the source in the correct order and then calling the yui compressor. This requires  phing and the  YUI compressor. Edit the build.xml file with the correct path to the yuicompressor-x.x.x.jar file.

NDO2DB

Q: Why aren't my NPC tables populating with data?

There could be many reasons for this related to your Nagios and ndo2db setup. One common reason however is that you have enabled debugging in ndo2db.cfg and then launched ndo2db as root. The logfile will be created as root prior to ndo2db switching to a secure user like nagios as specified in the ndo2db.cfg. ndo2db is now running with less privileges and connot write to the debug log file which causes the whole thing to stop working.

To correct this look in ndo2db.cfg and see where you are writing the debug logfile. Verify that file is owned by the user that ndo2db is running as. If needed, change the owner of the file to the correct user. The default user is nagios.

Q: Error: mysql_query() failed for …

Some users may see an error similar to the following in their nagios log or syslog:

Error: mysql_query() failed for 'INSERT INTO npc_configfilevariables SET instance_id='1', configfile_id='7', varname='cfg_dir', varvalue='/usr/local/nagios/etc/servers/fw1\.cfg''

This is a bug with ndo2db. Fortunately NPC is not currently using the data stored in the npc_configfilevariables table and this error can be safely ignored.