Re: [Nagios-users] monitoring hundreds of network switches

2009-11-30 Thread Marcel
I don't know about others on this list, but what I do to start a new
configuration:

On Fri, Nov 27, 2009 at 3:47 PM, D G Teed  wrote:

> With the fping command (not check_fping) I can feed it a list of IPs
> to check from a file.  If I ran fping with -a and did a diff between
> that output and my original list of IPs, I'd get a report of which switches
> are
> down.  I could write a shell script to do this and set up a cron in less
> time
> than it would take to do the same in nagios with my current knowledge
> of the configuration options in nagios.  I'm sure someone will be
> up to the challenge of showing me it is just as easy to set up in nagios.
>
> I saw this example:
> http://nagios.sourceforge.net/docs/3_0/monitoring-routers.html
> but I don't get "allhosts, switches" in the hostgroups configuration.
> Is this some sort of keyword or built-in wildcard?
>

I start creating a directory named after the DataCenter or location, maybe:
/opt/nagios/etc/object/Dallas

There I create several files, each containing one host{} directive, without
hostgroups or whatever.

Then, the first service{name ping\n check_command\t
check_icmp\nhostgroup_name all (...)} is applied to a hostgroup
{hostgroup_name all\n alias all CIs\n members .*} (I've turned on the true
regexp matching).

With just these steps you can have all your CI's setup properly.

HTH,
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
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] monitoring hundreds of network switches

2009-11-28 Thread Marc Powell

On Nov 27, 2009, at 10:12 PM, D G Teed wrote:

> 
> 
> On Fri, Nov 27, 2009 at 4:28 PM, Marc Powell  wrote:
>> 
>> Different problem. If you're just wanting to ping them, the only purpose of 
>> the hostgroup would just be to group them for display in the GUI. You do 
>> need them in a hostgroup for that. They should be in a hostgroup anyway 
>> though, it's just better in the long-run.
> 
> As mentioned, a script can generate such config files.  But would they work?  
> Has anyone tried listing 400+ hosts in a hostgroup?

Yes, sure. My largest current hostgroup has 726 members. I have had them listed 
out as members in the hostgroup 'members' line in the past (nagios-1.x) but 
adding them to the hostgroup from the host{} definition is more convenient.

--
Marc



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
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] monitoring hundreds of network switches

2009-11-27 Thread D G Teed
On Fri, Nov 27, 2009 at 4:28 PM, Marc Powell  wrote:

>
> Different problem. If you're just wanting to ping them, the only purpose of
> the hostgroup would just be to group them for display in the GUI. You do
> need them in a hostgroup for that. They should be in a hostgroup anyway
> though, it's just better in the long-run.
>

As mentioned, a script can generate such config files.  But would they
work?  Has anyone tried listing
400+ hosts in a hostgroup?


> You'll first need to create a hostgroup{} definition to contain all the
> switches. -
> http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#hostgroup
>
> define hostgroup{
>hostgroup_name switches
>alias All Your Switches Are Belong To Us
> }
>
> There are at least 3 ways to associate your switches with this hostgroup. I
> purposely avoided using a 'members' directive with a wildcard because you
> may one day monitor more than just these switches... I also didn't list out
> each switch in the members line either. You could do it, but it gets messy
> to manage by hand. A third way, and most flexible, is below.
>
> Next, you'll need to create a host{} definition for each of your switches.
> Your script-fu powers should come in handy here (i.e. a long one-liner awk
> should do it). Besides the usual required parameters, be sure to set the
> 'hostgroups' parameter to 'switches' to include it in the group above --
> http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#host
>
> define host{
>host_name   cool_switch
>alias   Freezer Switch
>address 192.168.1.2
>hostgroups  switches
>check_command   check_fping ;(or whatever it's called)
>check_period24x7 ; (or whatever your schedule is)
>check_interval  5 ; (or whatever your schedule is)
>retry_interval  1 ; (or whatever your schedule is)
>other required parameters   ...
> }
>
>
I'm liking that the hosts don't need to be listed in a hostgroup but can be
configured
as in your example. That is much more workable.

It looks like this will meet our needs nicely and I will be automating the
generation
of the configs for this part of our nagios set up.

Thanks for your help everyone...
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
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] monitoring hundreds of network switches

2009-11-27 Thread Marc Powell

On Nov 27, 2009, at 3:10 PM, Flyinvap wrote:

> Le Fri, 27 Nov 2009 14:28:34 -0600,
> Marc Powell  a écrit :
> 
>> 
>> Next, you'll need to create a host{} definition for each of your
>> switches. Your script-fu powers should come in handy here (i.e. a
> 
> I agree. Use scripts to create config files are finally the best way.
> Keep your scripts, you can use their to modify configs in the future.

++ I've have scripts that automate the monitoring of 99% of our devices that I 
wrote about 9 years ago that have only needed changes as config file changes 
occurred. Our staff just needs to input some basic data about new or changed 
devices into a DB (via web) and it all Just Works. My Nagios time is almost 
entirely limited to figuring out why things are down. =)

> I like to use template.

Of course we make extensive use of templates as well... I didn't want to add 
that complexity to an already long e-mail ;)

--
Marc


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
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] monitoring hundreds of network switches

2009-11-27 Thread Flyinvap
Le Fri, 27 Nov 2009 14:28:34 -0600,
Marc Powell  a écrit :

