Page 2 of 5

Re: Facing problem with Email Notification in Nagios Core

Posted: Tue Sep 15, 2015 6:17 pm
by Box293
arumugam wrote:Is there any way to find OS details via nagios for example in our network linux,windows, switches and routers we are configured, so can we get the os details using nagios
SNMP will most likely work on most but not all devices:

Command:

Code: Select all

check_snmp -H xxxx -o 1.3.6.1.2.1.1.1.0 -C public -P 2c
Output (linux):

Code: Select all

SNMP OK - "Linux ub03.box293.local 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64" |
Output (Windows x86):

Code: Select all

SNMP OK - "Hardware: x86 Family 6 Model 63 Stepping 2 AT/AT COMPATIBLE - Software: Windows Version 6.1 (Build 7600 Multiprocessor Free)" |
Output (Windows x64):

Code: Select all

SNMP OK - "Hardware: Intel64 Family 6 Model 63 Stepping 2 AT/AT COMPATIBLE - Software: Windows Version 6.1 (Build 7600 Multiprocessor Free)" |
Output (Netgear Switch):

Code: Select all

SNMP OK - Such Object available on this agent at this OID |

Re: Facing problem with Email Notification in Nagios Core

Posted: Wed Sep 16, 2015 5:16 am
by arumugam
Hi,

Thanks for your suggestion, and for check_ping query i have down the remote machine and checked till max_check attempt, after some time i got a mail notification stating that machine is down.
So this is the correct way or could you please suggest me for how to check ping continuously for the remote machine and if any issue in ping how to get a mail notification.

Re: Facing problem with Email Notification in Nagios Core

Posted: Wed Sep 16, 2015 7:58 am
by arumugam
Hi

Thanks for your suggestion. and for check_ping query i have shutdown the remote machine and waited till max_check attempt. Then after some i got mail notification stating that machine is down.
So this is correct way to check the ping ? could you please suggest me how to check the ping continuously and to get a mail notification.

Re: Facing problem with Email Notification in Nagios Core

Posted: Wed Sep 16, 2015 9:47 am
by jdalrymple
If you want an immediate notification (I think that's what you're seeking?) just change max_check_attempts to 1 in your generic-host template.

Re: Facing problem with Email Notification in Nagios Core

Posted: Wed Sep 16, 2015 9:56 pm
by arumugam
Hi,

Fine,Thanks for your reply. Could you please tell me what is the difference between cd /usr/local/nagios/etc/ hosts.cfg , services.cfg and cd /usr /local/nagios/etc/objects/ hosts.cfg and services.cfg

1) which host name i have to define in /etc/ hosts.cfg ? and /etc/services.cfg its just a template or i have to define something here?
2)can i define hosts and services in same file in /usr/local/nagios/etc/objects/hosts.cfg ? or i have to define hosts and services in two seperate file ?

Re: Facing problem with Email Notification in Nagios Core

Posted: Wed Sep 16, 2015 10:27 pm
by Box293
The names of the files are ambiguous, as long as they are referenced in nagios.cfg they will be included when nagios starts.

You can put a host and services in the same config file if you want. You could actually combine them all into one file if you really wanted to. The reason why they are laid out this way is to add some human logic as to what exists in each file.

Re: Facing problem with Email Notification in Nagios Core

Posted: Thu Sep 17, 2015 8:34 am
by arumugam
Hi,

I Have added one ESXi host in the nagios and i need to monitor current users,cpu load and process, and i am using below commands

check_local_procs !100!200!RSZDT
check_local_users !20!40
check_local_load!5.0,4.0,3.0!10.0,6.0,4.0

So please suggest me these command are correct or i have to mention check_esx instead of check_local

I wanted to know if check_local means its in local host process or is it correct way ?

Thanks in advance

Re: Facing problem with Email Notification in Nagios Core

Posted: Thu Sep 17, 2015 10:59 am
by jdalrymple
Start here:

https://assets.nagios.com/downloads/nag ... start.html

Going through this will give you a leg up on how things work. The "things" you're referencing:
arumugam wrote:check_local_procs !100!200!RSZDT
check_local_users !20!40
check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
are service directives called check_commands. Those check_commands always start with a defined command - usually in a file called commands.cfg (although as Box293 described this is ambiguous).

The important thing to understand here is that those commands simply run local binaries to query the system for information. If you use those binaries on an ESX system they won't work, the busybox console is ill prepared to have those plugins run on it. Even if they were run, you still need a transport method to get the information from the "local ESX" box to the Nagios system.

Please understand that running arbitrary commands on one system won't offer information about another system without involving some sort of agent and transport. Does that concept make sense?

After you have a basic understanding of how Nagios and monitoring remote systems in general works, then you can visit the Exchange to find plugins and documentation to help you setup monitoring for your ESX host:

https://exchange.nagios.org/directory/P ... s/VMWare#/

Re: Facing problem with Email Notification in Nagios Core

Posted: Thu Sep 17, 2015 1:10 pm
by arumugam
Hi,

Really thanks for your guidance, i have one more query, Is there any way to monitor esxi through VMware-vSphere-Perl-SDK package installation. If so could you please provide me the steps.
How to monitor using that plugin.

Re: Facing problem with Email Notification in Nagios Core

Posted: Thu Sep 17, 2015 4:19 pm
by jdalrymple
There is a pretty good write-up here: http://www.3open.org/d/nagios/monitorin ... _vsphere_4

Incidentally, our commercial product NagiosXI makes this whole process much easier for those who don't care to learn how to setup all of the configurations at the command line, you might want to take it for a test drive:

https://www.nagios.com/downloads/nagios-xi/#/