Page 1 of 1

Mail reminded by sms or mail by drive limited

Posted: Tue Mar 13, 2018 6:44 am
by michaelpn
Hi,
I would like be reminded when my drive space is for example under 5 GB at my Exchange Server.
How do I do this ?
Right now I'm being reminded if one or more Servers are down through my SMS Gateway :).
As written I would also like to be reminded by a sms or mail if my drive is under a curtained limited.
Now I get a yellow warning at my Email Server FGMAil3 "please see attachments"
Do I have to edit my "Commands.cfg" and my contacts.cfg.
I attach my commands and contact files so you can follow me.

Re: Mail reminded by sms or mail by drive limited

Posted: Tue Mar 13, 2018 8:44 am
by mcapra
Here's the official documentation regarding notifications:
https://assets.nagios.com/downloads/nag ... tions.html
michaelpn wrote:Hi,
I would like be reminded when my drive space is for example under 5 GB at my Exchange Server.
How do I do this ?
Essentially, you can configure your host/service objects to trigger a notification whenever and however you like. The conditions under which a notification is triggered for a given host/service object are dictated in that object's configuration.

I notice all of your contact objects are configured to use the following host notification options:

Code: Select all

host_notification_period 24x7
host_notification_options d,u,r
host_notification_commands notify-host-by-sms,notify-host-by-email
There are also directives that dictate how service notifications are handled for a given contact; Directives like:

Code: Select all

service_notifications_enabled	[0/1]
service_notification_period	timeperiod_name
service_notification_options	[w,u,c,r,f,s,n]
service_notification_commands	command_name
I assume you are currently inheriting these options from the generic-contact template? Can you share a copy of the generic-contact contact definition?
michaelpn wrote:As written I would also like to be reminded by a sms or mail if my drive is under a curtained limited.
You could essentially copy your notify-host-by-sms command definition and modify it a bit to create a notify-service-by-sms command that uses slightly different macros that are more appropriate for service notifications. Then, once that command definition is finished, assign it to your contact objects via the service_notification_commands directive.

Re: Mail reminded by sms or mail by drive limited

Posted: Tue Mar 13, 2018 4:27 pm
by cdienger
If you haven't decided on a client yet, I would suggest ncpa. Configuring ncpa and how to run disk checks are covered in:

https://www.nagios.org/ncpa/getting-started.php
https://www.nagios.org/ncpa/help.php#api-modules-disk

Re: Mail reminded by sms or mail by drive limited

Posted: Wed Mar 14, 2018 7:18 am
by michaelpn
Hi mcapra,

thanks for a quickly answer. But if I would like be notified when my Exchange has arrived a sergeant limit for example under 3GB what definition should I then use. As you can see at the attachment I have now the check_nt!USEDDISKSPACE!-l c -w 80 -c 90 so the question is what kind of notification I should use at my contacts.cfg and do I have change my windows.cfg ? =>

define service{
use generic-service
host_name FGMAIL3
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90

Re: Mail reminded by sms or mail by drive limited

Posted: Wed Mar 14, 2018 4:10 pm
by cdienger
Checks with check_nt are limited to only checking percentages. You could use check_nrpe or check_ncpa instead. Examples of each can be found at https://support.nagios.com/kb/article/d ... s-770.html . Links to install/configure ncpa were provided in the my last update and instructions for installing check_nrpe plugin can be found at https://support.nagios.com/kb/article.php?id=515 with config details at https://assets.nagios.com/downloads/nag ... e/NRPE.pdf.

commands.cfg would need to be updated like so:

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


and the check:

define service{
use generic-service
host_name FGMAIL3
service_description C:\ Drive Space
check_command check_nrpe!check_drivesize -a drive=C: 'warning=free<10G' 'critical=free<3G'
}

Re: Mail reminded by sms or mail by drive limited

Posted: Mon Mar 19, 2018 2:40 am
by michaelpn
Hi Cdienger,

sorry I answer you so late but I was on a vacation for a few days. It looks like what I'm searching for and I will get back to you as soon as I have tried it. Many Thanks for your cooperation.

Best Regards

Michael Pierre Nielsen

Re: Mail reminded by sms or mail by drive limited

Posted: Mon Mar 19, 2018 10:27 am
by tmcdonald
We'll keep this thread open for you pending your reply.