nagios check_sip plugin

Robert McNaught asteriskator at gmail.com
Wed Sep 10 00:04:32 CEST 2008


I'm getting it working OK when I su to nagios and run the command from the CLI:

[nagios at lab01 libexec]$ ./check_sip -u sip:username at hostname.com
SIP/2.0 200 OK, 0.016589 seconds response
time|rtt=0.016589s;0.5s;1s;0:10; code=200

I can watch the SIP server and see the Options message coming in and
the OK going back out.


My command definition based on the above command in nagios is:

define command{
       command_name    check_sip
       command_line    $USER1$/check_sip -u $ARG1$
}

My service definition is:

define service{
       use                             core-template
       host_name                       hostname.com
       service_description             SIP test
       check_command                   check_sip!sip:username at hostname.com
#        contact_groups                  voip-admins
      max_check_attempts              4
       normal_check_interval           5
       retry_check_interval            1
       notification_interval           240
       check_period                    24x7
       notification_period             24x7
       notification_options            c,r
}


When I run the nagios config check utility, I get no errors.  I never
see any messages coming in on the SIP server when the check is done.

Its like it is not trying to run the check_sip script.

I am worried that this is wrong as I am not sure how the syntax works:

       check_command                   check_sip!sip:username at hostname.com



Anyone seen this before?

TIA

Robert

On Tue, Sep 9, 2008 at 2:39 PM, Robert McNaught <asteriskator at gmail.com> wrote:
> On Tue, Sep 9, 2008 at 2:38 PM, Robert McNaught <asteriskator at gmail.com> wrote:
>> I'm getting it working OK when I su to nagios and run the command from the CLI:
>>
>> [nagios at lab01 libexec]$ ./check_sip -u sip:username at hostname.com
>> SIP/2.0 200 OK, 0.016589 seconds response
>> time|rtt=0.016589s;0.5s;1s;0:10; code=200
>>
>> I can watch the SIP server and see the Options message coming in and
>> the OK going back out.
>>
>>
>> My command definition based on the above command in nagios is:
>>
>> define command{
>>        command_name    check_sip
>>        command_line    $USER1$/check_sip -u $ARG1$
>> }
>>
>> My service definition is:
>>
>> define service{
>>        use                             core-template
>>        host_name                       hostname.com
>>        service_description             SIP test
>>        check_command                   check_sip!sip:username at hostname.com
>> #        contact_groups                  voip-admins
>>       max_check_attempts              4
>>        normal_check_interval           5
>>        retry_check_interval            1
>>        notification_interval           240
>>        check_period                    24x7
>>        notification_period             24x7
>>        notification_options            c,r
>> }
>>
>>
>> When I run the nagios config check utility, I get no errors.  I never
>> see any messages coming in on the SIP server when the check is done.
>>
>> Its like it is not trying to run the check_sip script.
>>
>> I am worried that this is wrong as I am not sure how the syntax works:
>>
>>        check_command                   check_sip!sip:username at hostname.com
>>
>>
>>
>> Anyone seen this before?
>>
>> TIA
>>
>> Robert
>>
>>
>>
>>
>>
>>
>> On Tue, Sep 9, 2008 at 2:16 PM, Marc Powell <marc at ena.com> wrote:
>>>
>>> On Sep 9, 2008, at 4:07 PM, Robert McNaught wrote:
>>>
>>>> Does  anyone have a working example of the check_sip plugin working,
>>>> if so could they post the command definition and the service
>>>> definition?
>>>
>>> I don't, but can say that nagios doesn't run plugins as root as you
>>> did below. The difference in permissions is frequently a cause of
>>> failures. Try running the plugin as the nagios user to see if you see
>>> more useful output.
>>>
>>>> On Mon, Sep 8, 2008 at 3:43 PM, Robert McNaught <asteriskator at gmail.com
>>>> > wrote:
>>>>> Hi, I am using Nagios 3 on CentOS 5.
>>>>>
>>>>> I am not understanding how to set up a service check for SIP (Session
>>>>> Initiation Protocol).
>>>>>
>>>>> I can run the check_sip perl script from the command line and get a
>>>>> valid response, but cannot get it to work under nagios.
>>>>>
>>>>> [root at lab01 libexec]# /usr/local/nagios/libexec/check_sip -u
>>>>> sip:username at server.hostname.com -f sip:username at server.hostname.com
>>>>> -H server.hostname.com
>>>>> SIP/2.0 200 OK, 0.017372 seconds response
>>>>> time|rtt=0.017372s;0.5s;1s;0:10; code=200
>>>
>>> --
>>> Marc
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> 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
>>>
>>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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