Tools and Commands

auto_reschedule_nagios_check

The script auto_reschedule_nagios_check is used on slave servers in distributed environments. It catches occasional border cases where service checks fall out of the scheduling loop and reschedules the check using the nagios command pipe.

To configure this script ensure that the configuration file, /etc/nagrestconf/nagctl.conf, has the COMMANDFILE and STATUSFILE variables correctly set.

This script takes no options and is typically run by the CRON daemon every 10 minutes. A typical crontab entry is shown in the CRON section of the Administration page.

dcc_configure

This script serves the same purpose as slc_configure but for a collector node.

nagrestconf_install

NAGRESTCONF_INSTALL(8)  System Administration Utilities NAGRESTCONF_INSTALL(8)



NAME
       nagrestconf_install - Initial operating system setup for nagrestconf.

SYNOPSIS
       nagrestconf_install [-h] [-v] [-a] [-n] [-o] [-p] [-q] [-r]

DESCRIPTION
       nagrestconf_install - Modify the environment so nagrestconf will work.

       -h     :  Display this help text.

       -v     :  Display the program version string.

       -a     :  Try to do everything required.

       -n     :  Modify nagios.cfg only.

       -o     :  Modify system users only.

       -p     :  Modify crontab only.

       -q     :  Modify sudoers only.

       -r     :  Restart services only.



nagrestconf_install 0.10         January 2013           NAGRESTCONF_INSTALL(8)

restart_nagios

RESTART_NAGIOS(8)       System Administration Utilities      RESTART_NAGIOS(8)



NAME
       restart_nagios - Nagios restarter and subversion updater.

SYNOPSIS
       restart_nagios


DESCRIPTION
       Restarts  the  nagios  daemon,  checks in the changes to subversion and
       mirrors the subversion repo.

       This script will usually be run from cron, but it can be run directly.

       This   program   uses   the   configuration   files   nagctl.conf   and
       restart_nagios.conf in /etc/nagrestconf/.



restart_nagios 1.0               January 2013                RESTART_NAGIOS(8)

nagctl

This tool is intended for system use and is not intended to be used directly.

NAGCTL(8)               System Administration Utilities              NAGCTL(8)



NAME
       nagctl - Manipulate csv (.setup) files.

SYNOPSIS
       nagctl [-h]    

DESCRIPTION
       -h     :  Display this help text.

       ACTION :  One of four ACTIONS are understood:

       show   -  Query a csv FILE.

       add    -  Add a line to a csv FILE

       delete -  Delete a csv entry from a FILE.

       modify -  Modify an existing csv entry.

       check  -  check an ITEM.

       pipecmd
              -  Send text to the Nagios cmd pipe.

       propagate
              -  Propagate changes to master.

       restart
              -  Restart an ITEM.

       SERVICE
              :  The directory holding the configuration.

       ITEM   :  For things that are not add, delete, show or modify.

       FILE   :  The file to ACTION. E.g. hosts, services.

       CSV_LINE :
              A line of CSV in the same format as the target FILE.

       QUERY  :  A query to 'show'.



nagctl 1.0                       January 2013                        NAGCTL(8)

upgrade_setup_files.sh

This tool is only used when upgrading nagrestconf, but only when indicated to do so.

This tool shouldn't be used unless told to do so. It creates extra columns in the csv files when new REST functionality has been added.

update_nagios

This tool is run by cron on a collector node in distributed environments. It updates environment folders in /etc/nagios/objects that have been copied over by slave nodes using svnsync.

A typical crontab entry is shown in the CRON section of the Administration page.

csv2nag

CSV2NAG(8)              System Administration Utilities             CSV2NAG(8)



NAME
       csv2nag  -  Create  nagios (.cfg) configuration files from csv (.setup)
       files.

SYNOPSIS
       csv2nag [-yhs] TYPE

DESCRIPTION
       -y     :  Answer 'yes' to any questions.

       -h     :  Display this help text.

       -s NAME
              :  Use NAME for service-line name instead of using the

              parent directory as the service-line name.

       TYPE   :  One of six TYPES are understood:

       hosts  -  Create hosts files.

              One host file is created per  host  in  the  nagrestconf-1-nodes
              directory.   The  nagrestconf-1-hostgroups.cfg file is also cre‐
              ated in the top level directory.

       services
              -  Add services to hosts files in

              the nagrestconf-1-nodes directory.  This  script  should  previ‐
              ously  have  been  run  with  the  'hosts'  TYPE.   The nagrest‐
              conf-1-servicegroups.cfg file will also be created.

       hosttemplates
              -  Create a hosttemplates file.

       svctemplates
              -  Create a servicetemplates file.

       contacts
              -  Create a contacts file.

       commands
              -  Create a commands file.

       timeperiods
              -  Create a timeperiods file.

       servicedeps
              -  Create a servicedeps file.

       hostdeps
              -  Create a hostdeps file.

       serviceesc
              -  Create a serviceesc file.

       hostesc
              -  Create a hostesc file.

       serviceext
              -  Create a serviceext file.

       hostext
              -  Create a hostext file.

       all    -  Create all TYPEs in one go.

       csv2nag should be run from the directory containing the 'setup'  direc‐
       tory and the following files must exist:

              setup/<FOLDER_NAME>-hosts.setup
              setup/<FOLDER_NAME>-hostgroups.setup
              setup/<FOLDER_NAME>-hosttemplates.setup
              setup/<FOLDER_NAME>-services.setup
              setup/<FOLDER_NAME>-servicegroups.setup
              setup/<FOLDER_NAME>-servicetemplates.setup
              setup/<FOLDER_NAME>-contacts.setup
              setup/<FOLDER_NAME>-contact‐groups.setup
              setup/<FOLDER_NAME>-commands.setup

EXAMPLES
              Create the entire config from scratch, wiping  out  the  current
              one:

              csv2nag all



csv2nag 1.0                      January 2013                       CSV2NAG(8)

slc_configure

SLC_CONFIGURE(8)        System Administration Utilities       SLC_CONFIGURE(8)



NAME
       slc_configure  -  Initial setup of nagios object directories for use by
       nagrestconf programs.

DESCRIPTION
       Configure a Data Centre Collector:

              slc_configure [-h] [--folder=]

       -h            - this help text.

       --folder      - the service line folder name to add.

       --dccip       - IP address of the DCC.

       Any omitted options will be prompted for.



slc_configure 1.0                January 2013                 SLC_CONFIGURE(8)