Service checks
Hari Sekhon
hpsekhon at googlemail.com
Mon Nov 5 10:37:32 CET 2007
You are correct, you can actually do this with a regex, I completely
forgot about this option. Thanks for reminding me.
If you are skilled with regex you can do this, although I think that the
OP was looking for a way around having one service definition for
all 4 web sites, and for this, I would think that separate service
definitions are a little nicer than trying to put a square peg in a
round hole.
-h
Hari Sekhon
Jeff Chapin wrote:
> I was under the impression that check_http has a regex option, meaning
> you can pass it a regex that ought to be able to handle this.
>
> Jeff
>
>
>
>
> JEFF CHAPIN
> SYSTEM ADMINISTRATOR
> T8DESIGN.COM | P 319.266.7574 - x267 | 877.T8IDEAS | F 888.290.4675
>
>
> This e-mail, including attachments, is covered by the Electronic
> Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and
> may be legally privileged. If you are not the intended recipient, you
> are hereby notified that any retention, dissemination, distribution, or
> copying of this communication is strictly prohibited. Please reply to
> the sender that you have received the message in error, and then please
> delete it. Thank you.
>
> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net
> [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Hari
> Sekhon
> Sent: Friday, November 02, 2007 11:01 AM
> To: Jerad Riggin
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Service checks
>
> I've just tried this, using the standard check_http plugin you are
> using. It appears not.
>
> As soon as one string is not found it goes critical.
>
> You could always write a custom plugin to test your websites, or much
> more easily a shell wrapper plugin to call the first, if it fails, call
> the second, and only if that fails go critical... not perfect though, a
> better/custom plugin would serve you better.
>
> -h
>
> Hari Sekhon
>
>
>
> Jerad Riggin wrote:
>
>> In that case, is there a way to specify more than one possible string,
>>
>
>
>> so that for example if it can't find "Home", but it can find
>> "Checkout", it considers the host up?
>>
>> On 11/2/07, *Hari Sekhon* <hpsekhon at googlemail.com
>> <mailto:hpsekhon at googlemail.com>> wrote:
>>
>> yes you have to use a separate one for each site, how else would
>> you be
>> able to use a separate check? Unless you expect the word "Home" on
>> each
>> site and that is your string check. Another option is using Macros
>> but I
>> suspect this may not do what you want...
>>
>> -h
>>
>> Hari Sekhon
>>
>>
>>
>> Jerad Riggin wrote:
>> > I've read the help docs, like I said I have a working
>>
> installation
>
>> > checking about 15 servers. I have a PING service that pings a
>>
> host
>
>> > group. I can't do that with this because I'm checking a
>>
> different
>
>> > string on each site, so i'm guessing it has to be separated
>> out. Does
>> > this make sense?
>> >
>> > On 11/2/07, *Hari Sekhon* < hpsekhon at googlemail.com
>> <mailto:hpsekhon at googlemail.com>
>> > <mailto:hpsekhon at googlemail.com
>> <mailto:hpsekhon at googlemail.com>>> wrote:
>> >
>> > You need to reread the docs, this is the most basic of
>> questions.
>> >
>> >
>>
> http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#service
>
>> >
>> > Hint: You are missing a service_description in the last
>> block for one.
>> > You should not have name in that last block either, you need
>> > host_name.
>> >
>> > Read docs pls.
>> >
>> > -h
>> >
>> > Hari Sekhon
>> >
>> >
>> >
>> > Jerad Riggin wrote:
>> > > I have a functioning nagios setup but I have a quick
>> question. I am
>> > > going through and adding website string checks so we can
>>
> keep
>
>> > track of
>> > > availability on one of our webservers.
>> > >
>> > > So in services.cfg I have
>> > >
>> > > define service{
>> > > name generic-service ;
>> Generic
>> > > service name
>> > > active_checks_enabled 1 ;
>> Active
>> > > service checks are enabled
>> > > passive_checks_enabled 1 ;
>> Passive
>> > > service checks are enabled/accepted
>> > > parallelize_check 1 ;
>> Active
>> > > service checks should be parallelized (Don't disable)
>> > > obsess_over_service 1 ;
>> We should
>> > > obsess over this service (if necessary)
>> > > check_freshness 0 ;
>> > Default is
>> > > to NOT check service 'freshness'
>> > > notifications_enabled 1 ;
>> Service
>> > > notifications are enabled
>> > > event_handler_enabled 1 ;
>> Service
>> > > event handler is enabled
>> > > flap_detection_enabled 1 ;
>> Flap
>> > > detection is enabled
>> > > process_perf_data 1 ;
>> Process
>> > > performance data
>> > > retain_status_information 1 ;
>> Retain
>> > > status information across program restarts
>> > > retain_nonstatus_information 1 ;
>> Retain
>> > > non-status information across program restarts
>> > > register 0 ;
>> DONT
>> > > REGISTER THIS DEFINITION - NOT A REAL SERVICE, JUST A
>> TEMPLATE!
>> > > }
>> > >
>> > > define service{
>> > > use generic-service
>> > > name basic-service
>> > > is_volatile 0
>> > > check_period 24x7
>> > > max_check_attempts 5
>> > > normal_check_interval 3
>> > > retry_check_interval 1
>> > > notification_interval 15
>> > > notification_period 24x7
>> > > register 0
>> > > }
>> > >
>> > > I then have as just one example:
>> > >
>> > > define service{
>> > > use basic-service
>> > > name check-site4
>> > > notification_options w,u,c,r
>> > > check_command
>> > check_http!site.com!20!"Home"
>> > > register 0
>> > > }
>> > >
>> > >
>> > > My question is, you notice that I have the name as
>> check-site4, and
>> > > then later on in the services.cfg I call up that
>> > checksite-4. Is this
>> > > the correct way? Do I need to define a service for each
>>
> host
>
>> > and then
>> > > later on call it by name to execute the service check? Is
>> this
>> > a bad
>> > > way of going about it?
>> > >
>> > > Thanks,
>> > >
>> > > Jerad
>> > >
>> >
>>
>>
> ------------------------------------------------------------------------
>
>> > >
>> > >
>> >
>>
>>
> ------------------------------------------------------------------------
> -
>
>> >
>> > > This SF.net email is sponsored by: Splunk Inc.
>> > > Still grepping through log files to find problems? Stop.
>> > > Now Search log events and configuration files using AJAX
>>
> and a
>
>> > browser.
>> > > Download your FREE copy of Splunk now >>
>> http://get.splunk.com/ <http://get.splunk.com/>
>> > >
>> >
>>
>>
> ------------------------------------------------------------------------
>
>> > >
>> > > _______________________________________________
>> > > Nagios-users mailing list
>> > > Nagios-users at lists.sourceforge.net
>> <mailto:Nagios-users at lists.sourceforge.net>
>> > <mailto:Nagios-users at lists.sourceforge.net
>> <mailto:Nagios-users at lists.sourceforge.net> >
>> > > https://lists.sourceforge.net/lists/listinfo/nagios-users
>> > < 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: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> 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: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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