Welcome, Guest. Please login or register.

Author Topic: Monitoring-email-Content  (Read 3964 times)

SteffenS

  • Guest
Monitoring-email-Content
« on: March 24, 2010, 11:58:07 AM »
Hello!

I'm a NeDi(O)-newbie (knowing and using it since 3 weeks) - and I'm a fan now.
Email-notification is cool - but I have 2 little questions about it:
1. How can I configure to mail me devicename+ip in subject instead of  only "Moni Alert!"?
2. How can I set/unset all devices (or a group of this) for monitoring/emali-notification?

SteffenS

  • Guest
Re: Monitoring-email-Content
« Reply #1 on: April 07, 2010, 10:03:03 AM »
I have found the part-solution for my wish 1.) to showing sysname in mail-subject by changing this

         $message->data();
         $message->datasend("To: $main::usr{$u}{ml}\n");
         $message->datasend("From: $misc::mailfrom\n");
         $message->datasend("Subject: $_[0]\n");
         $message->datasend("\n");
         $message->datasend("$_[1]\n");
         $message->dataend();

to this

         $message->data();
         $message->datasend("To: $main::usr{$u}{ml}\n");
         $message->datasend("From: $misc::mailfrom\n");
         $message->datasend("Subject: $_[1]\n");
         $message->datasend("\n");
         $message->datasend("$_[0]\n");
         $message->datasend("$_[1]\n");
         $message->dataend();

in /var/nedi/inc/libmon.pl.
But how can I show also the device-ip in subject?
And my 2nd wish is to find a way to control monitoring-configuration for a large number of devices.
An idea is sorting devices in Monitoring-Setup.php like in Devices-List.php.

Do anyone know the solution for this?

-----------------------------------------------------------------------------
UPDATE
Hello again, Boys!

for including a link to the Devices-Status-page in the monitoring-email in NeDiO45, I have changed following 3 lines in /var/nedi/moni.pl from

if( $mon{$d}{ml}){&mon::SendMail("Moni Recovery","Device $d Recovered!")}
if( $mon{$d}{ml}){&mon::SendMail("Moni Reboot Alert!","Device $d Rebooted!")}
if( $mon{$d}{ml}){&mon::SendMail("Moni $cr Alert!","Device $d is down!")}

to

if( $mon{$d}{ml}){&mon::SendMail("Device $d Recovered!","$d - Moni-Alert")}
if( $mon{$d}{ml}){&mon::SendMail("Device $d Rebooted!","$d - Moni-Alert")}
if( $mon{$d}{ml}){&mon::SendMail("Device $d is down!","$d - Moni-Alert",)}

and in /var/nedi/inc/libmon.pl replaced line

         $message->datasend("$_[1]\n");

with line
         $message->datasend("https://10.x.x.x/Devices-Status.php\?dev=$_[1]\n");

Note: Replace "10.x.x.x" by your Nedi-Server-IP for get it working!

Have Fun!
« Last Edit: January 18, 2011, 01:54:37 PM by SteffenS »

SteffenS

  • Guest
Re: Monitoring-email-Content
« Reply #2 on: June 02, 2010, 03:03:18 PM »
Hello again!

I have a few new ideas for a future version of nedi:

1. it would be cool if monitoring-emails sended from nedi including a link to to the failed device like
Code: [Select]
$message->datasend("https://<nedi-server-ip>/Devices-Status.php?dev=<device>");
in libmon.pl
(until yet, I have added this link to Devices-Status.php without the "?dev=" because I don't know how to realize it)

2. for a better overview (and set-up) which devices are monitored and which not, a few new buttons in Monitoring-Setup.php for
a) "show not monitored devices" (mysql-query like "select name from devices where name not in (select device from monitoring);") and
b) "show monitored devices without email" (mysql-query like "select device from monitoring where mail regexp 0;")
could be helpful for better control monitoring-setup with a large number of devices

3. in the discovery-mode of System-NeDi.php, an additional checkbox for adding discovered devices to monitoring-table (and email also maybe) could save time for manual add this after discovery.

What do you mean?
« Last Edit: June 02, 2010, 03:09:34 PM by SteffenS »

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2780
    • View Profile
    • NeDi
Re: Monitoring-email-Content
« Reply #3 on: June 10, 2010, 10:15:41 PM »
Thanks! I'm reworking all reports and some other modules to epxloit the join query contribution. I'll consider your ideas for the monitoring setup. (will look at mail too, of course)..
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo