monitoring

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

Icinga CLI

NAGIOS_CMD_SOCKET=/var/lib/icinga/rw/icinga.cmd

# schedule a service check
HOST_NAME=www.example.com
SERVICE_NAME=APT
/usr/bin/printf "[%lu] SCHEDULE_FORCED_SVC_CHECK;%s;%s;%s\n" $(date +%s) "${HOST_NAME}" "${SERVICE_NAME}" $(date +%s) | tee -a "${NAGIOS_CMD_SOCKET}"

# schedule a host check
/usr/bin/printf "[%lu] SCHEDULE_HOST_CHECK;%s;%s\n" \
$(date +%s) \
"host_name" \
$(date +%s) | tee -a $NAGIOS_CMD_SOCKET

# URL

Debian: Install Cacti

# create container
export CONTAINER=cacti
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/create.jessie.sh -O - | bash -s -- -f
sudo lxc-attach -n ${CONTAINER} -- sed -i 's|PermitRootLogin without-password|PermitRootLogin yes|' /etc/ssh/sshd_config
sudo lxc-attach -n ${CONTAINER} -- service ssh restart

# fix dns
echo nameserver 8.8.8.8 > /var/lib/lxc/${CONTAINER}/rootfs/etc/resolv.conf

# install applications
lxc-attach -n ${CONTAINER} --
LANG=en_US.UTF-8

apt-get update

# server
debconf-set-selections <<\EOF

Icinga objects: commands.cfg

wget -q https://raw.githubusercontent.com/panticz/icinga/master/objects/commands.cfg -O /etc/icinga/objects/commands.cfg

define command {
  command_name ssh_check_disk
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_disk -w $ARG2$ -c $ARG3$ -p $ARG1$"
}

define command {
  command_name ssh_check_mem
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_mem -w $ARG1$ -c $ARG2$ -f -C"
}

define command {
  command_name ssh_check_load
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_load -w $ARG1$,$ARG2$,$ARG3$ -c $ARG4$,$ARG5$,$ARG6$"
}

define command {
  command_name ssh_check_procs
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$"
}

define command {
  command_name ssh_check_procs_zombie
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s Z"
}

define command {
  command_name ssh_check_users
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$"
}

define command {
  command_name snmp_check_printer
  command_line /usr/lib/nagios/plugins/check_printer $HOSTADDRESS$ public $ARG1$ $ARG2$
}

define command {
  command_name ssh_check_swap
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_swap -w $ARG1$ -c $ARG2$"
}

define command {
  command_name ssh_check_apt
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_apt"
}

define command {
  command_name check_ping_8.8.8.8
  command_line /usr/lib/nagios/plugins/check_ping -H 8.8.8.8 -w 100.0,20% -c 500.0,60%
}

define command {
  command_name ssh_check_log
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_log -F $ARG1$ -O /dev/null -q '$ARG2$'"
}

define command {
  command_name ssh_check_raid
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_raid"
}

define command {
  command_name ssh_check_hddtemp
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_hddtemp /dev/$ARG1$ $ARG2$ $ARG3$"
}

define command {
  command_name ssh_check_ide_smart
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_ide_smart -d /dev/$ARG1$ -n"
}

define command {
  command_name ssh_check_cert_expire
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_cert_expire $ARG1$"
}

define command {
  command_name ssh_check_temp
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_temp $ARG1$ $ARG2$"
}

define command {
  command_name check_http_uri_regex
  command_line /usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -u '$ARG1$' -r '$ARG2$'
}

define command {
  command_name check_http_uri_time
  command_line /usr/lib/nagios/plugins/check_http -t 20 -H $HOSTADDRESS$ -u '$ARG1$' -w '$ARG2$' -c '$ARG3$'
}

define command {
  command_name check_snmp
  command_line /usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -o '$ARG1$' -w '$ARG2$' -c '$ARG3$'
}

define command {
  command_name check_printer_total_page_count
  command_line /usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -o 1.3.6.1.2.1.43.10.2.1.4.1.1 -w '$ARG2$' -c '$ARG3$'
}

define command {
  command_name check_snom_registration_status
  command_line /usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -o 1.3.6.1.2.1.7526.2.3.$ARG1$ -s 1
}

define command {
  command_name check_snom_firmware_version
  command_line /usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -o 1.3.6.1.2.1.7526.2.4 -r '$ARG1$'
}

define command {
  command_name check_snmp_printer
  command_line /usr/lib/nagios/plugins/check_snmp_printer -H $HOSTADDRESS$ -x "$ARG1$" -w $ARG2$ -c $ARG3$
}

define command {
  command_name check_smb_share
  command_line /usr/lib/nagios/plugins/check_smb_share -H $HOSTADDRESS$ -s "$ARG1$"
}

define command {
  command_name ssh_check_oracle_tns
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_oracle --tns $ARG1$ "
}

define command {
  command_name ssh_check_mailq
  command_line /usr/lib/nagios/plugins/check_by_ssh -t 20 -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_mailq -w $ARG1$ -c $ARG2$ "
}

define command {
  command_name check_http_number
  command_line /usr/lib/nagios/plugins/check_http_number "$ARG1$" "$ARG2$" "$ARG3$"
}

define command {
  command_name ssh_check_sensors
  command_line /usr/lib/nagios/plugins/check_by_ssh -H $HOSTADDRESS$ -l root -i /var/lib/nagios/.ssh/id_rsa -C "/usr/lib/nagios/plugins/check_sensors -d /dev/$ARG1$ -n"
}

define command {
    command_name check_url
    command_line /usr/lib/nagios/plugins/check_http -H '$ARG1$' -p '$ARG2$' -u '$ARG3$' -s '$ARG4$' -f follow
}

Syndicate content