I have a custom script that I've defined within my nagios command.cfg and service definitions. When run locally as nagios on the monitoring host, it returns the expected output (a large hash of stats from a redis instance):

[nagios@mon1 scripts]$ /etc/nagios/application-nagios/scripts/check_dataquality.rb -w 10 -c 25 -h redis01
Critical: {"DATA.table1":{"ok":135628,"in_progress":2,"failed":0,"warn":0,"started":135630},"DATA.table2.237-2016-04-24":{"ok":26,"in_progress":1,"failed":0,"warn":0,"started":27},"PROCESS.table2":{"ok":6062,"in_progress":118,"failed":0,"warn":0,"started":6180},"PROCESS.table4":{"ok":2868,"in_progress":-10945,"failed":12361,"warn":0,"started":4284},"PROCESS.table5.application/octet-stream":{"ok":6062,"in_progress":118,"failed":0,"warn":0,"started":6180},"PROCESS.table6":{"ok":57,"in_progress":-3782,"failed":0,"warn":13778,"started":10053},"PROCESS.table7":{"ok":1512,"in_progress":0,"failed":2,"warn":0,"started":1514},"PROCESS.table8":{"ok":61,"in_progress":-128,"failed":3,"warn":571,"started":507},"PROCESS.table9":{"ok":82,"in_progress":3,"failed":0,"warn":0,"started":85}}

But within my Thruk UI and logs, it returns (null):

null returned from UI

logging shows the same thing:

[1461791704] SERVICE ALERT: Blue Team;dataquality-services;WARNING;HARD;5;(null)

I'm not sure if this is a limitation of the service command output, or some illegal characters here. Any ideas as to why this service command ret

  • possibly SELinux... – alexus Apr 27 '16 at 21:50
  • Did you return an integer error code after the text response? Also try CRITICAL - instead of Critical: . I always use digitalocean.com/community/tutorials/… for reference, it works the same in every language. – Some Linux Nerd Apr 27 '16 at 21:52
  • Also if it doesn't respond in a second or two it's taking too long. – Some Linux Nerd Apr 27 '16 at 21:52
  • Also if it helps you can run check_nrpe with the arguments from your server's commands.cfg manually – Some Linux Nerd Apr 27 '16 at 21:59
  • checked the exit status, returns as expected (this was a crit response): [nagios@mon1 ~]$ echo $? 2 The check is only scheduled to run once per hour, but in testing the check takes on average 12 seconds to complete since it's parsing through a lot of data. Is there a default break timer this is hitting, or can I tune this to be more tolerant of a long running check like this one? – Ethan Shrago Apr 27 '16 at 22:54

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.