2012-11-01 15:47:50 +01:00
|
|
|
###############################################################################
|
|
|
|
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# NOTIFICATION COMMANDS
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# 'notify-host-by-email' command definition
|
|
|
|
define command{
|
2016-07-23 01:55:50 +02:00
|
|
|
command_name notify-host-by-email
|
|
|
|
command_line /usr/bin/printf "%b" "Subject: $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$\n\n***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/msmtp -C /var/lib/nagios/msmtprc -vt $CONTACTEMAIL$ 2>&1
|
|
|
|
}
|
2012-11-01 15:47:50 +01:00
|
|
|
|
|
|
|
# 'notify-service-by-email' command definition
|
|
|
|
define command{
|
2016-07-23 01:55:50 +02:00
|
|
|
command_name notify-service-by-email
|
|
|
|
command_line /usr/bin/printf "%b" "Subject: $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$\n\n***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$\n" | /usr/bin/msmtp -C /var/lib/nagios/msmtprc -vt $CONTACTEMAIL$
|
|
|
|
}
|
2012-11-01 15:47:50 +01:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# HOST CHECK COMMANDS
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# On Debian, check-host-alive is being defined from within the
|
2020-06-29 23:15:37 +02:00
|
|
|
# monitoring-plugins-basic package
|
2012-11-01 15:47:50 +01:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# PERFORMANCE DATA COMMANDS
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
# 'process-host-perfdata' command definition
|
|
|
|
define command{
|
|
|
|
command_name process-host-perfdata
|
2022-01-11 00:55:20 +01:00
|
|
|
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/lib/nagios4/host-perfdata.out
|
2012-11-01 15:47:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 'process-service-perfdata' command definition
|
|
|
|
define command{
|
|
|
|
command_name process-service-perfdata
|
2022-01-11 00:55:20 +01:00
|
|
|
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/lib/nagios4/service-perfdata.out
|
2012-11-01 15:47:50 +01:00
|
|
|
}
|
|
|
|
|
2012-11-16 16:42:52 +01:00
|
|
|
define command{
|
|
|
|
command_name check_remote_disk
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p 22 -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_disk -W$ARG1$ -K$ARG2$ -w $ARG1$ -c $ARG2$ -A -l -X cgroup -X tmpfs -X devtmpfs -X squashfs -X configfs -X tracefs'
|
2012-11-16 16:42:52 +01:00
|
|
|
}
|
2012-11-01 15:47:50 +01:00
|
|
|
|
2020-04-17 02:48:36 +02:00
|
|
|
# Copy of check_remote_disk without the SSH
|
|
|
|
define command{
|
|
|
|
command_name check_local_disk
|
2020-04-17 02:49:29 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_disk -W$ARG1$ -K$ARG2$ -w $ARG1$ -c $ARG2$ -A -l -X cgroup -X tmpfs -X devtmpfs -X squashfs -X configfs -X tracefs
|
2020-04-17 02:48:36 +02:00
|
|
|
}
|
|
|
|
|
2012-11-16 16:42:52 +01:00
|
|
|
define command{
|
|
|
|
command_name check_remote_load
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_load -w $ARG2$ -c $ARG3$'
|
2012-11-16 16:42:52 +01:00
|
|
|
}
|
2012-11-16 17:19:53 +01:00
|
|
|
|
|
|
|
define command{
|
|
|
|
command_name check_zephyr_mirror_forwarding
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_zephyr_mirror/check_zephyr_mirror'
|
2012-11-16 17:19:53 +01:00
|
|
|
}
|
2012-11-16 17:20:12 +01:00
|
|
|
|
2013-08-26 21:43:29 +02:00
|
|
|
define command{
|
|
|
|
command_name check_personal_zephyr_mirrors
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_zephyr_mirror/check_personal_zephyr_mirrors'
|
2013-08-26 21:43:29 +02:00
|
|
|
}
|
|
|
|
|
2012-11-16 17:20:12 +01:00
|
|
|
define command{
|
|
|
|
command_name check_user_zephyr_mirror_liveness
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_zephyr_mirror/check_user_zephyr_mirror_liveness'
|
2012-11-16 17:20:12 +01:00
|
|
|
}
|
2012-11-21 20:17:15 +01:00
|
|
|
|
|
|
|
define command{
|
|
|
|
command_name check_debian_packages
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_base/check_debian_packages'
|
2012-11-21 20:17:15 +01:00
|
|
|
}
|
2013-01-02 23:49:05 +01:00
|
|
|
|
|
|
|
define command{
|
|
|
|
command_name check_ntp_time
|
2022-06-13 23:56:59 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_ntp_time -H $ARG2$ -w .5 -c 1'
|
2013-01-02 23:49:05 +01:00
|
|
|
}
|
2013-01-03 16:56:36 +01:00
|
|
|
|
2013-10-29 21:46:31 +01:00
|
|
|
define command{
|
|
|
|
command_name check_queue_worker_errors
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_queue_worker_errors'
|
2013-10-29 21:46:31 +01:00
|
|
|
}
|
|
|
|
|
2013-01-30 16:14:38 +01:00
|
|
|
define command{
|
|
|
|
command_name check_postgres
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p 22 -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/bin/check_postgres --dbname=$ARG1$ --dbuser=$ARG2$ --action $ARG3$'
|
2013-01-30 16:14:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
define command{
|
|
|
|
command_name check_postgres_alert_args
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p 22 -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/bin/check_postgres --dbname=$ARG1$ --dbuser=$ARG2$ --action $ARG3$ --warning="$ARG4$" --critical="$ARG5$"'
|
2013-01-30 16:14:38 +01:00
|
|
|
}
|
2013-01-30 15:59:41 +01:00
|
|
|
|
2013-02-05 19:17:49 +01:00
|
|
|
define command{
|
|
|
|
command_name check_sync_public_streams
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_procs -u zulip -c 1:1 -a "/home/zulip/python-zulip-api/zulip/integrations/zephyr/sync-public-streams"'
|
2013-02-05 19:17:49 +01:00
|
|
|
}
|
2013-02-19 18:06:25 +01:00
|
|
|
|
2016-08-01 05:32:30 +02:00
|
|
|
define command{
|
|
|
|
command_name check_redis_ssh
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_redis -H 127.0.0.1 -C /var/lib/nagios/redis_password'
|
2016-08-01 05:32:30 +02:00
|
|
|
}
|
|
|
|
|
2013-02-19 18:06:25 +01:00
|
|
|
define command{
|
|
|
|
command_name check_rabbitmq_queues
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_rabbitmq_queues'
|
2013-02-19 18:06:25 +01:00
|
|
|
}
|
2013-02-19 21:29:38 +01:00
|
|
|
|
2016-08-10 07:57:19 +02:00
|
|
|
define command{
|
|
|
|
command_name check_send_receive_time
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_cron_file /var/lib/nagios_state/check_send_receive_state'
|
2016-08-10 07:57:19 +02:00
|
|
|
}
|
|
|
|
|
2013-04-16 20:07:53 +02:00
|
|
|
define command{
|
2013-09-23 20:58:02 +02:00
|
|
|
command_name check_rabbitmq_consumers
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p 22 -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_rabbitmq_consumers $ARG1$'
|
2013-04-16 20:07:53 +02:00
|
|
|
}
|
|
|
|
|
2017-10-05 19:34:33 +02:00
|
|
|
define command{
|
|
|
|
command_name check_analytics_state
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p 22 -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_cron_file /var/lib/nagios_state/check-analytics-state 4000' # Last argument is acceptable delay in seconds.
|
2017-10-05 19:34:33 +02:00
|
|
|
}
|
|
|
|
|
2013-02-19 21:29:38 +01:00
|
|
|
define command{
|
|
|
|
command_name check_remote_swap
|
2016-07-31 23:45:39 +02:00
|
|
|
# `-n ok` means having no swap is OK
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_swap -w $ARG2$ -c $ARG3$ -n ok'
|
2013-02-19 21:29:38 +01:00
|
|
|
}
|
2013-07-17 17:44:45 +02:00
|
|
|
|
|
|
|
define command {
|
|
|
|
command_name check_named_procs
|
|
|
|
command_line /usr/lib/nagios/plugins/check_procs -C $ARG1$ -w $ARG2$ -c $ARG3$
|
|
|
|
}
|
2013-08-07 17:56:31 +02:00
|
|
|
|
2016-08-06 08:23:11 +02:00
|
|
|
define command{
|
|
|
|
command_name check_procs_nokthreads
|
|
|
|
command_line /usr/lib/nagios/plugins/check_procs -w '$ARG1$' -c '$ARG2$' -k
|
|
|
|
}
|
|
|
|
|
2013-08-07 17:56:31 +02:00
|
|
|
define command {
|
|
|
|
command_name check_fts_update_log
|
2021-05-25 07:42:42 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/local/bin/process_fts_updates --nagios-check'
|
2013-08-07 17:56:31 +02:00
|
|
|
}
|
2013-08-22 23:01:12 +02:00
|
|
|
|
|
|
|
define command {
|
2020-10-26 22:06:29 +01:00
|
|
|
command_name check_postgresql_replication_lag
|
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_postgresql/check_postgresql_replication_lag'
|
2013-08-22 23:01:12 +02:00
|
|
|
}
|
2013-08-26 22:52:19 +02:00
|
|
|
|
|
|
|
define command {
|
2020-10-26 22:05:28 +01:00
|
|
|
command_name check_postgresql_backup
|
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_postgresql_backups/check_postgresql_backup'
|
2013-08-26 22:52:19 +02:00
|
|
|
}
|
2013-08-26 18:22:09 +02:00
|
|
|
|
2013-12-03 22:01:49 +01:00
|
|
|
define command{
|
|
|
|
command_name check_worker_memory
|
2020-10-23 01:14:21 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_worker_memory'
|
2013-12-03 22:01:49 +01:00
|
|
|
}
|
|
|
|
|
2014-06-05 20:47:16 +02:00
|
|
|
define command{
|
|
|
|
command_name check_https_status
|
|
|
|
command_line /usr/lib/nagios/plugins/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' --expect=200,302,401
|
|
|
|
}
|
2021-03-18 04:04:15 +01:00
|
|
|
|
2021-03-24 03:27:27 +01:00
|
|
|
define command{
|
|
|
|
command_name check_ssl_certificate
|
2021-05-18 03:37:54 +02:00
|
|
|
command_line /usr/lib/nagios/plugins/check_http --ssl -H '$ARG1$' -I '$ARG1$' --sni --expect=200,302,401 -C30,14
|
2021-03-24 03:27:27 +01:00
|
|
|
}
|
|
|
|
|
2021-03-18 04:04:15 +01:00
|
|
|
define command{
|
|
|
|
command_name check_proxy_status
|
|
|
|
command_line /usr/lib/nagios/plugins/check_http --ssl -H 'www.google.com' -u 'https://www.google.com/' -j CONNECT -I '$HOSTADDRESS$' -p 4750 --expect=200,302,401 -s Search
|
|
|
|
}
|
2021-03-24 03:27:42 +01:00
|
|
|
|
|
|
|
define command{
|
|
|
|
command_name check_apt_repo_status
|
|
|
|
command_line /usr/lib/nagios/plugins/check_http --sni --ssl -H '$ARG1$' -u 'https://$ARG1$$ARG2$/dists/stable/Release' --expect=200 -s Contents-amd64
|
|
|
|
}
|
2021-06-25 02:15:26 +02:00
|
|
|
|
|
|
|
define command{
|
|
|
|
command_name check_camo
|
|
|
|
command_line /usr/lib/nagios/plugins/check_http --sni --ssl -H '$ARG1$' -u '$ARG2$' -k 'Accept-Encoding: identity' -w '$ARG3$' -c '$ARG4$'
|
|
|
|
}
|