This article shows the Nagios plugins developed by KDEV staff for Foxbox: 1) Temperature & Humidity check (download it here)
This plugin has been developed to let EasyG2 Foxbox handle inputs from USB sensor by Toradex (available here). In this way you will always be able to check the humidity (in %) and temperature (in °C) values in the room where Foxbox is placed (e.g. the one where fundamental servers are placed). The plugin follows the Nagios standards, so it is completely integrated with it as the default ones. Now let's speak about the installation. Firstly you have to place the file you downloaded in /usr/local/nagios/libexec togheter with the others plugin. Then, you have to edit the file /usr/local/nagios/etc/objects/commands.cfg adding these lines: 'check_th' command definition define command{ command_name check_local_th command_line /usr/bin/sudo $USER1$/check_th $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ }
|
And the file /usr/local/nagios/etc/services.cfg adding these: # KDEV TH sensor handling part1 define service{ use local-service host_name localhost service_description Check Temperature check_command check_local_th!0!14!22!10!26 }
# KDEV TH sensor handling part2 define service{ use local-service host_name localhost service_description Check Humidity check_command check_local_th!1!20!40!15!60 }
|
Note that, in order to personalize the behaviour of the plugin, you can modify the thresholds changing the last four numbers in the "check_command" line. Their meaning, from left to right, is: "lower_warning_limit"!"upper_warning_limit"!"lower_critical_limit"!"upper_critical_limit" This means that, with the default values, you will receive an alert if temperature goes under 14°C, or it overcomes the 26°C, or if humidity is over 40%, and so on... Remember that, for additional customizations, you can work on parameters defined in the file templates.cfg. Also this plugin has been developed to let EasyG2 Foxbox handle inputs from USB sensor by Toradex (available here). With this one you will always be able to check the presence of someone in the room where Foxbox is placed (e.g. the one where fundamental servers are placed). The plugin follows the Nagios standards, so it is completely integrated with it as the default ones. Now let's speak about the installation. Firstly you have to place the file you downloaded in /usr/local/nagios/libexec togheter with the others plugin. Then, you have to edit the file /usr/local/nagios/etc/objects/commands.cfg adding these lines: # 'check_pres' command definition define command{ command_name check_local_pres command_line /usr/bin/sudo $USER1$/check_pres }
|
And the file /usr/local/nagios/etc/services.cfg adding these: # KDEV Presence sensor handling define service{ use local-service host_name localhost service_description Check Presence check_command check_local_pres max_check_attempts 2 normal_check_interval 2 retry_check_interval 1 }
|
Note that, in order to personalize the behaviour of the plugin, you can just modify the parameters shown, because the internal logic of the plugin does not accept additional ones. Please refer to some Nagios guide to correctly change them. With the default values, you will receive an alert if sensors senses a presence (using the algorithm in the plugin) twice in two minutes.
|