Skip to content

list all hosts + services + command with interpreted check

Notifications You must be signed in to change notification settings

sgaudart/icinga2_list_checks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

icinga2_list_checks

Presentation

The script displays ALL the checks inside icinga2.
The script shows in STDOUT :

  • hostname
  • servicename
  • interpreted commands with plugin and args

Requirement

  • icinga2
  • [inside icinga2] : enable the api feature (command : icinga2 feature enable api)
  • api rest available locally or remotely
  • perl
  • python (for filter json)

Tested with

  • Perl v5.24.1

Utilization

./icinga2_list_checks.pl [--host <hostname> --login <login>] --password <pass>
                        [--verbose]

default hostname : localhost

default login : root

You can find the password here : /etc/icinga2/conf.d/api-users.conf

Examples

Example1 :

./icinga2_list_checks.pl --password *************
host01;check_http_80_apache;/usr/lib/nagios/plugins/check_http --IP-address=host01 --port=80
host01;check_aspera_node;/usr/lib/nagios/plugins/check_aspera_node.sh -C snmpcommunity -H host01 -P 9092 -p
host01;check_http_s443_apache;/usr/lib/nagios/plugins/check_http --IP-address=host01 --port=443 --ssl
host1;check_nt_MessageQueuingCounters_Mailbox;/usr/lib/nagios/plugins/check_nt --hostname=host01 -l \\MSExchangeIS Mailbox(_Total)\\Messages Queued for Submission,msexch_tot_msgqueued,c --variable=COUNTER
host02;check_nt_cpu_load;/usr/lib/nagios/plugins/check_nt --hostname=host02 -l 1,80,90,5,80,90,15,80,90 --variable=CPULOAD
host02;check_nt_disk_usage_C;/usr/lib/nagios/plugins/check_nt --hostname=host02 -l C --variable=USEDDISKSPACE
host02;check_nt_disk_usage_E;/usr/lib/nagios/plugins/check_nt --hostname=host02-l E --variable=USEDDISKSPACE
host02;check_nt_disk_usage_H;/usr/lib/nagios/plugins/check_nt --hostname=host02 -l H --variable=USEDDISKSPACE

Example2 (with filter) :

./icinga2_list_checks.pl --password ************* | grep host2
host02;check_nt_cpu_load;/usr/lib/nagios/plugins/check_nt --hostname=host02 -l 1,80,90,5,80,90,15,80,90 --variable=CPULOAD
host02;check_nt_disk_usage_C;/usr/lib/nagios/plugins/check_nt --hostname=host02 -l C --variable=USEDDISKSPACE
host02;check_nt_disk_usage_E;/usr/lib/nagios/plugins/check_nt --hostname=host02-l E --variable=USEDDISKSPACE
host02;check_nt_disk_usage_H;/usr/lib/nagios/plugins/check_nt --hostname=host02 -l H --variable=USEDDISKSPACE

Example3 (sorted !!) :

./icinga2_list_checks.pl --password ************* | sort

Todo

About

list all hosts + services + command with interpreted check

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages