Nagios-plugin to read the the temperature of a one wire sensor (like DSL 1820) and compare it with the supplied thresholds.


  1. First start digitemp with these parameters digitemp_DS9097 -i -s /dev/ttyS0
  2. Then copy the file .digitemprc to /usr/local/nagios/ and the script to the check-plugins-directory e.g. /usr/local/nagios/libexec
  3. Install sudo and edit the file /etc/sudoers. Insert nagios ALL=(ALL) NOPASSWD: /usr/bin/digitemp_DS9097
  4. Copy the file .digitemprc also to the /(root)-directory. This is needed, because the nrpe-daemon starts the programms with the PWD=/


  • errorhandling
  • check range and value of parameters

Needed hard- and software


  • digitemp (e.g. apt-get install digitemp)



`./check_digitemp -ts  -w  -c  -f`


The plugin prints the temperature in centigrade or in fahrenheit followed by "ok" or either "warning" or "critical" if the corresponding threshold is reached.

Exit Codes

0 OK       Temperature checked and everything is ok
1 Warning  Temperature  above "warning" threshold
2 Critical Temperature  above "critical" threshold
3 Unknown  Invalid command line arguments or could not read the sensor


check_digitemp -ts C -w 22 -c 25 -f

21.81 C - ok          (exit code 0)
23.00 C - warning     (exit code 1)
26.23 C - critical    (exit code 2)

Paths to commands used in this script. These may have to be modified to match your system setup.

Links (german) (english)