Translations of this page:

This is an old revision of the document!


How to use this script

The aim of this script is to import your ndo database directly into PNP4nagios. To do so, we use an exporter ( that can connect throught MySQL database and export contents into the same format as perfdata expected from nagios. Then we plug this into pnp4nagios using bulk option.

  $ ./ --help
  Usage :
    -h  --help            Display this message.
        --version         Display version then exit.
    -v  --verbose         Verbose run.
    -u  --user <NDOUSER>  Log on to database with <NDOUSER> (default root).
    -p  --pass <PASSWD>   Use <PASSWD> to logon (default gbu2kfe).
    -t  --type <DBTYPE>   Change database type (default mysql).
        --host <DBHOST>   Use <DBHOST> (default localhost).
        --dbname <DB>     Use <DB> for ndo database name (default ndoutils).
        --list-machine    Display machine definition in ndo database.
        --list-service    Show services defined.
        --export-as-pnp   Export ndo content as a bulk file used by

The script use mysql binary directly to launch extraction. Please be sure to have mysql in your PATH.

Main step to import ndo database into pnp4nagios

Here's the main step you can follow :

  • first, check your database connectivity by listing your services :
  $ ./ --user <MYSQL_USER> -p <MYSQL_PASS> --list-service
  Hostname                       | Service
  gateway                        | PING
  localhost                      | Current Load
  localhost                      | Current Users
  localhost                      | Disk Space
  localhost                      | HTTP
  localhost                      | SSH
  localhost                      | Total Processes
  • then, export database contents into perfdata file :
  $ ./ --user <MYSQL_USER> -p <MYSQL_PASS> --export-as-pnp > /tmp/perfdata.bulk

Beware children ! This extraction can take a huge slice of time !

Here's a small extraction of this export :

  $ more /tmp/perfdata.bulk 
  • Now, use (as nagios user) in order to import your extraction :
  nagios@nagioshost:~$ /usr/share/pnp4nagios/libexec/ -b /tmp/perfdata.bulk --timeout 0

NB1: don't forget the --timeout 0. If you forget this option, you'll get timeout while importing big shunk of services.

NB2: use the LOG_LEVEL option into process_perfdata.cfg config file to get a feedback in the perfdata.log file.

pnp-0.6/ndo2pnp.1285515453.txt.gz · Last modified: 2010/09/26 17:37 by yannig Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0