I want to set Nagios up to issue warnings (e.g. mildly high disk usage of clients) via email. I'm new to nagios core, so please assist me to achieve this. what changes I have to make in config files like contacts.cfg
, services.cfg
, commands.cfg
and things to be added at client etc. I'm newbie to nagios. After so much of googling out I didn't find suitable info anywhere, So asking here to guide me properly. or anyone can provide link to follow that. any help would be appreciated.

- 67
- 1
- 12
-
Start with everything under The Basics https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/toc.html – Keith Jan 21 '16 at 16:56
1 Answers
this is not really something google can't help you with:
Search for "nagios gettings startet nrpe" lists this as the second hit - have a shot at that and see how that goes for you..
Hint: What you are looking for is at the end of the article:
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p $ARG1$
but to get there you really should work through the whole article as it gives you a sense of the context you're getting into.
But anyway to give you a coarse structure for individual lookups:
Nagios uses several entities that come together at the definition of your hosts and services..
1st - start by defining contacts that will be notified
a sample for a search on google Google search for "nagios add contact" gives you this as a first hit "Steps to Define Nagios Contacts With Email and Pager Notification"
Please crawl through the next few points that way as this has been explained and documented a thousand times for such a popular system as nagios.
3th - define how hosts should be checked
4th - define hosts you want to check
5th - define services to be checked
6th - prepare the client: Back in the day when i was doing this manually i used nrpe on linux clients and nsclient++ at the windows side of things... see
7th - restart (or better reload) nagios and check the logs if you got it right
EDIT: To Answer the initial question a little better..
When you work through the first link provided you see a block of code for the service that defines under which circumstances and when a user will be notified about the problem:
notification_interval 1440
is_volatile 0
check_period 24x7
normal_check_interval 5
retry_check_interval 1
max_check_attempts 10
notification_period 24x7
notification_options c,r
contact_groups admins
The last three lines are important for your question about notifications. The contacts in the contact group admins will be notified at all hours if the defined services goes critical (c) or recovers (r). In your case you could also add a w to be notified when the service goes to warning state.
I posted a link above about contacts and groups..
here are snippets from that site relevant to your question (slightly changed to match up with your case):
define contact{
name generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0
}
define contact{
contact_name yourname
use generic-contact
alias Your Full Name(Sysadmin)
email yourmail@yourdomain.com
}
define contactgroup{
contactgroup_name admins
alias System Administrators
members yourname
}
You see the links provided everything you asked for.

- 73
- 1
- 7
-
There is no such information regarding sending email to admin if status is warning. – Rahul Jan 22 '16 at 06:44
-
1Please see my edited answer. The information was all there in the first and second link. You are urged to read through the material yourself as you should understand the basics of a system like nagios which can get complex fast. Get the basics right and understand them the first time or you will be re-doing a lot of work lateron. – Matthias Raithel Jan 22 '16 at 07:18