From 53e5fe50f4e8989c5a25fc5ac8e55d904340c951 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 29 Jan 2019 23:03:05 +0100 Subject: [PATCH] [DEV] basic docker interface for nagios --- README.md | 71 ++++++++++++- data_nagios/cache/.keep | 0 data_nagios/config/htpasswd.users | 1 + data_nagios/log/archives/.keep | 0 data_nagios/plugins/config/apt.cfg | 12 +++ data_nagios/plugins/config/breeze.cfg | 5 + data_nagios/plugins/config/dhcp.cfg | 15 +++ data_nagios/plugins/config/disk-smb.cfg | 54 ++++++++++ data_nagios/plugins/config/disk.cfg | 27 +++++ data_nagios/plugins/config/dns.cfg | 11 ++ data_nagios/plugins/config/dummy.cfg | 29 ++++++ data_nagios/plugins/config/flexlm.cfg | 6 ++ data_nagios/plugins/config/fping.cfg | 5 + data_nagios/plugins/config/ftp.cfg | 15 +++ data_nagios/plugins/config/games.cfg | 14 +++ data_nagios/plugins/config/hppjd.cfg | 6 ++ data_nagios/plugins/config/http.cfg | 111 ++++++++++++++++++++ data_nagios/plugins/config/ifstatus.cfg | 23 +++++ data_nagios/plugins/config/ldap.cfg | 31 ++++++ data_nagios/plugins/config/load.cfg | 6 ++ data_nagios/plugins/config/mail.cfg | 77 ++++++++++++++ data_nagios/plugins/config/mailq.cfg | 24 +++++ data_nagios/plugins/config/mrtg.cfg | 14 +++ data_nagios/plugins/config/mysql.cfg | 24 +++++ data_nagios/plugins/config/netware.cfg | 84 +++++++++++++++ data_nagios/plugins/config/news.cfg | 15 +++ data_nagios/plugins/config/nt.cfg | 15 +++ data_nagios/plugins/config/ntp.cfg | 17 +++ data_nagios/plugins/config/pgsql.cfg | 15 +++ data_nagios/plugins/config/ping.cfg | 72 +++++++++++++ data_nagios/plugins/config/procs.cfg | 20 ++++ data_nagios/plugins/config/real.cfg | 13 +++ data_nagios/plugins/config/rpc-nfs.cfg | 14 +++ data_nagios/plugins/config/snmp.cfg | 132 ++++++++++++++++++++++++ data_nagios/plugins/config/ssh.cfg | 27 +++++ data_nagios/plugins/config/tcp_udp.cfg | 27 +++++ data_nagios/plugins/config/telnet.cfg | 15 +++ data_nagios/plugins/config/users.cfg | 6 ++ docker-compose.yml | 22 ++++ 39 files changed, 1073 insertions(+), 2 deletions(-) create mode 100644 data_nagios/cache/.keep create mode 100755 data_nagios/config/htpasswd.users create mode 100644 data_nagios/log/archives/.keep create mode 100755 data_nagios/plugins/config/apt.cfg create mode 100755 data_nagios/plugins/config/breeze.cfg create mode 100755 data_nagios/plugins/config/dhcp.cfg create mode 100755 data_nagios/plugins/config/disk-smb.cfg create mode 100755 data_nagios/plugins/config/disk.cfg create mode 100755 data_nagios/plugins/config/dns.cfg create mode 100755 data_nagios/plugins/config/dummy.cfg create mode 100755 data_nagios/plugins/config/flexlm.cfg create mode 100755 data_nagios/plugins/config/fping.cfg create mode 100755 data_nagios/plugins/config/ftp.cfg create mode 100755 data_nagios/plugins/config/games.cfg create mode 100755 data_nagios/plugins/config/hppjd.cfg create mode 100755 data_nagios/plugins/config/http.cfg create mode 100755 data_nagios/plugins/config/ifstatus.cfg create mode 100755 data_nagios/plugins/config/ldap.cfg create mode 100755 data_nagios/plugins/config/load.cfg create mode 100755 data_nagios/plugins/config/mail.cfg create mode 100755 data_nagios/plugins/config/mailq.cfg create mode 100755 data_nagios/plugins/config/mrtg.cfg create mode 100755 data_nagios/plugins/config/mysql.cfg create mode 100755 data_nagios/plugins/config/netware.cfg create mode 100755 data_nagios/plugins/config/news.cfg create mode 100755 data_nagios/plugins/config/nt.cfg create mode 100755 data_nagios/plugins/config/ntp.cfg create mode 100755 data_nagios/plugins/config/pgsql.cfg create mode 100755 data_nagios/plugins/config/ping.cfg create mode 100755 data_nagios/plugins/config/procs.cfg create mode 100755 data_nagios/plugins/config/real.cfg create mode 100755 data_nagios/plugins/config/rpc-nfs.cfg create mode 100755 data_nagios/plugins/config/snmp.cfg create mode 100755 data_nagios/plugins/config/ssh.cfg create mode 100755 data_nagios/plugins/config/tcp_udp.cfg create mode 100755 data_nagios/plugins/config/telnet.cfg create mode 100755 data_nagios/plugins/config/users.cfg create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index ee582d5..c160416 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,69 @@ -# nagios-docker -(MPL-2) Nagios docker configuration +nagios-docker +=========== + +Repository for wrapping `Nagios service` to be used together with `docker-compose`. + +The default open port is 8080 and the basic user is ```nagiosadmin``` pass=```nagios``` + +License +======= + +MPL-2 + +Clone the repository: +===================== + +``` +git clone https://github.com/HeeroYui/nagios-docker.git +cd nagios-docker +``` + +Compose and start your environement: +==================================== + +``` +docker-compose up +``` + +If you prever do it in a deamon: + +``` +docker-compose -d up +``` + +Remove the current docker when started: + +``` +docker-compose rm mqtt +``` + + +Create your password file, see documentation: ```https://mosquitto.org/man/mosquitto_passwd-1.html``` or update the file : ```config/passwd_readable``` + +and execute: +``` +cd config +cp passwd_readable passwd +mosquitto_passwd -U passwd +cd .. +``` + +Common tools for docker: +======================== + + +List all the active docker on the system +``` +docker ps -a +``` + +remove a docker +``` +docker rm NAME_OF_THE_CONTAINER +``` + +Start a docker compose with a clean interface +``` +docker-compose up --force-recreate +``` + diff --git a/data_nagios/cache/.keep b/data_nagios/cache/.keep new file mode 100644 index 0000000..e69de29 diff --git a/data_nagios/config/htpasswd.users b/data_nagios/config/htpasswd.users new file mode 100755 index 0000000..22f3861 --- /dev/null +++ b/data_nagios/config/htpasswd.users @@ -0,0 +1 @@ +nagiosadmin:{SHA}/i0Kels0lRtuw8RhhPHtPq4ZRZ0= diff --git a/data_nagios/log/archives/.keep b/data_nagios/log/archives/.keep new file mode 100644 index 0000000..e69de29 diff --git a/data_nagios/plugins/config/apt.cfg b/data_nagios/plugins/config/apt.cfg new file mode 100755 index 0000000..06c6d5e --- /dev/null +++ b/data_nagios/plugins/config/apt.cfg @@ -0,0 +1,12 @@ +# 'check_apt' command definition +define command{ + command_name check_apt + command_line /opt/nagios/libexec/check_apt + } + +# 'check_apt_distupgrade' command definition +define command{ + command_name check_apt_distupgrade + command_line /opt/nagios/libexec/check_apt -d + } + diff --git a/data_nagios/plugins/config/breeze.cfg b/data_nagios/plugins/config/breeze.cfg new file mode 100755 index 0000000..9ccfd71 --- /dev/null +++ b/data_nagios/plugins/config/breeze.cfg @@ -0,0 +1,5 @@ +# 'check_breeze' command definition +define command { + command_name check_breeze + command_line /opt/nagios/libexec/check_breeze -H '$HOSTADDRESS$' -w '$ARG1$' -c '$ARG2$' +} diff --git a/data_nagios/plugins/config/dhcp.cfg b/data_nagios/plugins/config/dhcp.cfg new file mode 100755 index 0000000..519b96b --- /dev/null +++ b/data_nagios/plugins/config/dhcp.cfg @@ -0,0 +1,15 @@ +# note: these plugins require root privilege. see README.Debian for +# more information on how it is recommended that you do this. + +# 'check_dhcp' command definition +define command{ + command_name check_dhcp + command_line /opt/nagios/libexec/check_dhcp -s '$HOSTADDRESS$' '$ARG1$' + } + +# 'check_dhcp_interface' command definition +define command{ + command_name check_dhcp_interface + command_line /opt/nagios/libexec/check_dhcp -s '$HOSTADDRESS$' -i '$ARG1$' '$ARG2$' + } + diff --git a/data_nagios/plugins/config/disk-smb.cfg b/data_nagios/plugins/config/disk-smb.cfg new file mode 100755 index 0000000..0edc360 --- /dev/null +++ b/data_nagios/plugins/config/disk-smb.cfg @@ -0,0 +1,54 @@ +# 'check_disk_smb' command definition +define command{ + command_name check_disk_smb + command_line /opt/nagios/libexec/check_disk_smb -H '$ARG1$' -s '$ARG2$' + } + + +# 'check_disk_smb_workgroup' command definition +define command{ + command_name check_disk_smb_workgroup + command_line /opt/nagios/libexec/check_disk_smb -H '$ARG1$' -s '$ARG2$' -W '$ARG3$' + } + + +# 'check_disk_smb_host' command definition +define command{ + command_name check_disk_smb_host + command_line /opt/nagios/libexec/check_disk_smb -a '$HOSTADDRESS$' -H '$ARG1$' -s '$ARG2$' + } + + +# 'check_disk_smb_workgroup_host' command definition +define command{ + command_name check_disk_smb_workgroup_host + command_line /opt/nagios/libexec/check_disk_smb -a '$HOSTADDRESS$' -H '$ARG1$' -s '$ARG2$' -W '$ARG3$' + } + + +# 'check_disk_smb_user' command definition +define command{ + command_name check_disk_smb_user + command_line /opt/nagios/libexec/check_disk_smb -H '$ARG1$' -s '$ARG2$' -u '$ARG3$' -p '$ARG4$' -w '$ARG5$' -c '$ARG6$' + } + + +# 'check_disk_smb_workgroup_user' command definition +define command{ + command_name check_disk_smb_workgroup_user + command_line /opt/nagios/libexec/check_disk_smb -H '$ARG1$' -s '$ARG2$' -W '$ARG3$' -u '$ARG4$' -p '$ARG5$' + } + + +# 'check_disk_smb_host_user' command definition +define command{ + command_name check_disk_smb_host_user + command_line /opt/nagios/libexec/check_disk_smb -a '$HOSTADDRESS$' -H '$ARG1$' -s '$ARG2$' -u '$ARG3$' -p '$ARG4$' + } + + +# 'check_disk_smb_workgroup_host_user' command definition +define command{ + command_name check_disk_smb_workgroup_host_user + command_line /opt/nagios/libexec/check_disk_smb -a '$HOSTADDRESS$' -H '$ARG1$' -s '$ARG2$' -W '$ARG3$' -u '$ARG4$' -p '$ARG5$' + } diff --git a/data_nagios/plugins/config/disk.cfg b/data_nagios/plugins/config/disk.cfg new file mode 100755 index 0000000..10abe8a --- /dev/null +++ b/data_nagios/plugins/config/disk.cfg @@ -0,0 +1,27 @@ +# 'check_disk' command definition +define command{ + command_name check_disk + command_line /opt/nagios/libexec/check_disk -w '$ARG1$' -c '$ARG2$' -e -p '$ARG3$' + } + +# 'check_all_disks' command definition +define command{ + command_name check_all_disks + command_line /opt/nagios/libexec/check_disk -w '$ARG1$' -c '$ARG2$' -e + } + +# 'ssh_disk' command definition +define command{ + command_name ssh_disk + command_line /opt/nagios/libexec/check_by_ssh -H '$HOSTADDRESS$' -C "/opt/nagios/libexec/check_disk -w '$ARG1$' -c '$ARG2$' -e -p '$ARG3$'" + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'ssh_disk_4' command definition +define command{ + command_name ssh_disk_4 + command_line /opt/nagios/libexec/check_by_ssh -H '$HOSTADDRESS$' -C "/opt/nagios/libexec/check_disk -w '$ARG1$' -c '$ARG2$' -e -p '$ARG3$'" -4 + } diff --git a/data_nagios/plugins/config/dns.cfg b/data_nagios/plugins/config/dns.cfg new file mode 100755 index 0000000..7969387 --- /dev/null +++ b/data_nagios/plugins/config/dns.cfg @@ -0,0 +1,11 @@ +# 'check_dns' command definition +define command{ + command_name check_dns + command_line /opt/nagios/libexec/check_dns -H www.google.com -s '$HOSTADDRESS$' '$ARG1$' +} + +# 'check_dig' command definition +define command{ + command_name check_dig + command_line /opt/nagios/libexec/check_dig -H '$HOSTADDRESS$' -l '$ARG1$' '$ARG2$' +} diff --git a/data_nagios/plugins/config/dummy.cfg b/data_nagios/plugins/config/dummy.cfg new file mode 100755 index 0000000..7167693 --- /dev/null +++ b/data_nagios/plugins/config/dummy.cfg @@ -0,0 +1,29 @@ +# return-ok definition +define command { + command_name return-ok + command_line /opt/nagios/libexec/check_dummy 0 +} + +# return-warning definition +define command { + command_name return-warning + command_line /opt/nagios/libexec/check_dummy 1 +} + +# return-critical definition +define command { + command_name return-critical + command_line /opt/nagios/libexec/check_dummy 2 +} + +# return-unknown definition +define command { + command_name return-unknown + command_line /opt/nagios/libexec/check_dummy 3 +} + +# return-numeric definition +define command { + command_name return-numeric + command_line /opt/nagios/libexec/check_dummy '$ARG1$' +} diff --git a/data_nagios/plugins/config/flexlm.cfg b/data_nagios/plugins/config/flexlm.cfg new file mode 100755 index 0000000..035f6ba --- /dev/null +++ b/data_nagios/plugins/config/flexlm.cfg @@ -0,0 +1,6 @@ +# 'check_flexlm' command definition +define command{ + command_name check_flexlm + command_line /opt/nagios/libexec/check_flexlm -F '$ARG1$' + } + diff --git a/data_nagios/plugins/config/fping.cfg b/data_nagios/plugins/config/fping.cfg new file mode 100755 index 0000000..d9d116d --- /dev/null +++ b/data_nagios/plugins/config/fping.cfg @@ -0,0 +1,5 @@ +# 'check-fast-alive' command definition +define command{ + command_name check-fast-alive + command_line /opt/nagios/libexec/check_fping -H '$HOSTADDRESS$' + } diff --git a/data_nagios/plugins/config/ftp.cfg b/data_nagios/plugins/config/ftp.cfg new file mode 100755 index 0000000..af9c0ce --- /dev/null +++ b/data_nagios/plugins/config/ftp.cfg @@ -0,0 +1,15 @@ +# 'check_ftp' command definition +define command{ + command_name check_ftp + command_line /opt/nagios/libexec/check_ftp -H '$HOSTADDRESS$' '$ARG1$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_ftp_4' command definition +define command{ + command_name check_ftp_4 + command_line /opt/nagios/libexec/check_ftp -H '$HOSTADDRESS$' -4 '$ARG1$' + } diff --git a/data_nagios/plugins/config/games.cfg b/data_nagios/plugins/config/games.cfg new file mode 100755 index 0000000..bd8d07f --- /dev/null +++ b/data_nagios/plugins/config/games.cfg @@ -0,0 +1,14 @@ +# 'check_quake' command definition +define command{ + command_name check_quake + command_line /opt/nagios/libexec/check_game qs '$HOSTADDRESS$' + } + + +# 'check_unreal' command definition +define command{ + command_name check_unreal + command_line /opt/nagios/libexec/check_game uns '$HOSTADDRESS$' -P '$ARG1$' -p 8 + } + + diff --git a/data_nagios/plugins/config/hppjd.cfg b/data_nagios/plugins/config/hppjd.cfg new file mode 100755 index 0000000..730b9d9 --- /dev/null +++ b/data_nagios/plugins/config/hppjd.cfg @@ -0,0 +1,6 @@ +# 'check_hpjd' command definition +define command{ + command_name check_hpjd + command_line /opt/nagios/libexec/check_hpjd -H '$HOSTADDRESS$' -C public + } + diff --git a/data_nagios/plugins/config/http.cfg b/data_nagios/plugins/config/http.cfg new file mode 100755 index 0000000..ee598d4 --- /dev/null +++ b/data_nagios/plugins/config/http.cfg @@ -0,0 +1,111 @@ +# 'check_http' command definition +define command{ + command_name check_http + command_line /opt/nagios/libexec/check_http -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' '$ARG1$' + } + +# 'check_http_hostname' command definition +define command{ + command_name check_httpname + command_line /opt/nagios/libexec/check_http -H '$HOSTNAME$' -I '$HOSTADDRESS$' '$ARG1$' + } + +# 'check_http2' command definition +define command{ + command_name check_http2 + command_line /opt/nagios/libexec/check_http -H '$ARG1$' -I '$HOSTADDRESS$' -w '$ARG2$' -c '$ARG3$' '$ARG4$' + } + +# 'check_squid' command definition +define command{ + command_name check_squid + command_line /opt/nagios/libexec/check_http -H '$HOSTADDRESS$' -p '$ARG1$' -u '$ARG2$' + } + +# 'check_https' command definition +define command{ + command_name check_https + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' '$ARG1$' + } + +# 'check_https_hostname' command definition +define command{ + command_name check_https_hostname + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTNAME$' -I '$HOSTADDRESS$' '$ARG1$' + } + +# 'check_https_auth' command definition +define command{ + command_name check_https_auth + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -a '$ARG1$' '$ARG2$' + } + +# 'check_https_auth_hostname' command definition +define command{ + command_name check_https_auth_hostname + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTNAME$' -I '$HOSTADDRESS$' -a '$ARG1$' '$ARG2$' + } + +# 'check_cups' command definition +define command{ + command_name check_cups + command_line /opt/nagios/libexec/check_http -I '$HOSTADDRESS$' -p 631 '$ARG1$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_http_4' command definition +define command{ + command_name check_http_4 + command_line /opt/nagios/libexec/check_http -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -4 '$ARG1$' + } + +# 'check_http_hostname_4' command definition +define command{ + command_name check_httpname_4 + command_line /opt/nagios/libexec/check_http -H '$HOSTNAME$' -I '$HOSTADDRESS$' -4 '$ARG1$' + } + +# 'check_http2_4' command definition +define command{ + command_name check_http2_4 + command_line /opt/nagios/libexec/check_http -H '$ARG1$' -I '$HOSTADDRESS$' -w '$ARG2$' -c '$ARG3$' -4 '$ARG4$' + } + +# 'check_squid_4' command definition +define command{ + command_name check_squid_4 + command_line /opt/nagios/libexec/check_http -H '$HOSTADDRESS$' -p '$ARG1$' -u '$ARG2$' -4 + } + +# 'check_https_4' command definition +define command{ + command_name check_https_4 + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -4 '$ARG1$' + } + +# 'check_https_hostname_4' command definition +define command{ + command_name check_https_hostname_4 + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTNAME$' -I '$HOSTADDRESS$' -4 '$ARG1$' + } + +# 'check_https_auth_4' command definition +define command{ + command_name check_https_auth_4 + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -a '$ARG1$' -4 '$ARG2$' + } + +# 'check_https_auth_hostname_4' command definition +define command{ + command_name check_https_auth_hostname_4 + command_line /opt/nagios/libexec/check_http --ssl -H '$HOSTNAME' -I '$HOSTADDRESS$' -a '$ARG1$' -4 '$ARG2$' + } + +# 'check_cups_4' command definition +define command{ + command_name check_cups_4 + command_line /opt/nagios/libexec/check_http -I '$HOSTADDRESS$' -p 631 -4 '$ARG1$' + } diff --git a/data_nagios/plugins/config/ifstatus.cfg b/data_nagios/plugins/config/ifstatus.cfg new file mode 100755 index 0000000..6bbeac1 --- /dev/null +++ b/data_nagios/plugins/config/ifstatus.cfg @@ -0,0 +1,23 @@ +# 'check_ifstatus' command definition +define command{ + command_name check_ifstatus + command_line /opt/nagios/libexec/check_ifstatus -H '$HOSTADDRESS$' -C '$ARG1$' + } + +# 'check_ifstatus_exclude' command definition +define command{ + command_name check_ifstatus_exclude + command_line /opt/nagios/libexec/check_ifstatus -H '$HOSTADDRESS$' -C '$ARG1$' -x '$ARG2$' + } + +# 'check_ifoperstatus_ifindex' command definition +define command{ + command_name check_ifoperstatus_ifindex + command_line /opt/nagios/libexec/check_ifoperstatus -H '$HOSTADDRESS$' -C '$ARG1$' -k '$ARG2$' + } + +# 'check_ifoperstatus_ifdescr' command definition +define command{ + command_name check_ifoperstatus_ifdescr + command_line /opt/nagios/libexec/check_ifoperstatus -H '$HOSTADDRESS$' -C '$ARG1$' -d '$ARG2$' + } diff --git a/data_nagios/plugins/config/ldap.cfg b/data_nagios/plugins/config/ldap.cfg new file mode 100755 index 0000000..b09b69b --- /dev/null +++ b/data_nagios/plugins/config/ldap.cfg @@ -0,0 +1,31 @@ +# 'check_ldap' command definition +define command{ + command_name check_ldap + command_line /opt/nagios/libexec/check_ldap -H '$HOSTADDRESS$' -b '$ARG1$' + } + +# 'check_ldaps' command definition +# This was using 'check_ldaps' in the past which used port 389 and starttls +# mechanism on default, keeped for backward compatibility +define command{ + command_name check_ldaps + command_line /opt/nagios/libexec/check_ldap -H '$HOSTADDRESS$' -T -b '$ARG1$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_ldap_4' command definition +define command{ + command_name check_ldap_4 + command_line /opt/nagios/libexec/check_ldap -H '$HOSTADDRESS$' -b '$ARG1$' -4 + } + +# 'check_ldaps_4' command definition +# This was using 'check_ldaps' in the past which used port 389 and starttls +# mechanism on default, keeped for backward compatibility +define command{ + command_name check_ldaps_4 + command_line /opt/nagios/libexec/check_ldap -H '$HOSTADDRESS$' -T -b '$ARG1$' -4 + } diff --git a/data_nagios/plugins/config/load.cfg b/data_nagios/plugins/config/load.cfg new file mode 100755 index 0000000..bb23c99 --- /dev/null +++ b/data_nagios/plugins/config/load.cfg @@ -0,0 +1,6 @@ +# 'check_load' command definition +define command{ + command_name check_load + command_line /opt/nagios/libexec/check_load --warning='$ARG1$,$ARG2$,$ARG3$' --critical='$ARG4$,$ARG5$,$ARG6$' + } + diff --git a/data_nagios/plugins/config/mail.cfg b/data_nagios/plugins/config/mail.cfg new file mode 100755 index 0000000..ad8167a --- /dev/null +++ b/data_nagios/plugins/config/mail.cfg @@ -0,0 +1,77 @@ +# 'check_pop' command definition +define command { + command_name check_pop + command_line /opt/nagios/libexec/check_pop -H '$HOSTADDRESS$' '$ARG1$' +} + + +# 'check_smtp' command definition +define command { + command_name check_smtp + command_line /opt/nagios/libexec/check_smtp -H '$HOSTADDRESS$' '$ARG1$' +} + +# 'check_ssmtp' command definition +define command { + command_name check_ssmtp + command_line /opt/nagios/libexec/check_ssmtp -H '$HOSTADDRESS$' '$ARG1$' +} + +# 'check_imap' command definition +define command { + command_name check_imap + command_line /opt/nagios/libexec/check_imap -H '$HOSTADDRESS$' '$ARG1$' +} + +# 'check_spop' command definition +define command { + command_name check_spop + command_line /opt/nagios/libexec/check_pop -p 995 -H '$HOSTADDRESS$' -S '$ARG1$' +} + + +# 'check_simap' command definition +define command { + command_name check_simap + command_line /opt/nagios/libexec/check_imap -p 993 -H '$HOSTADDRESS$' -S '$ARG1$' +} + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_pop_4' command definition +define command { + command_name check_pop_4 + command_line /opt/nagios/libexec/check_pop -H '$HOSTADDRESS$' -4 '$ARG1$' +} + +# 'check_smtp_4' command definition +define command { + command_name check_smtp_4 + command_line /opt/nagios/libexec/check_smtp -H '$HOSTADDRESS$' -4 '$ARG1$' +} + +# 'check_ssmtp_4' command definition +define command { + command_name check_ssmtp_4 + command_line /opt/nagios/libexec/check_ssmtp -H '$HOSTADDRESS$' -4 '$ARG1$' +} + +# 'check_imap_4' command definition +define command { + command_name check_imap_4 + command_line /opt/nagios/libexec/check_imap -H '$HOSTADDRESS$' -4 '$ARG1$' +} + +# 'check_spop_4' command definition +define command { + command_name check_spop_4 + command_line /opt/nagios/libexec/check_pop -p 995 -H '$HOSTADDRESS$' -S -4 '$ARG1$' +} + +# 'check_simap_4' command definition +define command { + command_name check_simap_4 + command_line /opt/nagios/libexec/check_imap -p 993 -H '$HOSTADDRESS$' -S -4 '$ARG1$' +} diff --git a/data_nagios/plugins/config/mailq.cfg b/data_nagios/plugins/config/mailq.cfg new file mode 100755 index 0000000..617d394 --- /dev/null +++ b/data_nagios/plugins/config/mailq.cfg @@ -0,0 +1,24 @@ +# 'check-mailq' for sendmail +define command { + command_name check_mailq_sendmail + command_line /opt/nagios/libexec/check_mailq -w '$ARG1$' -c '$ARG2$' -M sendmail +} + +# 'check-mailq' for postfix +define command { + command_name check_mailq_postfix + command_line /opt/nagios/libexec/check_mailq -w '$ARG1$' -c '$ARG2$' -M postfix +} + +# 'check-mailq' for exim +define command { + command_name check_mailq_exim + command_line /opt/nagios/libexec/check_mailq -w '$ARG1$' -c '$ARG2$' -M exim +} + +# 'check-mailq' for qmail +define command { + command_name check_mailq_qmail + command_line /opt/nagios/libexec/check_mailq -w '$ARG1$' -c '$ARG2$' -M qmail +} + diff --git a/data_nagios/plugins/config/mrtg.cfg b/data_nagios/plugins/config/mrtg.cfg new file mode 100755 index 0000000..42f8f13 --- /dev/null +++ b/data_nagios/plugins/config/mrtg.cfg @@ -0,0 +1,14 @@ +# 'check_mrtg' command definition +define command{ + command_name check_mrtg + command_line /opt/nagios/libexec/check_mrtg '$ARG1$' 10 AVG '$ARG2$' '$ARG3$' '$ARG4$' '$ARG5$' '$ARG6$' + } + + +# 'traffic_average' command definition +define command{ + command_name traffic_average + command_line /opt/nagios/libexec/check_mrtgtraf '$ARG1$' 10 AVG '$ARG2$' '$ARG3$' '$ARG4$' '$ARG5$' + } + + diff --git a/data_nagios/plugins/config/mysql.cfg b/data_nagios/plugins/config/mysql.cfg new file mode 100755 index 0000000..ef2d013 --- /dev/null +++ b/data_nagios/plugins/config/mysql.cfg @@ -0,0 +1,24 @@ +# 'check_mysql' command definition +define command{ + command_name check_mysql + command_line /opt/nagios/libexec/check_mysql -H '$HOSTADDRESS$' '$ARG1$' +} + +# 'check_mysql_cmdlinecred' command definition +define command{ + command_name check_mysql_cmdlinecred + command_line /opt/nagios/libexec/check_mysql -H '$HOSTADDRESS$' -u '$ARG1$' -p '$ARG2$' '$ARG3$' +} + +# 'check_mysql_database' command definition +define command{ + command_name check_mysql_database + command_line /opt/nagios/libexec/check_mysql -d '$ARG3$' -H '$HOSTADDRESS$' -u '$ARG1$' -p '$ARG2$' '$ARG3$' +} + +# 'check_mysql_slave' command definition +define command{ + command_name check_mysql_slave + command_line /opt/nagios/libexec/check_mysql -H '$HOSTADDRESS$' -u '$ARG1$' -p '$ARG2$' -S '$ARG3$' +} + diff --git a/data_nagios/plugins/config/netware.cfg b/data_nagios/plugins/config/netware.cfg new file mode 100755 index 0000000..780b75a --- /dev/null +++ b/data_nagios/plugins/config/netware.cfg @@ -0,0 +1,84 @@ +# 'check_netware_logins' command definition +define command{ + command_name check_netware_logins + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v "LOGINS" -w '$ARG1$' -c '$ARG2$' + } + + +# 'check_nwstat_conns' command definition +define command{ + command_name check_nwstat_conns + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v CONNS -w '$ARG1$' -c '$ARG2$' + } + + +# 'check_netware_1load' command definition +define command{ + command_name check_netware_1load + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v "LOAD1" -w 70 -c 90 + } + + +# 'check_netware_5load' command definition +define command{ + command_name check_netware_5load + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v "LOAD5" -w 70 -c 90 + } + + +# 'check_netware_15load' command definition +define command{ + command_name check_netware_15load + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v "LOAD15" -w 70 -c 90 + } + + +# 'check_nwstat_vol_p' command definition +define command{ + command_name check_nwstat_vol_p + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v VPF'$ARG1$' -w '$ARG2$' -c '$ARG3$' + } + + +# 'check_nwstat_vol_k' command definition +define command{ + command_name check_nwstat_vol_k + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v VKF'$ARG1$' -w '$ARG2$' -c '$ARG3$' + } + + +# 'check_nwstat_ltch' command definition +define command{ + command_name check_nwstat_ltch + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v LTCH -w '$ARG1$' -c '$ARG2$' + } + + +# 'check_nwstat_puprb' command definition +define command{ + command_name check_nwstat_puprb + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v PUPRB -w '$ARG1$' -c '$ARG2$' + } + + +# 'check_nwstat_dsdb' command definition +define command{ + command_name check_nwstat_dsdb + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v DSDB + } + + +# 'check_netware_abend' command definition +define command{ + command_name check_netware_abend + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v "ABENDS" -w 10 -c 30 + } + + +# 'check_nwstat_csprocs' command definition +define command{ + command_name check_nwstat_csprocs + command_line /opt/nagios/libexec/check_nwstat -H '$HOSTADDRESS$' -v CSPROCS -w '$ARG1$' -c '$ARG2$' + } + + diff --git a/data_nagios/plugins/config/news.cfg b/data_nagios/plugins/config/news.cfg new file mode 100755 index 0000000..072a8f5 --- /dev/null +++ b/data_nagios/plugins/config/news.cfg @@ -0,0 +1,15 @@ +# 'check_nntp' command definition +define command{ + command_name check_nntp + command_line /opt/nagios/libexec/check_nntp -H '$HOSTADDRESS$' '$ARG1$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_nntp_4' command definition +define command{ + command_name check_nntp_4 + command_line /opt/nagios/libexec/check_nntp -H '$HOSTADDRESS$' -4 '$ARG1$' + } diff --git a/data_nagios/plugins/config/nt.cfg b/data_nagios/plugins/config/nt.cfg new file mode 100755 index 0000000..4a0c653 --- /dev/null +++ b/data_nagios/plugins/config/nt.cfg @@ -0,0 +1,15 @@ +# If you are confused about this command definition, cause you was +# reading other suggestions, please have a look into +# /usr/share/doc/monitoring-plugins/README.Debian + +# 'check_nt' command definition +define command { + command_name check_nt + command_line /opt/nagios/libexec/check_nt -H '$HOSTADDRESS$' -v '$ARG1$' +} + +# 'check_nscp' command definition +define command { + command_name check_nscp + command_line /opt/nagios/libexec/check_nt -H '$HOSTADDRESS$' -p 12489 -v '$ARG1$' +} diff --git a/data_nagios/plugins/config/ntp.cfg b/data_nagios/plugins/config/ntp.cfg new file mode 100755 index 0000000..9fd3974 --- /dev/null +++ b/data_nagios/plugins/config/ntp.cfg @@ -0,0 +1,17 @@ +# 'check_ntp' command definition +define command{ + command_name check_ntp + command_line /opt/nagios/libexec/check_ntp_peer -H '$HOSTADDRESS$' '$ARG1$' + } + +# 'check_ntp_ntpq' command definition +define command{ + command_name check_ntp_ntpq + command_line /opt/nagios/libexec/check_ntp_peer -H '$HOSTADDRESS$' -j 10 -k 15 '$ARG1$' + } + +# 'check_time' command definition +define command{ + command_name check_time + command_line /opt/nagios/libexec/check_time -H '$HOSTADDRESS$' '$ARG1$' + } diff --git a/data_nagios/plugins/config/pgsql.cfg b/data_nagios/plugins/config/pgsql.cfg new file mode 100755 index 0000000..797757c --- /dev/null +++ b/data_nagios/plugins/config/pgsql.cfg @@ -0,0 +1,15 @@ +# 'check_pgsql' command definition +define command{ + command_name check_pgsql + command_line /opt/nagios/libexec/check_pgsql -H '$HOSTADDRESS$' '$ARG1$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_pgsql_4' command definition +define command{ + command_name check_pgsql_4 + command_line /opt/nagios/libexec/check_pgsql -H '$HOSTADDRESS$' -4 '$ARG1$' + } diff --git a/data_nagios/plugins/config/ping.cfg b/data_nagios/plugins/config/ping.cfg new file mode 100755 index 0000000..1ee9307 --- /dev/null +++ b/data_nagios/plugins/config/ping.cfg @@ -0,0 +1,72 @@ +# 'check_ping' command definition +define command{ + command_name check_ping + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w '$ARG1$' -c '$ARG2$' + } + + +# 'check-host-alive' command definition +define command{ + command_name check-host-alive + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 + } + + +# 'check-printer-alive' command definition +define command{ + command_name check-printer-alive + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 + } + + +# 'check-switch-alive' command definition +define command{ + command_name check-switch-alive + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 + } + + +# 'check-router-alive' command definition +define command{ + command_name check-router-alive + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_ping_4' command definition +define command{ + command_name check_ping_4 + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w '$ARG1$' -c '$ARG2$' -4 + } + + +# 'check-host-alive_4' command definition +define command{ + command_name check-host-alive_4 + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 -4 + } + + +# 'check-printer-alive_4' command definition +define command{ + command_name check-printer-alive_4 + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 -4 + } + + +# 'check-switch-alive_4' command definition +define command{ + command_name check-switch-alive_4 + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 -4 + } + + +# 'check-router-alive_4' command definition +define command{ + command_name check-router-alive_4 + command_line /opt/nagios/libexec/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1 -4 + } + diff --git a/data_nagios/plugins/config/procs.cfg b/data_nagios/plugins/config/procs.cfg new file mode 100755 index 0000000..86beef3 --- /dev/null +++ b/data_nagios/plugins/config/procs.cfg @@ -0,0 +1,20 @@ +# 'check_procs' command definition +define command{ + command_name check_procs + command_line /opt/nagios/libexec/check_procs -w '$ARG1$' -c '$ARG2$' + } + + +# 'check_procs_zombie' command definition +define command{ + command_name check_procs_zombie + command_line /opt/nagios/libexec/check_procs -w '$ARG1$' -c '$ARG2$' -s Z + } + + +# 'check_procs_httpd' command definition +define command{ + command_name check_procs_httpd + command_line /opt/nagios/libexec/check_procs -w 5:'$ARG1$' -c 1:'$ARG2$' -C httpd + } + diff --git a/data_nagios/plugins/config/real.cfg b/data_nagios/plugins/config/real.cfg new file mode 100755 index 0000000..47c5b78 --- /dev/null +++ b/data_nagios/plugins/config/real.cfg @@ -0,0 +1,13 @@ +# 'check_real_url' command definition +define command{ + command_name check_real_url + command_line /opt/nagios/libexec/check_real '$HOSTADDRESS$' -p '$ARG1$' -wt '$ARG2$' -ct '$ARG3$' -to 5 -u '$ARG4$' + } + + +# 'check_real' command definition +define command{ + command_name check_real + command_line /opt/nagios/libexec/check_real '$HOSTADDRESS$' -p '$ARG1$' -wt '$ARG2$' -ct '$ARG3$' -to 5 + } + diff --git a/data_nagios/plugins/config/rpc-nfs.cfg b/data_nagios/plugins/config/rpc-nfs.cfg new file mode 100755 index 0000000..fed317b --- /dev/null +++ b/data_nagios/plugins/config/rpc-nfs.cfg @@ -0,0 +1,14 @@ + +# 'check-rpc' command definition +define command{ + command_name check-rpc + command_line /opt/nagios/libexec/check_rpc -H '$HOSTADDRESS$' -C '$ARG1$' + } + + +# 'check-nfs' command definition +define command{ + command_name check-nfs + command_line /opt/nagios/libexec/check_rpc -H '$HOSTADDRESS$' -C nfs -c2,3 + } + diff --git a/data_nagios/plugins/config/snmp.cfg b/data_nagios/plugins/config/snmp.cfg new file mode 100755 index 0000000..9b0e5ee --- /dev/null +++ b/data_nagios/plugins/config/snmp.cfg @@ -0,0 +1,132 @@ +# 'snmp_load' command definition +define command{ + command_name snmp_load + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w :'$ARG2$',:'$ARG3$',:'$ARG4$' -c :'$ARG5$',:'$ARG6$',:'$ARG7$' -l load + } + + +# 'snmp_cpustats' command definition +define command{ + command_name snmp_cpustats + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%' + } + + +# 'snmp_procname' command definition +define command{ + command_name snmp_procname + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.2.1.5.'$ARG2$' -w '$ARG3$':'$ARG4$' -c '$ARG5$':'$ARG6$' + } + + +# 'snmp_disk' command definition +define command{ + command_name snmp_disk + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.9.1.7.'$ARG2$',.1.3.6.1.4.1.2021.9.1.9.'$ARG2$' -w '$ARG3$':,:'$ARG4$' -c '$ARG5$':,:'$ARG6$' -u 'kB free (','% used)' -l 'disk space' + } + + +# 'snmp_mem' command definition +define command{ + command_name snmp_mem + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.4.6.0,.1.3.6.1.4.1.2021.4.5.0 -w '$ARG2$': -c '$ARG3$': + } + + +# 'snmp_swap' command definition +define command{ + command_name snmp_swap + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.4.4.0,.1.3.6.1.4.1.2021.4.3.0 -w '$ARG2$': -c '$ARG3$': + } + + +# 'snmp_procs' command definition +define command{ + command_name snmp_procs + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrSystem.hrSystemProcesses -w :'$ARG2$' -c :'$ARG3$' -l processes + } + + +# 'snmp_users' command definition +define command{ + command_name snmp_users + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrSystem.hrSystemNumUsers -w :'$ARG2$' -c :'$ARG3$' -l users + } + + +# 'snmp_mem2' command definition +define command{ + command_name snmp_mem2 + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$' + } + + +# 'snmp_swap2' command definition +define command{ + command_name snmp_swap2 + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$' + } + + +# 'snmp_mem3' command definition +define command{ + command_name snmp_mem3 + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$' + } + + +# 'snmp_swap3' command definition +define command{ + command_name snmp_swap3 + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$' + } + + +# 'snmp_disk2' command definition +define command{ + command_name snmp_disk2 + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$' -w '$ARG3$' -c '$ARG4$' + } + + +# 'snmp_tcpopen' command definition +define command{ + command_name snmp_tcpopen + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o tcp.tcpCurrEstab.0 -w '$ARG2$' -c '$ARG3$' + } + + +# 'snmp_tcpstats' command definition +define command{ + command_name snmp_tcpstats + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o tcp.tcpActiveOpens.0,tcp.tcpPassiveOpens.0,tcp.tcpInSegs.0,tcp.tcpOutSegs.0,tcp.tcpRetransSegs.0 -l 'TCP stats' + } + + +# 'check_netapp_uptime' command definition +define command{ + command_name check_netapp_uptime + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.2.1.1.3.0 --delimiter=')' -l "Uptime is" + } + + +# 'check_netapp_cpuload' command definition +define command{ + command_name check_netapp_cpuload + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.789.1.2.1.3.0 -w 90 -c 95 -u '%' -l "CPU LOAD " + } + + +# 'check_netapp_numdisks' command definition +define command{ + command_name check_netapp_numdisks + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.789.1.6.4.1.0,.1.3.6.1.4.1.789.1.6.4.2.0,.1.3.6.1.4.1.789.1.6.4.8.0,.1.3.6.1.4.1.789.1.6.4.7.0 -u 'Total Disks','Active','Spare','Failed' -l "" + } + + +# 'check_compaq_thermalCondition' command definition +define command{ + command_name check_compaq_thermalCondition + command_line /opt/nagios/libexec/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.232.6.2.1.0,.1.3.6.1.4.1.232.6.2.2.0,.1.3.6.1.4.1.232.6.2.3.0,.1.3.6.1.4.1.232.6.2.4.0 -u 'ThermalCondition','ThermalTemp','ThermalSystem','ThermalCPUFan' -w 2:2,2:2,2:2,2:2 -c 1:2,1:2,1:2,1:2 -l "Thermal status " + } + diff --git a/data_nagios/plugins/config/ssh.cfg b/data_nagios/plugins/config/ssh.cfg new file mode 100755 index 0000000..56961e7 --- /dev/null +++ b/data_nagios/plugins/config/ssh.cfg @@ -0,0 +1,27 @@ +# 'check_ssh' command definition +define command{ + command_name check_ssh + command_line /opt/nagios/libexec/check_ssh '$HOSTADDRESS$' + } + +# 'check_ssh_port' command definition +define command{ + command_name check_ssh_port + command_line /opt/nagios/libexec/check_ssh -p '$ARG1$' '$HOSTADDRESS$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_ssh_4' command definition +define command{ + command_name check_ssh_4 + command_line /opt/nagios/libexec/check_ssh -4 '$HOSTADDRESS$' + } + +# 'check_ssh_port_4' command definition +define command{ + command_name check_ssh_port_4 + command_line /opt/nagios/libexec/check_ssh -4 -p '$ARG1$' '$HOSTADDRESS$' + } diff --git a/data_nagios/plugins/config/tcp_udp.cfg b/data_nagios/plugins/config/tcp_udp.cfg new file mode 100755 index 0000000..6ebc163 --- /dev/null +++ b/data_nagios/plugins/config/tcp_udp.cfg @@ -0,0 +1,27 @@ +# 'check_tcp' command definition +define command{ + command_name check_tcp + command_line /opt/nagios/libexec/check_tcp -H '$HOSTADDRESS$' -p '$ARG1$' '$ARG2$' + } + +# 'check_udp' command definition +define command{ + command_name check_udp + command_line /opt/nagios/libexec/check_udp -H '$HOSTADDRESS$' -p '$ARG1$' '$ARG2$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_tcp_4' command definition +define command{ + command_name check_tcp_4 + command_line /opt/nagios/libexec/check_tcp -H '$HOSTADDRESS$' -p '$ARG1$' -4 '$ARG2$' + } + +# 'check_udp_4' command definition +define command{ + command_name check_udp_4 + command_line /opt/nagios/libexec/check_udp -H '$HOSTADDRESS$' -p '$ARG1$' -4 '$ARG2$' + } diff --git a/data_nagios/plugins/config/telnet.cfg b/data_nagios/plugins/config/telnet.cfg new file mode 100755 index 0000000..5fc4b48 --- /dev/null +++ b/data_nagios/plugins/config/telnet.cfg @@ -0,0 +1,15 @@ +# 'check_telnet' command definition +define command{ + command_name check_telnet + command_line /opt/nagios/libexec/check_tcp -H '$HOSTADDRESS$' -p 23 '$ARG1$' + } + +#### +# use these checks, if you want to test IPv4 connectivity on IPv6 enabled systems +#### + +# 'check_telnet_4' command definition +define command{ + command_name check_telnet_4 + command_line /opt/nagios/libexec/check_tcp -H '$HOSTADDRESS$' -p 23 -4 '$ARG1$' + } diff --git a/data_nagios/plugins/config/users.cfg b/data_nagios/plugins/config/users.cfg new file mode 100755 index 0000000..bf13ea7 --- /dev/null +++ b/data_nagios/plugins/config/users.cfg @@ -0,0 +1,6 @@ +# 'check_users' command definition +define command{ + command_name check_users + command_line /opt/nagios/libexec/check_users -w '$ARG1$' -c '$ARG2$' + } + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a9ac4c4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' +services: + nagios: + image: jasonrivers/nagios:latest + restart: always + # select the user that can access to the files + environment: + - USER_UID=1001 + - USER_GID=1001 + ports: + - "8080:80" + # Uncomment the next line to validate the configuration files + #command: nagios -v /opt/nagios/etc/nagios.cfg + volumes: + - ./data_nagios/config/nagios.cfg:/opt/nagios/etc/nagios.cfg:rw + - ./data_nagios/config/commands.cfg:/opt/nagios/etc/commands.cfg:rw + - ./data_nagios/config/htpasswd.users:/opt/nagios/etc/htpasswd.users:rw + - ./data_nagios/config/data:/opt/nagios/etc/data:rw + - ./data_nagios/log:/opt/nagios/log:rw + - ./data_nagios/var:/opt/nagios/var:rw + - ./data_nagios/cache:/opt/nagios/cache:rw + - ./data_nagios/plugins/config:/opt/nagios/etc/plugins/config:rw