Before coding a plugin, we must face some concepts that will be the stepping stone of our Nagios code base, one of these being the return codes of the plugin itself. As we already discussed, once the plugin collects the data about how the service is going, it evaluates these data and determines if the situation falls under one of the following status:
Return code |
Status |
Description |
0 |
OK |
The plugin checked the service and the results that are inside the acceptable range. |
1 |
WARNING |
The plugin checked the service and the results that are above a WARNING threshold. We must keep an eye on the service. |
2 |
CRITICAL |
The plugin checked the service and the results that are above a CRITICAL threshold or the service not responding. We must react now. |
3 |
UNKNOWN |
Either we passed the wrong arguments to the plugin or there is... |