Allow 24x7 email, but restrict winpopup to Business Hours

Steve_J_Alston at ryder.com Steve_J_Alston at ryder.com
Fri Sep 27 15:04:13 CEST 2002


I put both the Machine Name and the I.P. address (seen here as
xxx.xxx.xxx.xxx) in the pager variable.

I wanted to send emails all the time and winpopup only during working
hours.
Here is what I did:


In contacts.cfg:

define contact {
contact_name                   steve_alston_email
alias                          Steve Alston Email
service_notification_period    24x7
host_notification_period       24x7
service_notification_options   u,c,r
host_notification_options      d,u,r
service_notification_commands  notify-by-email
host_notification_commands     host-notify-by-email
email                          steve_alston at ryder.com
}

define contact {
contact_name                   steve_alston_winpopup
alias                          Steve Alston Winpopup
service_notification_period    workhours
host_notification_period       workhours
service_notification_options   u,c,r
host_notification_options      d,u,r
service_notification_commands  notify-by-winpopup
host_notification_commands     host-notify-by-winpopup
email                          steve_alston at ryder.com
pager                          RTECWSSA002 -I xxx.xxx.xxx.xxx
}


In misccommands.cfg:

define command{
    command_name               notify-by-winpopup
    command_line               printf "Service: $SERVICEDESC$\n$HOSTNAME$ \"$HOSTALIAS$\" at IP $HO
STADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$" | smbclient -M $CONTACTPAGER$ -U "Nagios Monitor
ing Station"
}

define command{
    command_name               host-notify-by-winpopup
    command_line               printf "$HOSTNAME$ \"$HOSTALIAS$\" at IP $HOSTADDRESS$ is in a $HOST
STATE$ state.\nThe output from the host check command: $OUTPUT$" | smbclient -M $CONTACTPAGER$ -U "
Nagios Monitoring Station"
}


In timeperiods.cfg:
define timeperiod {
timeperiod_name                workhours
alias                          "Normal" Working Hours
monday                         08:00-17:00
tuesday                        08:00-17:00
wednesday                      08:00-17:00
thursday                       08:00-17:00
friday                         08:00-17:00
}


In contactgroups.cfg:
define contactgroup {
contactgroup_name              pkms
alias                          PkMS
members                        steve_alston_email,steve_alston_winpopup,another_person_winpopup
}


Hope this helps

Steve Alston
--------------------------------------------
Message: 10
Date: Fri, 27 Sep 2002 11:46:23 +0200
From: Freddy Frouin <freddy.frouin at fluxus.net>
To: Greg Vickers <g.vickers at qut.edu.au>
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Allow 24x7 email, but restrict winpopup to
Business Hours
Organization: Fluxus

just look the contacts defs:

define contact{
        contact_name                    freddy
        alias                           Freddy Frouin
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        email                           freddy.frouin at fluxus.net
        pager                           ff at fluxus.net
        }

with this, you can specify notification period for all your contacts
individualy, so you just have to define multiple virtual contacts for
one phisical contact, you will have:

define contact{
        contact_name                    freddy-email
        alias                           Freddy Frouin Email
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
        email                           freddy.frouin at fluxus.net
        pager                           ff at fluxus.net
        }

define contact{
        contact_name                    freddy-popup
        alias                           Freddy Frouin Popup
        service_notification_period     8x5
        host_notification_period        8x5
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-by-popup
        host_notification_commands      host-notify-by-popup
        email                           freddy.frouin at fluxus.net
        pager                           ff at fluxus.net
        }

define contact{
        contact_name                    freddy-page
        alias                           Freddy Frouin Page
        service_notification_period     nights-and-we
        host_notification_period        nights-and-we
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-by-page
        host_notification_commands      host-notify-by-page
        email                           freddy.frouin at fluxus.net
        pager                           ff at fluxus.net
        }

I hope this help... what do you think about this solution ??

Freddy.

On Fri, 27 Sep 2002 19:27:28 +1000
Greg Vickers <g.vickers at qut.edu.au> wrote:

> Hi all again,
> I've had an RTFM and I don't think there is a way of doing this, but I =
was=20
> wondering if someone knows how to:
>=20
> Have my contacts receive email 24x7
> Have my contacts receive winpopup messages in Business Hours
> (and when I get the pager set up)
> Have my contacts receive a page outside of BH.
>=20
> These notifications include both host and service types, so I can't use=
=20
> host_notification_period and service_notification_period to provide the=
=20
> filtering.
>=20
> Looking at the problem from a timeperiod point of view, (rather than=20
> getting winpopup machine names defined from within a contact - i'll let=
 you=20
> all know if I find a way) I can't seem to find a way of doing this.
>=20
> Has anyone done this?
>=20
> As always,
> TIA,
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Greg Vickers
> Computer Systems Officer
> Student Support and Systems
> Teaching and Learning Support Systems, QUT
> Kelvin Grove Campus, CRICOS No 00213J
>=20
> Ph: 07 3864 8276 Fax: 07 3864 5425
> Mob: 0416 001 674 SD: x6147
>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
>=20


--=20
Freddy Frouin
Responsable Supervision
Fluxus - British Telecom
30, rue du Ch=E2teau des Rentiers
75013 Paris

T=E9l: +33 (0)1 44 97 70 00
Fax: +33 (0)1 44 97 70 07



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list