SMB Pop-up

DTerrell at Delphi-Tech.com DTerrell at Delphi-Tech.com
Wed Mar 5 16:14:43 CET 2003


On second thought, I've figured a way around this.  I'm simply using domain
login names as the contact name, and their full name as the alias.  In the
notify-by-messenger commands I'll simply tell it to send to $CONTACTNAME$
and it'll send out properly!  I can avoid duplicate contacts/groups.
Excellent!

-----Original Message-----
From: DTerrell at Delphi-Tech.com [mailto:DTerrell at Delphi-Tech.com]
Sent: Wednesday, March 05, 2003 8:45 AM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] SMB Pop-up


WOW, what a thorough response.   Although, amazingly this didn't quite
answer my question, it did give me an idea of how to go about what I want in
the end.  You see, I really wanted a third variable similar to email/pager,
something like user/host.  That way in one contact I'd be able to specify
three points of contact instead of two, the third being their host/username
(very neat package being able to pop-up by username, btw, thanks so much!).
However, instead of going this road, which seems bumpy, I'll simply make
more then one entry for contacts...one having their pager, the other having
hosts/usernames.  It actually may work out better this way, at least
similar, instead of specifying that I want contact via this-or-that, I can
simply specify a different contactgroup of which there is smb pop-ups!

Excellent, thanks so much!

-Dave

-----Original Message-----
From: Steve Freegard [mailto:steve.freegard at lbsltd.co.uk]
Sent: Wednesday, March 05, 2003 6:49 AM
To: 'DTerrell at Delphi-Tech.com'; 'nagios-users at lists.sourceforge.net'
Subject: RE: [Nagios-users] SMB Pop-up


Hi Dave,

What you want is pretty easy to do - here are a few instructions for you to
get you started.  You don't mention what OS you are using - I'm on RedHat
7.3, so you'll have to change this depending on what you use.

As a minimun - you'll need the 'samba-client' rpm package installed which
contains the 'smbclient' binary which you need to send the popups.

The smbclient utility will currently only allow you to send your popup to
machine names and not usernames - however if you want to do this you can
head over to www.samba-tng.org and grab tng from CVS and compile it - and
use the smbclient program from this - and you'll be able to send the popups
by username which is quite handy.

Firstly - you need to set-up your Nagios contacts - I use the 'pager'
section for the machine/user that I want the popup to go to - e.g:

define contact{
 contact_name                   smf
 alias                          Steve Freegard
 host_notification_period       24x7
 service_notification_period    24x7
 host_notification_options      d,r
 service_notification_options   w,c,r
 host_notification_commands     host-notify-by-winpopup
 service_notification_commands  notify-by-winpopup
 email                          e-mail at address.here
 pager                          smf			<-- NT Machine
Name/NT Username
}

Next - set-up the notification commands:

define command{
        command_name    notify-by-winpopup
        command_line    /bin/echo -e 'Notification Type:
$NOTIFICATIONTYPE$\n\nHost: $HOSTNAME$\nHost Description:
$HOSTALIAS$\nAddress: $HOSTADDRESS$\nService: $SERVICEDESC$\nState:
$SERVICESTATE$\n\nAdditional Information:\n$OUTPUT$' |
/usr/local/nagios/libexec/smbclient/winpopup.sh $CONTACTPAGER$
}

define command{
        command_name    host-notify-by-winpopup
        command_line    /bin/echo -e 'Notification Type:
$NOTIFICATIONTYPE$\n\nHost: $HOSTNAME$\nHost Description:
$HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $HOSTSTATE$\n\nAdditional
Information:\n$OUTPUT$' | /usr/local/nagios/libexec/smbclient/winpopup.sh
$CONTACTPAGER$
}

Obviously - with these you need to change the path of the smbclient binary -
I'm using a wrapper script as I used the tng version of smbclient, but as I
use the 'main' samba for filesharing on this box - I didn't want tng to get
in the way, so I copied the required libs to a smbclient directory, and use
a wrapper script to call it.

If you want to do the same - you'll need the following files from a compiled
tng:

libnmb.so.0
libsamba.so.0
libsmb.so.0
smbclient

The wrapper script called winpopup.sh - all this does it to use the libs in
the current directory, and set the username to NAGIOS so the popup shows as
coming from this user - it looks like:

#!/bin/bash
if [ -z $1 ]; then exit; fi

cd `dirname $0`
export LD_LIBRARY_PATH=.
export USER=NAGIOS
./smbclient -M $1 2>&1 > /dev/null
exit 0

Hope this helps.

Regards,
Steve.

-----Original Message-----
From: DTerrell at Delphi-Tech.com [mailto:DTerrell at Delphi-Tech.com] 
Sent: 04 March 2003 21:20
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] SMB Pop-up


I'm trying to make an alternate notification option.  My linux machine is a
member of my NT domain here, and I'd like a notification type to be
notify-by-messenger...using the messenger service.  I'm sure someone has
already done this, except I'm wondering hot to make the macros for it, such
as $CONTACTHOST$ like the $CONTACTEMAIL$, there would be a few hosts I'd
need to send it to, and I'd like it to be so I can set it in the
contacts.cfg file like an email address and have it use that.

any help appreciated.

-Dave T.


-------------------------------------------------------
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
::: 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: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.lbsltd.co.uk
**********************************************************************


-------------------------------------------------------
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
::: 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: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.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