Monitor required operating system restarts

Depending on your environment, you might could have solved update installations using Puppet etc. or an automatic installation. That’s not unusual. And if your services are active-active components you are already able to reboot servers without any problem.

But if you have to reboot your server manually the following poller might be interesting.

Extend your snmpd.confwith the following entry:

extend reboot /bin/bash -c 'if [ -e /var/run/reboot-required ]; then echo "1"; else echo "0"; fi'

:exclamation: If the file /var/run/reboot-required exists, your system needs a restart

Create a corresponding poller definition like this in poller-configuration.xml:

<service name="Reboot-Required" interval="300000" user-defined="true" status="on">
    <parameter key="retry" value="1"/>
    <parameter key="timeout" value="3000"/>
    <parameter key="port" value="161"/>
    <parameter key="oid" value=""/>
    <parameter key="operator" value="&lt;"/>
    <parameter key="operand" value="1"/>
<monitor service="Reboot-Required" class-name="org.opennms.netmgt.poller.monitors.SnmpMonitor“/>

Don’t forget to assign the service Reboot-Required to your nodes!


Depending on your environment size and structure it could be a good idea to create a service detector for this service. One way or the other be careful with these pollers. For the first time you could create a lot of work… :wink:

Have fun!

1 Like