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:<br>
<br>#!/bin/sh<br>echo "sunday            $1"<br>echo "monday            $1"<br>echo "tuesday           $1"<br>echo "wednesday $1"<br>echo "thursday  $1"<br>echo "friday            $1"<br>
echo "saturday  $1"<br><br>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.<br>
<br><div class="gmail_quote">On Sun, Jan 24, 2010 at 7:41 PM, Justin Pryzby <span dir="ltr"><<a href="mailto:justinp@norchemlab.com">justinp@norchemlab.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is there a shorter way of expressing this?  We have several cases<br>
where we need this, with different intervals.  I was hoping there was<br>
a way of writing it in fewer than 10 lines each.<br>
<br>
define timeperiod {<br>
        sunday          04:00-21:00<br>
        monday          04:00-21:00<br>
        tuesday         04:00-21:00<br>
        wednesday       04:00-21:00<br>
        thursday        04:00-21:00<br>
        friday          04:00-21:00<br>
        saturday        04:00-21:00<br>
}<br>
<br>
Thanks,<br>
Justin<br>
<br>
------------------------------------------------------------------------------<br>
Throughout its 18-year history, RSA Conference consistently attracts the<br>
world's best and brightest in the field, creating opportunities for Conference<br>
attendees to learn about information security's most important issues through<br>
interactions with peers, luminaries and emerging and established companies.<br>
<a href="http://p.sf.net/sfu/rsaconf-dev2dev" target="_blank">http://p.sf.net/sfu/rsaconf-dev2dev</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br><br clear="all"><br>-- <br>Martin Melin<br>____________________________<br>op5 AB<br><a href="http://www.op5.com">http://www.op5.com</a><br><br><a href="http://www.op5.org/">http://www.op5.org/</a><br>
<a href="http://www.op5.com/op5/products/network-monitor/nagios/">http://www.op5.com/op5/products/network-monitor/nagios/</a> <br>