Version 10 (modified by divagater, 5 years ago)

--

NPC Quick Start Guide

Purpose

The purpose of this guide is to outline the minimum steps necessary to get NPC installed and running.

Requirements

Below are the minimum requirements:

NPC has been tested with the above application versions. PHP 5.2 is required do to the use of PDO and JSON. PHP 5.1 with PDO and JSON modules installed "may" work but will not be supported.

Installing NPC

You must have Cacti installed with the plugin architecture before installing NPC. Grab the latest NPC from the downloads section and untar it to

Configuring Nagios

Refer to the Nagios documentation for installation. Some parts of NPC like reporting and the status map use the Nagios interface by wrapping the Nagios CGI's in an Iframe. Be sure to have the Nagios web UI working if you want to use the reporting and status map features.

The following parameters are found in the Nagios configuration file nagios.cfg

The power of NPC is greatly enhanced by the ability to issue commands to the Nagios process. To enable external commands in Nagios set:

check_external_commands=1

Check external commands as often as possible.

command_check_interval=-1

Broker all events.

event_broker_options=-1

The path to the event broker module and config file which you will install next.

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg

If you want to use performance data from Nagios plugins to create graphs in cacti then set the following parameter. Setting host_perfdata_command and service_perfdata_command is not necessary. The performance data will be written to the NPC database where it can be polled by cacti using the perfdata.php script included with NPC.

process_performance_data=1

Installing/Configuring? NDO2DB

NOD2DB is part of the NDOUTILS package. Nagios hands events off to NDO2DB via the event broker. NDO2DB handles the actual inserts of Nagios data into the NPC tables.

Instructions for compiling, installing, and configuring NDO2DB are included in the README file of the ndoutils package. The README has four sections. Skip the section on setting up the database.

  • Follow the 'COMPILING INSTRUCTIONS' section of the README.
  • Skip the 'INITIALIZING THE SQL DATABASE' section of the README
  • Follow the 'INSTALLING THE NDOMOD BROKER MODULE' section of the README
  • Follow the 'INSTALLING THE NDO2DB DAEMON' section of the README

Edit /usr/local/nagios/etc/ndo2db.cfg and add/update the following parameters:

db_servertype=mysql
db_host=localhost (the host/ip where cacti database is running)
db_port=3306
db_name=cacti (or whatever your cacti database is called)
db_prefix=npc_
db_user=<user>
db_pass=<pass>

The user/pass you assign needs select, insert, update, delete on all the npc_ tables