can log show actual command executed?

Kaiwang Chen kaiwang.chen at gmail.com
Fri Nov 19 16:32:51 CET 2010


enable debug log in nagios.cfg:

# DEBUG LEVEL
# This option determines how much (if any) debugging information will
# be written to the debug file.  OR values together to log multiple
# types of information.
# Values:
#          -1 = Everything
#          0 = Nothing
#          1 = Functions
#          2 = Configuration
#          4 = Process information
#          8 = Scheduled events
#          16 = Host/service checks
#          32 = Notifications
#          64 = Event broker
#          128 = External commands
#          256 = Commands
#          512 = Scheduled downtime
#          1024 = Comments
#          2048 = Macros

debug_level=-1



# DEBUG VERBOSITY
# This option determines how verbose the debug log out will be.
# Values: 0 = Brief output
#         1 = More detailed
#         2 = Very detailed

debug_verbosity=2



# DEBUG FILE
# This option determines where Nagios should write debugging information.

debug_file=/var/nagios.debug


Then you will get the most verbose internal states. I experienced a
typo of 172 to 127, and found it with the help of debug log. If you
are lucky, do serveral search of check_http will locate the problem.

Thanks,
kc

2010/11/18 Ray Kiddy <ray at ganymede.org>:
>
> 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 things.
>
> 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
>

------------------------------------------------------------------------------
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