monitoring
hardwaremonitoring

Hard disk drives #

lsblk -f
tree overview over all block devices, partitions, uuid’s, labels and mountpoints
hdparm -C /dev/sda
displays the drive’s state (active, standby)
smartctl -s standby,now /dev/sda
put the drive into standby
hdparm -S240
automatically put the drive into standby after 20 minutes of inactivity
smartctl -a /dev/sda
displays all smart information about the drive
smartctl -lscttemp /dev/sda
displays the drives temperature over time (other -l options exist, wakes drive up from standby)
hddtemp /dev/sda
can spin sleeping drives up, but does not do that by default, shows the drive’s description/manufacturer, configurable as daemon

SIP #

As the SIP specification is very comprehensive it is not easy to find simple plain text tests. I found it is possible to make a simple call by sending this

INVITE sip:4934100000000@typesafe.de SIP/2.0
Accept: application/sdp
To: sip:+4917600000000@10.0.0.5
From: <sip:caller@anyhostyouwant>;tag=12345a
CSeq: 1 INVITE
Call-ID: caller@canbeanything
Max-Forwards: 1
Via: SIP/2.0/UDP 10.0.0.5

The INVITE is to invite a person to participate on a call, that means 'ringing'. Changing this value to OPTIONS just returns information about the called person and can be used for remote monitoring tools (see below). The 10.0.0.5 in this example was a machine running an asterisk as advanced voicemail service, but could also have been the number of an internet service provider.

Icinga/Nagios configuration #

In order to check your SIP configuration you can try this (notice: this is the place where this snippet firstly appeared)

object Service "asterisk" {
import "generic-service"
vars.udp_address      = "10.0.0.5"
vars.udp_port         = 5060
vars.udp_send         = {{{OPTIONS sip:49341000000000@typesafe.de SIP/2.0
Accept: application/sdp
To: sip:+4917000000000@10.0.0.5
From: <sip:caller@anyhostyouwant>;tag=12345b
CSeq: 1 OPTIONS
Call-ID: caller@canbeanything
Max-Forwards: 1
Via: SIP/2.0/UDP 10.0.0.5
}}}
vars.udp_expect       = ""
check_command         = "udp"
}

This snippet must be modified to suit your needs. Especially the phone number of cause, which is the one after the OPTIONS sip:. Keep in mind, that Icinga allows {{{ and }}} for multi line configuration values and nagios does not *afaik*.

top