naglint(3)

NAME
naglint - beautify nagios config files

SYNOPSIS
  Usage: naglint [options] <file> [<files...>]

  Options:
  -h, --help                    Show this help message and exit
  -v, --verbose                 Print verbose output
  -V, --version                 Print version
  -c, --config                  config file. Default is ~/.naglintrc
  -i                            replace content inline instead of printing to stdout
  -r                            read directories recursivly
      --core                    core type can be nagios, icinga or shinken. Will be
                                autodetected unless specified.

DESCRIPTION
This script beautifies nagios config files.

  - clean whitespace
  - clean indention
  - remove deprecated attributes
  - validate duplicate or invalid attributes
  - break long command lines into shorter pieces
  - sort attributes naturally

OPTIONS
naglint has the following arguments:

-h , --help
        print help and exit

-v , --verbose
        print verbose output too

-c , --config
        use different config file. Default locations are ~/.naglintrc and /etc/thruk/naglint.conf

-V , --version
        print version and exit

--core
        use specific config type. can be 'nagios', 'icinga' or 'shinken'.
        enables core type specific attributes. Will be autodetected unless
        specified.

-i
        edit given files inline and overwrite them with their beautified objects

-r
        read directories recursivly

RETURN VALUE
returns 0 on success or number of errors otherwise

CONFIG
see FILES section for where to store config options.

indent_object_key
        Number of spaces before object attribute names. Default 2

indent_object_value
        Number of spaces before objects attribute values. Default 30

indent_object_comments
        Number of spaces before inline comments. Default 68

list_join_string
        Should list attributes be joined with space or not. Default ','

break_long_arguments
        Should long arguments be broken into multiple lines. Default 1

object_attribute_key_order
        list of attributes which should be on top of the object

object_cust_var_order
        list of custom variables which will be put on top of other custom variables

EXAMPLES
Beautify single config file

  %> naglint objects.cfg > beauty.cfg

Beautify and replace single config file inline

  %> naglint -i objects.cfg

Process objects from STDIN

  %> cat objects.cfg | naglint > beauty.cfg

FILES
~/.naglintrc

  user config file

/etc/thruk/naglint.conf

  global config file

AUTHOR
2012, Sven Nierlein, <sven@nierlein.de>