[Nagios-users] monitor windows service with "$"

2009-10-07 Thread DE/HAM Hoppe, Leif
Hi List,

I currently configure the monitoring of some windows services.
Just one service is having some problems.

I looked in the registry for the "real" name of the service. It's like 
"service$DB"
When I now try to check this service, I get the following:

nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190 -p 12489 -v 
SERVICESTATE -l "service$DB"
 service: Not found

It looks like it cuts off everything behind the $.
Anybody have an idea?

Nagios 3.0.6
Plugins 1.4.14
Client: NSClient++ 0.3.6

Best regards from Hamburg
Leif

Leif Hoppe
IT department
System Administrator
_
a. hartrodt (GmbH & Co) KG
Högerdamm 35
20097 Hamburg
Tel.: (+49 40) 23 90 - 170
Fax: (+49 40) 23 90 - 394
Mobile: (+49 172) 166 032 6
E-Mail: leif.ho...@hartrodt.com
Internet: www.hartrodt.com
_



--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] monitor windows service with "$"

2009-10-07 Thread shadih rahman
What happens if you do the following?

/usr/local/nagios/libexec/check_nt -H 10.2.30.190 -p 12489 -v SERVICESTATE
-l "service\$DB"




On Wed, Oct 7, 2009 at 10:03 AM, DE/HAM Hoppe, Leif  wrote:

> Hi List,
>
> I currently configure the monitoring of some windows services.
> Just one service is having some problems.
>
> I looked in the registry for the "real" name of the service. It's like
> "service$DB"
> When I now try to check this service, I get the following:
>
> nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190 -p
> 12489 -v SERVICESTATE -l "service$DB"
>  service: Not found
>
> It looks like it cuts off everything behind the $.
> Anybody have an idea?
>
> Nagios 3.0.6
> Plugins 1.4.14
> Client: NSClient++ 0.3.6
>
> Best regards from Hamburg
> Leif
>
> Leif Hoppe
> IT department
> System Administrator
> _
> a. hartrodt (GmbH & Co) KG
> Högerdamm 35
> 20097 Hamburg
> Tel.: (+49 40) 23 90 - 170
> Fax: (+49 40) 23 90 - 394
> Mobile: (+49 172) 166 032 6
> E-Mail: leif.ho...@hartrodt.com
> Internet: www.hartrodt.com
> _
>
>
>
>
> --
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> ___
> Nagios-users mailing list
> Nagios-users@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
>



-- 
Cordially,
Shadhin Rahman
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] monitor windows service with "$"

2009-10-07 Thread Marc Powell

On Oct 7, 2009, at 9:03 AM, DE/HAM Hoppe, Leif wrote:

> nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190 - 
> p 12489 -v SERVICESTATE -l "service$DB"
> service: Not found
>
> It looks like it cuts off everything behind the $.
> Anybody have an idea?

I expect that the shell is interpreting $DB as a shell variable. Try  
using 'service$DB' or "service\$DB".

$ echo "service$DB"
service

$ echo 'service$DB'
service$DB

$ echo "service\$DB"
service$DB

--
Marc


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] monitor windows service with "$"

2009-10-07 Thread Spook ZA
On Wed, Oct 7, 2009 at 10:03 AM, DE/HAM Hoppe, Leif
 wrote:
>>
>> Hi List,
>>
>> I currently configure the monitoring of some windows services.
>> Just one service is having some problems.
>>
>> I looked in the registry for the "real" name of the service. It's like 
>> "service$DB"
>> When I now try to check this service, I get the following:
>>
>> nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190 -p 12489 
>> -v SERVICESTATE -l "service$DB"
>>  service: Not found
>>
I did an dirty hack / wrapper to get round this problem.

I called it: /usr/lib64/nagios/plugins/msauxdb.sh and used it to check
things like MSSQL$BKUPEXEC
Nagios uses $ to interpret arguments to commands.  So I only pass
BKUPEXEC in and let the wrapper add the MSSQL$
Remember to replace lib64 with lib if you are using a 32bit operating
system or replace it the entire path with the path where your nagios
plugins are installed.


#!/bin/bash
pushd /usr/lib64/nagios/plugins >/dev/null
if [ $# -lt 2 ]; then
  echo Invalid Parameters - use $0 HOSTADDRESS database [... database]
  exit 2
fi
PARAMS=''
DATABASES=`echo $* |cut -f2- -d\ `
for DATABASE in $DATABASES; do
  PARAMS="$PARAMS,MSSQL\$$DATABASE"
done
PARAMS=`echo $PARAMS |sed -e s/^\,//`
OUTPUT=`./check_nt -H $1 -p 12489 -s l3tm3ch3ck -v SERVICESTATE -l $PARAMS`
RETVAL=$?
popd >/dev/null
echo $OUTPUT
exit $RETVAL


If anyone has a better idea I would be interested to know, but as for
now, this works for me.

Regards,
  Andrew.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] monitor windows service with "$"

