Usage refactoring - np422/Op5util GitHub Wiki

Usage refactor

Items in parenthesis will not be implemented with first release.

Underscore sub-commands to add/remove/update is used to define relationships between other config entities and should be aliased so they can be used either way, add host_hostgroup and hostgroup_host performs the same task, but with the arguments in flipped order, as in the example below, all commands should do the same task, and you can user whatever feels naturally for you.

op5util add host_hostgroup web01-prd.domain.com webservers
op5util add hostgroup_host webservers web01-prd.comain.com
op5util update host -g webservers web01-prd.comain.com
op5util update hostgruop -m web01.prd.comian.com webservers

Syntax diagram



                                                                          +---   -i/--ipaddr A -------+
                                                                          +---    --icon I -----------+
                                                                          +--- * -g/--hostgroup G ----+
                                                                          +--- * -c/--contactgroup C -+
                                                                          +---   -a/--alias A---------+
              +-- update --+    +---  -n/--no-commit ---+                 ↓                           ↑
op5util -+----+-- add -----+----+-----------------------+---+--- host ----+---------------------------+--- hostn_ame
         |    +-- remove --+                                |
         |                                                  +--- hostgroup --- hostgroup_name
         |                                                  |
         |                                                  +--- hostgroup_host -- hostgroup_name -- host_name
         |                                                  |
         |                                                  +--- (contactgroup)
         |                                                  +--- (contactgroup_member)
         |                                                  +--- (contactgroup_host)
         |                                                  +--- (checkcommand)
         |                                                  +--- (service)
         |
         +--- list  -------+----------------------------+---+--- hosts
         |                 +---  -l/--long/--details ---+   +--- host_services
         |                                                  +--- hostgroups
         |                                                  +--- hostgroup_members --------------- hostgroup_name
         |                                                  +--- hostgroup_servicechecks---------- hostgroup_name
         |                                                  +--- contactgroups
         |                                                  +--- contactgroup_hosts - *  -h H----- contactgroup_name
         |                                                  +--- ...
         |
         +--- show/info ---+----------------------------+---+--- host ----------- host_name
         |                 +---  -l/--long/--details ---+   +--- hostgroup ------ hostgroup_name
         |                                                  +--- (commmands) ---- command_name
         |                                                  +--- host_service --- TBD
         |                                                  +--- TBD
         +----- commit ------------ config/<empty>
         |
         +--- schedule ---+------ checks ----------------------- host
         |                |
         |                |               +- -w/--wait N  ---+
         |                |               +- -c/--comment C -+
         |                |               +- -t/--time T ----+
         |                |               ↓                  ↑
         |                +-- downtime ---+------------------+-- host
         |
         +----- status ---+----------------------------+---+--- all/<empty>
         |                +---  -l/--long/--details ---+   +--- hostname
         |
         |
         +---- acknowledge -------- hostname
         |
         +---- (perfdata) --------- TBD
         |
         +---- autocomplete ---+--- bash/<empty>
         |                     +--- zsh
         |                     +--- tcsh
         |
         +--- help ------------+--- usage/<empty>
                               +--- command
                               +--- authentication

Any word that's appear together with may be omitted in the command and that action will be performed as the default.

Global options.

-n --no-commit
-f --output-format <json|text|(csv)|(pdf)|(png)> , default = text
-m --monitor
-p --password
-u --username
-v --verbose

The --no-commit flag and the possibility to choose output format are the new global options.

⚠️ **GitHub.com Fallback** ⚠️