[Nagiosplug-help] http_check plugin query

T.K.Thapa tapan.thapa at yahoo.com
Fri Jul 1 07:13:55 CEST 2011


Hello Michael,

Thanks for your help.

Nagios is able to monitor my url however if i change the response message in my url then nagios do not generate any warning or error.

My settings are as per your suggestion.

Command:
define command{
        command_name    check_http2
        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
        }

Service:
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       jvnag
        service_description             [INDIA] MMPPlus Sync URL Check
        is_volatile                             0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval   5
        retry_check_interval    1
        contact_groups                  mvas-admins,india-support,mma-PM
        notification_interval   20
        notification_period             24x7
        notification_options    w,u,c,r,f
        check_command                   check_http2!172.22.65.51!'-u /MMPPlus/RequestReceiverServlet?mobileNo=919200000000&moid=0000&operator=TATA&circle=DELHI&content=TAPAN&shortCode=542428 -w 3 -c 5 -r ^TAPAN$ -t 7'
        register                        1
        }

Current message which should be checked by above service is TAPAN however response which is coming from url is TAPAN_1. It should thorough some error or waring in nagios.

If i am firing below mentioned command in command line then it is working as expected.

Command:
./check_http -H 172.22.65.51 -p 80 -u "/MMPPlus/RequestReceiverServlet?mobileNo=919200000000&moid=0000&operator=TATA&circle=DELHI&content=TAPAN&shortCode=542428" -w 3 -c 5 -r ^TAPAN$ -t 7
Response:
HTTP CRITICAL - pattern not found|time=0.072334s;3.000000;5.000000;0.000000 size=174B;;;0

Why it is not working in nagios, i have no idea. Please suggest.

Regards
Tapan Thapa

--- On Thu, 30/6/11, Michael Saldivar <mike.saldivar at advocatecreditrepair.com> wrote:

From: Michael Saldivar <mike.saldivar at advocatecreditrepair.com>
Subject: Re: [Nagiosplug-help] http_check plugin query
To: "Nagios Plugin Help List" <nagiosplug-help at lists.sourceforge.net>
Date: Thursday, 30 June, 2011, 8:38 PM



On Thu, Jun 30, 2011 at 12:50 AM, T.K.Thapa <tapan.thapa at yahoo.com> wrote:
Query:
./check_http -H 172.22.65.51 -p 80 -u "/MMPPlus/RequestReceiverServlet?mobileNo=919200000000&moid=0000&operator=TATA&circle=DELHI&content=TAPAN&shortCode=542428" -w 3 -c 5 -s TAPAN -t 7


Response:
HTTP OK HTTP/1.1 200 OK - 0.015 second response time |time=0.014855s;3.000000;5.000000;0.000000 size=172B;;;0

Now i am not able to figure it out, how to configure this in nagios configuration files.


When i am putting -u with parameters, it is not accepted by nagios.


It would be helpful if you included your config files, so we could point out the difference.


Below are what my config files are, modified to do what I think you are trying to do:

This is the standard check_http command in /usr/local/nagios/etc/objects/commands.cfg :

# 'check_http' command definition

define command{
        command_name    check_http
        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
        }

the -I checks by IP, and $ARG1$ accepts everything after the second ! as an argument.  So this is what the config check would be:


YourHostNameHere.cfg:

define service{
        use                     generic-service
        host_name               YourHostNameHere
        service_description     YourNameForThisSiteHere
        check_command           check_http!172.22.65.51!'-u /MMPPlus/RequestReceiverServlet?mobileNo=919200000000&moid=0000&operator=TATA&circle=DELHI&content=TAPAN&shortCode=542428 -w 3 -c 5 -s TAPAN -t 7'

        }


-Mike


-----Inline Attachment Follows-----

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
-----Inline Attachment Follows-----

_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20110701/043af79a/attachment.html>


More information about the Help mailing list