[Nagiosplug-devel] Passing arguments to a servce?

Jos Visser josv at osp.nl
Tue Oct 5 07:17:29 CEST 2004


Well, there is the templating system:

define service {
	name sybase-generic
	bla bla
	bla bla
	register 0
}

define service {
	use sybase-generic
	host_name server1
	check_command sybase-check!arg1!arg2
}

define service {
	use sybase-generic
	host_name server1,server2
	check_command sybase-check!arg3!arg4
}

and so forth...

I use it extensively and it works great!

++Jos.es

On Tue, Oct 05, 2004 at 02:58:21PM +0200 it came to pass that nodata wrote:
> Thanks for this.
> 
> I think I'm going to end up with a lot of similar services :)
> 
> It would be nice if a service could inherit or "use" another service.
> That way there would be no repetition.
> 
> >
> > You can put on 'checkcommands.cfg' file anything you want.. you can
> > create multiple fixed checkcommands like:
> >
> > # 'check_your_check01' command definition
> > define command{
> >         command_name    check_your_check01
> >         command_line    $USER1$/check_your_check $HOSTADDRESS$ USER PASS
> > DBSVR DBNAME
> >         }
> >
> > this frist dont have $ARGx$ only fixed parameters
> > OR you can do this.. (mix)
> >
> > # 'check_your_check02' command definition
> > define command{
> >         command_name    check_your_check02
> >         command_line    $USER1$/check_your_check $HOSTADDRESS$ USER PASS
> > $ARG1$ DBSVR DBNAME
> >         }
> >
> > # 'check_your_check03' command definition
> > define command{
> >         command_name    check_your_check03
> >         command_line    $USER1$/check_your_check 192.168.0.1 USER PASS
> > DBSVR DBNAME
> >         }
> >
> > you must put in services the name in command_name like:
> >
> >
> > # Service definition
> > define service{
> >         use                             generic-service         ; Name of
> > service template to use
> >
> >         host_name                       MY-SERVER
> >         service_description             CHECK_YOUR_CHECK01
> >         is_volatile                     0
> >         check_period                    24x7
> >         max_check_attempts              3
> >         normal_check_interval           10
> >         retry_check_interval            1
> >         contact_groups                  LOCAL-admins
> >         notification_interval           20
> >         notification_period             24x7
> >         notification_options            c,r
> >         check_command
> > check_your_check!USER!PASS!DBSVR!DBNAME
> >         }
> >
> > OR
> > fixed:
> >
> > # Service definition
> > define service{
> >         use                             generic-service         ; Name of
> > service template to use
> >
> >         host_name                       MY-SERVER
> >         service_description             CHECK_YOUR_CHECK03
> >         is_volatile                     0
> >         check_period                    24x7
> >         max_check_attempts              3
> >         normal_check_interval           10
> >         retry_check_interval            1
> >         contact_groups                  LOCAL-admins
> >         notification_interval           20
> >         notification_period             24x7
> >         notification_options            c,r
> >         check_command                   check_your_check03!
> >         }
> >
> >
> >
> >
> >
> >
> >
> > "nodata" <nagios at nodata.co.uk>@lists.sourceforge.net em 05/10/2004
> > 07:30:39
> >
> > Enviado Por:      nagiosplug-devel-admin at lists.sourceforge.net
> >
> >
> > Para:  nagiosplug-devel at lists.sourceforge.net
> > cc:
> >
> > Assunto:    [Nagiosplug-devel] Passing arguments to a servce?
> >
> > How can I pass an argument to a service?
> >
> > I have many hosts, each running multiple Sybase databases.
> > I have a plugin that checks whether the Sybase database is up.
> >
> > The plugin requires four arguments to connect:
> >  * user
> >  * pass
> >  * dbsvr (note that this is not the hostname)
> >  * dbname
> >
> > My question is: Because I cannot use the $HOSTNAME$ macro to make a
> > generic SYBASE-Server service, how can I still have a generic
> > SYBASE-Server service, with custom arguments passed to its check_command?
> >
> > Your help would really be appreciated.
> >
> > Thanks
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> > Use IT products in your business? Tell us what you think of them. Give us
> > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
> > more
> > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > _______________________________________________
> > Nagiosplug-devel mailing list
> > Nagiosplug-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> > ::: Please include plugins 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: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Nagiosplug-devel mailing list
> Nagiosplug-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

-- 
The truth told with evil intent is worse than all the lies we can 
invent.
-- William Blake





More information about the Devel mailing list