[DEV] basic docker interface for nagios

This commit is contained in:
Edouard DUPIN 2019-01-29 23:03:05 +01:00
parent 460bc02432
commit 53e5fe50f4
39 changed files with 1073 additions and 2 deletions

View File

@ -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
```

0
data_nagios/cache/.keep vendored Normal file
View File

View File

@ -0,0 +1 @@
nagiosadmin:{SHA}/i0Kels0lRtuw8RhhPHtPq4ZRZ0=

View File

View File

@ -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
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -0,0 +1,6 @@
# 'check_flexlm' command definition
define command{
command_name check_flexlm
command_line /opt/nagios/libexec/check_flexlm -F '$ARG1$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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 "
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

View File

@ -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$'
}

22
docker-compose.yml Normal file
View File

@ -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