Hi, I am in the process of migration to PRTG from nagios, we have a lot of custom scripts and i need i need to use in prtg. In nagios when we have an exit 2 the interface show a critical alert but in prtg is System Error. How can i have an alarm that is more than a warning. The biggest problem is that the system error dont store data. Any help will be appreciated!! Thanks
Ssh script exit 2 like nagios
Votes:
0
Best Answer
Votes:
0
No Problem. In theory is the error value 2 defined for not working sensors, i.e. if the script can not run or the target is not available. If you want to have a error because of the given value, you need to return the value with a exitcode 0 or 1 and define channel limits for the error detection.
For example if you want to create an error depending on the value:
The exit code is: echo "1:8000:overloaded"
By default is this only a warning, but you can define Channel Settings limits to interpret the value as error. It is also possible to define lookups but this solution is faster and can be changed individual for each sensor.
6 Replies
Votes:
0
Votes:
0
Hi Michael, thanks for the response but if i put echo "3:somevalue:test" the prtg only show me "Protocol Error: test (code: PE023)" and no value information. I need an alarm like cpu utilization with warning and critical, is possible??? Thanks!
Votes:
0
Hi, an example:
echo "0:100:$service is running." | <-- | OK because of the value 0 , 100 is the value |
---|---|---|
echo "1:404:$service is not running." | <-- | warning because of the value 1 (error code), 404 is the value + message. |
echo "2:500:$service is zombie." | <-- | error because of the value 2 (error code) , 500 is the value + message |
also it is possible to define limits in the sensor to check the value and define a state.
Votes:
0
Hi Michael, sorry for the delay. Im still stuck with this, if i put echo 0:500:test the prtg show me the value 500 and the message test, if i change to 1 i see the warning and the value and message too but if i change for example to 2:1000:test i dont see any data only the message no data and the error: System Error: test (code: PE022). How can i define the state 2 as an alarm and also show me data. This problem is the only thing stopping me for buying this product as I need to consolidate what I have in nagios into PRTG.
Thanks again
Votes:
0
No Problem. In theory is the error value 2 defined for not working sensors, i.e. if the script can not run or the target is not available. If you want to have a error because of the given value, you need to return the value with a exitcode 0 or 1 and define channel limits for the error detection.
For example if you want to create an error depending on the value:
The exit code is: echo "1:8000:overloaded"
By default is this only a warning, but you can define Channel Settings limits to interpret the value as error. It is also possible to define lookups but this solution is faster and can be changed individual for each sensor.
Votes:
0
okkk now i understand!!!! I will try it, thanks for the follow up and the fast response
Add comment