How to reschedule multiple/all services at once

Jake Xu jake at demonware.net
Tue Jan 10 21:14:40 CET 2012


Just attached Andreas' response from another thread.

@Dan, I've taken a look at Multisite. It seems to have some crazy batch
commands/comments which are exactly what I am looking for. I tried it a bit
but ended up getting segfault from apache when I accessed the webpage
localhost/check_mk/. It's probably because I have too many sites running on
my test box. Will try again later. Thanks for the recommendation.

@Michael, Icinga would be good if I started from sratch. It is pain for me
to migrate everything to Icinga though because the default file structure
is different and the web ui is not as straightforward as Nagios core.
Thanks for showing me the OMD, didn't aware of it at all.

@Andreas, I am defining "large number of hosts" as >= one thousand, and
each host is likely to have +/- 10 services, so you get the idea :) I agree
with you that Thruk doesn't look as good as others, so I am looking into
Check_MK Multisite as it has some pretty useful
commands/shortcuts/features. I don't use the report feature that much, so
Multisite should be good enough.  Yeah, hacking the cgi is really
undesirable. I will just try to adapt anohter UI like Multisite.


Thanks for all the response!

Jake

On Tue, Jan 10, 2012 at 1:18 AM, Andreas Ericsson <ae at op5.se> wrote:

> On 01/09/2012 08:53 PM, Jake Xu wrote:
> > Hi everyone,
> >
> >> From time to time, I need to restart or reschedule all services to
> verify
> > that some new checks or new hosts are working properly. Is there any easy
> > way to do that? I have a large number of hosts and services, so it would
> be
> > tedious to click through a bunch of links via the web interface. Using
> > external command is not very feasible as well because I would have to
> have
> > all host names and service names for the command line commands.
> >
> > I have seen a pretty good idea on Icinga, a Nagios fork, for this
> purpose.
> > It has a checkbox associated with each service check and a select-all
> > checkbox to select all checkboxes. It would be useful to have that on the
> > Nagios Core, but AFAIK there isn't any.
> >
>
> Pretty much all other UI's but the basic one has this capability.
> Speedwise,
> I'd imagine Thruk and Multisite would suit you very well. It sort of
> depends
> on how you define "large number of hosts and services" though. Most UI's
> scale just fine to a couple of thousand hosts, although certain parts of it
> might suck donkey balls with huge networks. Multisite suffers when creating
> reports, for example, but is crazy fast at showing current status. Thruk is
> faster at both (last time I checked), but it's, imo, pretty ugly (sorry
> Sven)
> and lacks a bunch of boss-bling type features that other UI's have.
>
>
YMMV.
>
> As for adding that capability to the "default" ui; That's not going to
> happen
> unless someone provides a patch for it. None of the maintainers have any
> interest in adding features to the cgi, so they're there simply as a
> fallback
> and will most likely be removed some time in the future in favour of a ui
> written in some more easily hackable language.
>
> --
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Tel: +46 8-230225                  Fax: +46 8-230231
>
> Considering the successes of the wars on alcohol, poverty, drugs and
> terror, I think we should give some serious thought to declaring war
> on peace.
>


On Mon, Jan 9, 2012 at 1:17 PM, <andrew.ford at wellsfargo.com> wrote:

> I usually combine the classic external command scripts with a smidge of
> perl to grab the members of the hostgroup that I want to trigger something
> for.****
>
> ** **
>
> If you give the following script a hostgroup name, it will grab the
> members from objects.cache:****
>
> ** **
>
> #!/usr/local/nagios/bin/perl****
>
> use warnings;****
>
> use strict;****
>
> ** **
>
> my $hostgroup = $ARGV[0];****
>
> # here’s the spot where I should be checking that $hostgroup is defined…**
> **
>
> open my $objects,'<','/usr/local/nagios/var/objects.cache' or die "Failure
> opening objects file: $!\n";****
>
> $/ = '}';****
>
> while (<$objects>) {****
>
>     if (/hostgroup_name\s+($hostgroup)/gs) {****
>
>         /members\s+(\S+)/gs;****
>
>         my $members = $1;****
>
>         my @members = split /,/,$members;****
>
>         for my $member (@members) {****
>
>             print "$member\n";****
>
>         }****
>
>     }****
>
> }****
>
> close $objects;****
>
> ** **
>
> When you run that you get a list that you can feed to your external
> command script.****
>
> Here’s the idea in shell on the command line:****
>
> ** **
>
> bash# for x in `get_hostgroup_members big_switches`;do
> trigger_service_script $x;done ****
>
> **
>



> **
>
> ** **
>
> Andy Ford****
>
> Network Security Engineer | Solutions Design & Automation| Information
> Security Technology****
>
> 314-348-4937****
>
> andrew.ford at wellsfargo.com****
>
> ** **
>
> *From:* Michael Friedrich [mailto:michael.friedrich at univie.ac.at]
> *Sent:* Monday, January 09, 2012 2:54 PM
> *To:* nagios-users at lists.sourceforge.net
> *Subject:* Re: [Nagios-users] How to reschedule multiple/all services at
> once****
>
> ** **
>
> On 09.01.2012 20:53, Jake Xu wrote: ****
>
> Hi everyone, ****
>
> ** **
>
> From time to time, I need to restart or reschedule all services to verify
> that some new checks or new hosts are working properly. Is there any easy
> way to do that? I have a large number of hosts and services, so it would be
> tedious to click through a bunch of links via the web interface. Using
> external command is not very feasible as well because I would have to have
> all host names and service names for the command line commands.****
>
> ** **
>
> I have seen a pretty good idea on Icinga, a Nagios fork, for this purpose.
> It has a checkbox associated with each service check and a select-all
> checkbox to select all checkboxes. ****
>
>
> hehe. you just made ricardo and rune proud :-))
>
>
> ****
>
> It would be useful to have that on the Nagios Core, but AFAIK there isn't
> any.****
>
>
>
> for the problem itsself - try OMD. nagios, icinga, shinken as core
> available whilst the gui decision is up to you.
>
> http://omdistro.org
>
>
> ****
>
> ** **
>
> Thanks in advance,****
>
> Jake****
>
> ** **
>
> ** **
>
> ------------------------------------------------------------------------------****
>
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex****
>
> infrastructure or vast IT resources to deliver seamless, secure access to****
>
> virtual desktops. With this all-in-one solution, easily deploy virtual ****
>
> desktops for less than the cost of PCs and save 60% on VDI infrastructure ****
>
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox****
>
> ** **
>
> ** **
>
> _______________________________________________****
>
> 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****
>
>
>
>
> ****
>
> -- ****
>
> DI (FH) Michael Friedrich****
>
> ** **
>
> Vienna University Computer Center****
>
> Universitaetsstrasse 7 A-1010 Vienna, Austria****
>
> ** **
>
> email:     michael.friedrich at univie.ac.at****
>
> phone:     +43 1 4277 14359****
>
> mobile:    +43 664 60277 14359****
>
> fax:       +43 1 4277 14338****
>
> web:       http://www.univie.ac.at/zid****
>
>            http://www.aco.net****
>
> ** **
>
> Lead Icinga Core Developer****
>
> http://www.icinga.org****
>
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120110/84b5c6fa/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
-------------- next part --------------
_______________________________________________
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