> 
> Next, you'll need to create a host{} definition for each of your
> switches. Your script-fu powers should come in handy here (i.e. a

I agree. Use scripts to create config files are finally the best way.
Keep your scripts, you can use their to modify configs in the future.

> 
> define host{
>   host_name   cool_switch
>   alias   Freezer Switch
>   address 192.168.1.2
>   hostgroups  switches
>   check_command   check_fping ;(or whatever it's called)
>   check_period24x7 ; (or whatever your schedule is)
>   check_interval  5 ; (or whatever your schedule is)
>   retry_interval  1 ; (or whatever your schedule is)
>   other required parameters   ...
> }

I like to use template.

define host{
nameswitch-template
register0
hostgroups  switches
check_command   check_fping ;(or whatever it's called)
check_period24x7 ; (or whatever your schedule is)
check_interval  5 ; (or whatever your schedule is)
retry_interval  1 ; (or whatever your schedule is)
other required parameters   ...
}

define host{
host_name   cool_switch
alias   Freezer Switch
address 192.168.1.2
use switch-template
}

I you want to change a value for all your switches, you just have to
modify the template. If you just want to modify one switch, you can
overwrite a parameter, you change it in the switch config file. Object
inheritance is useful [1].

For example :

define host{
host_name   other_switch
alias   Another Switch
address 192.168.1.3
use switch-template
retry_interval  3 ; change from template
...
}

[1] http://nagios.sourceforge.net/docs/3_0/objectinheritance.html

-- 
Flyinvap


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
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] monitoring hundreds of network switches

2009-11-27 Thread Marc Powell

On Nov 27, 2009, at 11:47 AM, D G Teed wrote:

> I'm looking for a streamlined method of configuring the check_fping
> test for hundreds of network switches.
> 
> Looking at the examples I see for hosts and hostgroup configuration,
> 
> e.g.: 
> http://sourceforge.net/mailarchive/message.php?msg_name=5caea3690911120551o40031fe3o3994b8fc8b463143%40mail.gmail.com
> 
> I can't see doing it that way, with a list of 400+ IPs in a single hostgroup.
> There must be a better way to do this.

Different problem. If you're just wanting to ping them, the only purpose of the 
hostgroup would just be to group them for display in the GUI. You do need them 
in a hostgroup for that. They should be in a hostgroup anyway though, it's just 
better in the long-run.

> With the fping command (not check_fping) I can feed it a list of IPs
> to check from a file.  If I ran fping with -a and did a diff between
> that output and my original list of IPs, I'd get a report of which switches 
> are
> down.  I could write a shell script to do this and set up a cron in less time
> than it would take to do the same in nagios with my current knowledge
> of the configuration options in nagios.  

fping != nagios in the same way that a bicycle != an 18 wheeler. Each solves 
different problem statements and their complexity relates directly to their 
functionality. fping may be the tool for you if that's all you need or until 
you get familiar with nagios configuration (and develop your workflow). I'm a 
hands-on kind of learner and I personally think you're not going to really 
learn it until you do it though.

> I saw this example:
> http://nagios.sourceforge.net/docs/3_0/monitoring-routers.html
> but I don't get "allhosts, switches" in the hostgroups configuration.
> Is this some sort of keyword or built-in wildcard?

No, they're not keywords, the names are arbitrary but hopefully 
representational. They're real hostgroup{}s with appropriate members (or a 
wildcard member for allhosts presumably) created by you if you like those names.

It should be fairly straightforward for you...

You'll first need to create a hostgroup{} definition to contain all the 
switches. - 
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#hostgroup

define hostgroup{
hostgroup_name switches
alias All Your Switches Are Belong To Us
}

There are at least 3 ways to associate your switches with this hostgroup. I 
purposely avoided using a 'members' directive with a wildcard because you may 
one day monitor more than just these switches... I also didn't list out each 
switch in the members line either. You could do it, but it gets messy to manage 
by hand. A third way, and most flexible, is below.

Next, you'll need to create a host{} definition for each of your switches. Your 
script-fu powers should come in handy here (i.e. a long one-liner awk should do 
it). Besides the usual required parameters, be sure to set the 'hostgroups' 
parameter to 'switches' to include it in the group above -- 
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#host

define host{
host_name   cool_switch
alias   Freezer Switch
address 192.168.1.2
hostgroups  switches
check_command   check_fping ;(or whatever it's called)
check_period24x7 ; (or whatever your schedule is)
check_interval  5 ; (or whatever your schedule is)
retry_interval  1 ; (or whatever your schedule is)
other required parameters   ...
}

Make sure that these directives are put in a cfg_file that nagios reads, verify 
your config (/path/to/nagios -f /path/to/nagios.cfg), fix any problems, start 
nagios and voila. Not as good as home made bread but tasty none-the-less...

--
Marc


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
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] monitoring hundreds of network switches

2009-11-27 Thread D G Teed
I'm looking for a streamlined method of configuring the check_fping
test for hundreds of network switches.

Looking at the examples I see for hosts and hostgroup configuration,

e.g.:
http://sourceforge.net/mailarchive/message.php?msg_name=5caea3690911120551o40031fe3o3994b8fc8b463143%40mail.gmail.com

I can't see doing it that way, with a list of 400+ IPs in a single
hostgroup.
There must be a better way to do this.

With the fping command (not check_fping) I can feed it a list of IPs
to check from a file.  If I ran fping with -a and did a diff between
that output and my original list of IPs, I'd get a report of which switches
are
down.  I could write a shell script to do this and set up a cron in less
time
than it would take to do the same in nagios with my current knowledge
of the configuration options in nagios.  I'm sure someone will be
up to the challenge of showing me it is just as easy to set up in nagios.

I saw this example:
http://nagios.sourceforge.net/docs/3_0/monitoring-routers.html<%20http://nagios.sourceforge.net/docs/3_0/monitoring-routers.html>
but I don't get "allhosts, switches" in the hostgroups configuration.
Is this some sort of keyword or built-in wildcard?
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
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