python script to parse the logs and alert for a given string as input with a given log file. The script is Configured and it is working fine in identifying critical and warning parsing for the strings in the log file but color code is not working with the alert. it shows the critical alert in green color and not turning to RED.
This way you not only make sure that Icinga is actually allowed to run the plugin when configured as a check, you avoid problems with temporary and log files, too.
Welcome to the wonderful world of Icinga, by the way.
Thx guys got it fixed with the right exit code and able to see the color codes but further developed the script to parse a API which gives NRPE: Unable to read output in the icinga board .
any thoughts here …
wrote a python script to monitor and parse the API out The script is Configured and it is working fine in the command line but on the Icinga board it shows as unknow.?
/usr/lib64/nagios/plugins/mobi/check_log_time.py --process=“POLICY_UPDATES” --logsURL=“http://juing*p1:8020/mobi-platform-rollup-solr-service/solr/monitor/rollup/policy.json” --hours=“4”
OK
root@juing01p1.integration: /etc/nrpe.d# echo $?
0
enabled the NRPE in debug mode and able to see this …
May 22 00:30:15 juing01p1.i nrpe[2736]: Host 10.173.96.206 is asking for command ‘check_solr_asset_updates_arg’ to be run…
May 22 00:30:15 juing01p1. nrpe[2736]: Running command: /usr/lib64/nagios/plugins/mobi/check_log_time.py --process=“solrAssetUpdateJob” --logsURL=“solrAssetUpdateJob” --hours=“solrAssetUpdateJob”
May 22 00:30:15 juing01p1.-nrpe[2737]: WARNING: my_system() seteuid(0): Operation not permitted
May 22 00:30:15 juing01p1.i nrpe[2736]: Command completed with return code 2 and output:
May 22 00:30:15 juing01p1.i nrpe[2736]: Return Code: 3, Output: NRPE: Unable to read output