can log show actual command executed?

Ray Kiddy ray at ganymede.org
Wed Nov 17 18:42:59 CET 2010


I am having a problem figuring out see what is actually being executed from a service. Is there a way to get the nagios log to contain the actual command being executed?

This is what I am seeing in the Nagios.log file:

	[1290013792] SERVICE ALERT: myhost.com;Special App;CRITICAL;SOFT;1;(Service Check Timed Out)

This is what I see in the nagios.dat file:

	check_command=check_http!/myURL!alive
 
So, this shows me what the command string is in the service.cfg. I cannot see, though, what the actual command line is at this moment in time. It turns out that this check_command corresponds (I think) to:

	check_http -u /myURL -s alive

How would I know this, though, if the command definition had been changed or if it is using, because of a mis-spelling, a command I do not think it is using? If I go into the command.cfg and switch the order of parameters, for example, I see nothing in these logs that tells me what is doing what.

I know the simplest answer is "You should not do that." But my point is that the log file does not have enough information to tell me what happened at a past moment of time. I would need the log information _and_ the state of the command definitions at that time. If a log does not show you what happened in the past, what is its purpose?

I am having a problem with a particular web application. For some reason I put in the check and it fails. I execute the check_http that I _think_ this service is doing, and it gives me an OK. I ended up creating a custom executable that calls curl and fetches against the same URL and this now works fine. Kind of lame, though. I use check_http in about 100 other services. So, why is this one single service not working? An obvious answer is that I am not calling the command in the way I think I am. But if I look in the log to see what the service did, I can see what I _think_ it did based on what I can see in what I _think_ is the correct command definition. But I really do not know. I do not see a line like "check_http -u /myURL -s alive" in the log, so, I cannot see if I am mis-reading thi
 ngs.

Any suggestions?

- ray


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list