Re: [Nagios-users] Where can arguments go?

2012-02-21 Thread Jonathan Nilsson
It looks like you are using variables in the wrong location. Those should
go in the command definition. See below for a sample, and hopefully you can
adapt it to your specific needs.


> I'm running into confusion, because I need to specify a
> port number in the host definition, and I can't really see how to do it.
>

I'm going to assume that "check-snmp-switch-alive" is a script that you
have written and that the command from the command-line is:

/usr/local/nagios/libexec/check-snmp-switch-alive  -p 

in the host/service definitions, the check_command separates arguments with
the exclamation symbol "!" like this:


> define host {
>namesnmp-switch ; The name of this host
> template
>use generic-switch
>#check_command  check-host-alive ; Default command to check
> if routers
> are "alive"
>check_command   check-snmp-switch-alive!!
>register0   ; DONT REGISTER THIS - ITS
> JUST A TEMPLATE
> }
>

where  would be the port number and  could be any string of
other options, including "-[a-z]" switches and their arguments. You then
define the command like this:

define command {
  command_name check-snmp-switch-alive
  command_line /usr/local/nagios/libexec/check-snmp-switch-alive
$HOSTNAME$ -p $ARG1$ $ARG2$
}


> Is this a possible / sane thing to do?  Is this the right way to approach
> it, or am I missing a way that actually makes sense?
>

Yes, I would say that this is appropriate for a switch/router. Personally,
I usually don't overwrite the default host check_command since check_ping
is fine, and instead add additional services as needed, such as SNMP checks
to get more info.

Good luck!
--
Jonathan
--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/___
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] Where can arguments go?

2012-02-21 Thread Stuart Browne
Hi,

> -Original Message-
> From: David Dyer-Bennet [mailto:d...@dd-b.net]
> Sent: Wednesday, 22 February 2012 10:42 AM
> To: nagios-users@lists.sourceforge.net
> Subject: [Nagios-users] Where can arguments go?
> 
> I'm looking to use a special check command to verify routers are in
> operation by checking the main link port of the router (instead of the
> default ping).  I'm running into confusion, because I need to specify a
> port number in the host definition, and I can't really see how to do it.
> 
> I use soemthing like this for a template:
> 
> define host {
>   namesnmp-switch ; The name of this host template
>   use generic-switch
>   #check_command  check-host-alive ; Default command to check
> if routers
> are "alive"
>   check_command   check-snmp-switch-alive $HOSTADDRESS$ $ARG1$
> $ARG2$
>   register0   ; DONT REGISTER THIS - ITS JUST 
> A
> TEMPLATE
> }
> 
> I'm not sure the args on the check_command line are legal  And I'm not
> sure that arguments on a "use snmp-switch" line referencing this could
> have arguments on them.

Arguments on the check_command line are perfectly valid, however you aren't 
using them correctly here.

Example time:

check_command   check_tcp!1500

Within a service or host definition, something like this would execute the 
defined command 'check_tcp' and pass it a $ARG1$ value of 1500.  This would be 
used like this:

define command {
command_namecheck_tcp
command_line$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}

This is documented in the Macros section:

http://nagios.sourceforge.net/docs/nagioscore/3/en/macros.html

> Is this a possible / sane thing to do?  Is this the right way to approach
> it, or am I missing a way that actually makes sense?
> 
> 
> --
> David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
> Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
> Photos: http://dd-b.net/photography/gallery/
> Dragaera: http://dragaera.info

Stuart


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
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] Where can arguments go?

2012-02-21 Thread Martin Hugo
David,

You could use something like the check_iftraffic3 plug-in, that would also give 
you bandwidth useage.

Martin T. hugo
Network Administrator
Hilliard City Schools
614-921-7102 (Ph)
614-921-7243 (Fax)



-Original Message-
From: David Dyer-Bennet [mailto:d...@dd-b.net] 
Sent: Tuesday, February 21, 2012 6:42 PM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] Where can arguments go?

I'm looking to use a special check command to verify routers are in
operation by checking the main link port of the router (instead of the
default ping).  I'm running into confusion, because I need to specify a
port number in the host definition, and I can't really see how to do it.

I use soemthing like this for a template:

define host {
namesnmp-switch ; The name of this host template
use generic-switch
#check_command  check-host-alive ; Default command to check if 
routers
are "alive"
check_command   check-snmp-switch-alive $HOSTADDRESS$ $ARG1$ 
$ARG2$
register0   ; DONT REGISTER THIS - ITS JUST 
A TEMPLATE
}

I'm not sure the args on the check_command line are legal  And I'm not
sure that arguments on a "use snmp-switch" line referencing this could
have arguments on them.

Is this a possible / sane thing to do?  Is this the right way to approach
it, or am I missing a way that actually makes sense?


-- 
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
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



--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
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


[Nagios-users] Where can arguments go?

2012-02-21 Thread David Dyer-Bennet
I'm looking to use a special check command to verify routers are in
operation by checking the main link port of the router (instead of the
default ping).  I'm running into confusion, because I need to specify a
port number in the host definition, and I can't really see how to do it.

I use soemthing like this for a template:

define host {
namesnmp-switch ; The name of this host template
use generic-switch
#check_command  check-host-alive ; Default command to check if 
routers
are "alive"
check_command   check-snmp-switch-alive $HOSTADDRESS$ $ARG1$ 
$ARG2$
register0   ; DONT REGISTER THIS - ITS JUST 
A TEMPLATE
}

I'm not sure the args on the check_command line are legal  And I'm not
sure that arguments on a "use snmp-switch" line referencing this could
have arguments on them.

Is this a possible / sane thing to do?  Is this the right way to approach
it, or am I missing a way that actually makes sense?


-- 
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
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] check_openmanage

2012-02-21 Thread Mike Stevens
Tobias Dinse  stegbauer.info> writes:

> 
> Yes, i can run all commands on the local system without errors. Thats 
> why I m confused. I also can execute the check_openmanage Script manual 
> on the local Maschine as Nagios User without problems. I think it must 
> be an Problem between the script output. But why it works on other 
> r710´s with debian squeeze? *confused*

I know this thread is a bit stale, but are you perchance running selinux?  I had
these same symptoms with selinux set to enforcing.  I had to create a couple of
local policies to work around the problem.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
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