Service checks

Hari Sekhon hpsekhon at googlemail.com
Fri Nov 2 17:16:50 CET 2007


Yes I know what you've been doing, double or triple templating, and what 
I am saying is that you do not need to template for every service.

Only template the common bits and put the unique bits in the service 
definition block with the hostname.

You will need less blocks and have less redundancy in your configuration.

Templates are only supposed to save you typing in the same lines again 
multiple times, not to become your religion for every check. You are 
writing more than you need for such basic stuff.

-h

Hari Sekhon



Jerad Riggin wrote:
> I think we're losing something in translation of me trying to tell you 
> what i'm doing.  Here is what i've been doing.
>
> define service{
>         use                             basic-service
>         name                            check-site4
>         notification_options            w,u,c,r
>         check_command                   check_http!site.com!20!"Home"
>        register                        0
>         }
>
> and then later on in the config file
>
>
> define service{
>     use                check-site4
>     service_description        HTTP
>     contact_groups            mis
>     host_name            site.com <http://site.com>
> }
>
>
> On 11/2/07, *Hari Sekhon* <hpsekhon at googlemail.com 
> <mailto:hpsekhon at googlemail.com>> wrote:
>
>     If you had read the docs like I said, I can't see how you could
>     miss the
>     fact that you have a service definition without a host_name or
>     hostgroup_name!
>
>     Where is this service check going to run against if you haven't
>     told it
>     which host you want to test?
>
>     I even gave you the anchored link to the exact place where it
>     shows you
>     the definitions that are needed for that block...
>
>     -h
>
>     Hari Sekhon
>
>
>
>     Jerad Riggin wrote:
>     > Ok, so for example
>     >
>     > define service{
>     >         use                             basic-service
>     >         notification_options       w,u,c,r
>     >         check_command         check_http!site.com!20!"Home"
>     >         Service description      CheckString
>     >         }
>     >
>     > Sorry if this seems like a newbie question.  I'm just trying to
>     > backtrack and optimize the config before I get too far down the
>     road.
>     >
>     >
>     > 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:
>     >
>     >     also, you are making it more trouble than it needs to be,
>     instead of
>     >     trying to do register 0 and making the last block a template
>     >     block, just
>     >     put the host name in there and the service description as I
>     hinted and
>     >     that is all you need, you will then have the first 2 blocks plus
>     >     one for
>     >     each service on each host with different string checks...
>     >
>     >     -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>>
>     >     > <mailto: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
>     <http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#service>
>     >    
>     <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>>
>     >     >     <mailto: 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





More information about the Users mailing list