There is no way to avoid having one line per weekday in the config, but that
doesn't mean that you have to write the definitions out by hand :-) A quick
shellscript to echo each weekday with an argument and you should be good to
go. Here you go:
#!/bin/sh
echo "sunday $1"
echo "monday $1"
echo "tuesday $1"
echo "wednesday $1"
echo "thursday $1"
echo "friday $1"
echo "saturday $1"
Add the above to a dir in your path, then when you need to add a timeperiod
definition you can use ":r ! timeperiod.sh 04:00-21:00" in vi, or something
similar in your editor of choice.
On Sun, Jan 24, 2010 at 7:41 PM, Justin Pryzby <[email protected]>wrote:
> Is there a shorter way of expressing this? We have several cases
> where we need this, with different intervals. I was hoping there was
> a way of writing it in fewer than 10 lines each.
>
> define timeperiod {
> sunday 04:00-21:00
> monday 04:00-21:00
> tuesday 04:00-21:00
> wednesday 04:00-21:00
> thursday 04:00-21:00
> friday 04:00-21:00
> saturday 04:00-21:00
> }
>
> Thanks,
> Justin
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> Nagios-users mailing list
> [email protected]
> 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
>
--
Martin Melin
____________________________
op5 AB
http://www.op5.com
http://www.op5.org/
http://www.op5.com/op5/products/network-monitor/nagios/
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Nagios-users mailing list
[email protected]
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