2009-10-07 Thread Marc Powell

On Oct 7, 2009, at 9:47 AM, Spook ZA wrote:

>>> nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190  
>>> -p 12489 -v SERVICESTATE -l "service$DB"
>>>  service: Not found
>>>
> I did an dirty hack / wrapper to get round this problem.

You didn't need to AFAIK.

> I called it: /usr/lib64/nagios/plugins/msauxdb.sh and used it to check
> things like MSSQL$BKUPEXEC
> Nagios uses $ to interpret arguments to commands.

Note that he's running this from the shell directly. Nagios isn't  
doing anything to it at all; no macro parsing etc... To prevent nagios  
from trying to parse the $ as the start of a macro from within the  
command{} definition, use $$ ('service$$DB' or 'MSSQL$$BKUPEXEC' in  
your case).

--
Marc


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] monitor windows service with "$"

2009-10-07 Thread Justin Pryzby
On Wed, Oct 07, 2009 at 09:39:55AM -0500, Marc Powell wrote:
> > It looks like it cuts off everything behind the $.
> > Anybody have an idea?
> 
> I expect that the shell is interpreting $DB as a shell variable. Try  
> using 'service$DB' or "service\$DB".
Also NRPE requires $ to be spelled $$ to be interpretted literally.

Justin

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] monitor windows service with "$"

2009-10-08 Thread DE/HAM Hoppe, Leif
\$DB works for me in the shell.

When I try to check "service$$DB" in nagios now, I get: "Status Information: 
service: Not found"
So he ignores everything after and including the $.

Idea?

-Original Message-
From: Marc Powell [mailto:m...@ena.com]
Sent: Mittwoch, 7. Oktober 2009 17:04
To: Nagios Users
Subject: Re: [Nagios-users] monitor windows service with "$"


On Oct 7, 2009, at 9:47 AM, Spook ZA wrote:

>>> nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190
>>> -p 12489 -v SERVICESTATE -l "service$DB"
>>>  service: Not found
>>>
> I did an dirty hack / wrapper to get round this problem.

You didn't need to AFAIK.

> I called it: /usr/lib64/nagios/plugins/msauxdb.sh and used it to check
> things like MSSQL$BKUPEXEC
> Nagios uses $ to interpret arguments to commands.

Note that he's running this from the shell directly. Nagios isn't
doing anything to it at all; no macro parsing etc... To prevent nagios
from trying to parse the $ as the start of a macro from within the
command{} definition, use $$ ('service$$DB' or 'MSSQL$$BKUPEXEC' in
your case).

--
Marc


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] monitor windows service with "$"

2009-10-08 Thread DE/HAM Hoppe, Leif
Ok, I got the solution, just the ' was missing.

Now it looks like:
 check_nt!SERVICESTATE! -l 'service$$DB'
and works :)

Thanks to all.

-Original Message-
From: DE/HAM Hoppe, Leif [mailto:leif.ho...@hartrodt.com]
Sent: Donnerstag, 8. Oktober 2009 10:34
To: Nagios Users
Subject: Re: [Nagios-users] monitor windows service with "$"

\$DB works for me in the shell.

When I try to check "service$$DB" in nagios now, I get: "Status Information: 
service: Not found"
So he ignores everything after and including the $.

Idea?

-Original Message-
From: Marc Powell [mailto:m...@ena.com]
Sent: Mittwoch, 7. Oktober 2009 17:04
To: Nagios Users
Subject: Re: [Nagios-users] monitor windows service with "$"


On Oct 7, 2009, at 9:47 AM, Spook ZA wrote:

>>> nag...@nagios:~> /usr/local/nagios/libexec/check_nt -H 10.2.30.190
>>> -p 12489 -v SERVICESTATE -l "service$DB"
>>>  service: Not found
>>>
> I did an dirty hack / wrapper to get round this problem.

You didn't need to AFAIK.

> I called it: /usr/lib64/nagios/plugins/msauxdb.sh and used it to check
> things like MSSQL$BKUPEXEC
> Nagios uses $ to interpret arguments to commands.

Note that he's running this from the shell directly. Nagios isn't
doing anything to it at all; no macro parsing etc... To prevent nagios
from trying to parse the $ as the start of a macro from within the
command{} definition, use $$ ('service$$DB' or 'MSSQL$$BKUPEXEC' in
your case).

--
Marc


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Nagios-users mailing list
Nagios-users@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