Mail reminded by sms or mail by drive limited

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Mail reminded by sms or mail by drive limited

Post 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.
Attachments
commands.cfg
(8.12 KiB) Downloaded 343 times
contacts.cfg
(3.58 KiB) Downloaded 358 times
Service Fmail3 Nagios..JPG
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Mail reminded by sms or mail by drive limited

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Mail reminded by sms or mail by drive limited

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Mail reminded by sms or mail by drive limited

Post 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
Attachments
Service Fmail3 Nagios2..JPG
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Mail reminded by sms or mail by drive limited

Post 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'
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Mail reminded by sms or mail by drive limited

Post 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
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Mail reminded by sms or mail by drive limited

Post by tmcdonald »

We'll keep this thread open for you pending your reply.
Former Nagios employee
Locked