Nagios plugin: monitor a systemd service

Here’s a tiny plugin to check if a systemd service is running: #!/bin/bash # # машины # # Check a if a systemd service is running # # Usage: $0 # #Nagios exit codes OK=0 WARNING=1 CRITICAL=2 UNKNOWN=3   SERVICE=$1   # Check service status   systemctl -q is-active $SERVICE if [[ $? -ne 0… Continue reading “Nagios plugin: monitor a systemd service”

Changing sender’s email address in Nagios

By default settings, Nagios will send email notifications as nagios@localhost, identified by $ADMINEMAIL$ macro. If you want to change this behavior, you need to set the email address you want to use in the nagios.cfg file: # ADMINISTRATOR EMAIL/PAGER ADDRESSES # The email and pager address of a global administrator (likely you). # Nagios never… Continue reading “Changing sender’s email address in Nagios”