Host and service notification

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.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Host and service notification

Post by MPIvan »

Nagios will not automatically receive traps unless you have set router 10 to send traps down.
That is my plan ... In the topology The Router 1 is Gateway and have VPN to the Router 10. So if router 1 see that Router 10 is down he can send trap to the Nagios and say that Router 10 is down. My question here is, what else should i configure ? I just have to configure Router 1 to send traps to nagios and that is all ? And the other problem i mayby have is, becouse of the Router 1 configuration, there is on one interface placed multiple links, the interface fa 0/0 have 5 ip address, ( links that are connected to that 5 criticals router that i like to monitor like in this example Router 10 ). So is there a way for nagios to know that this trap or error is for that link not for interface ?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Host and service notification

Post by sreinhardt »

There may be some specifics for sending link down traps to via snmp on your router to configure, but it depends on the model and is something that is out of our range of support. Otherwise the only additional things you should need to do would be to install mibs on the nagios machine so that it understands what those traps are. As a side note, your router 1 will not actually say that router 10 is down, it will likely just state that the vpn connection has dropped, which in your case is essentially the same. Also the vpn link is generally considered an interface, and there isnt too much you can do other than altering how snmp traps for that are reported, or changing the core service name\description. That sort of information is mainly handled via the trap sending device.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Host and service notification

Post by MPIvan »

Ok lets say that we have this situation: On router 1 and it is a Cisco 1841, on interface fast. 0/0 i have the folowing ip address:

192.168.1.5 255.255.255.0
192.168.8.5 255.255.255.0 secondary
192.168.9.5 255.255.255.0 secondary
192.168.10.5.255.255.255.0 secondary

The interfaces is configured as multiplex interfaces ( or how to say ... multiple address on one interface ) ......

and let say that 192.168.10.5 is the Router 10 .... so what mibs should i download and what plugin should i use ... im trying to figure out the configuration of the router to send traps, also i need suggestion about what script to use so i can test it.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Host and service notification

Post by slansing »

That is totally dependent on your hardware, you would need to open up the documentation or contact then for the specific information on MIBS.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Host and service notification

Post by MPIvan »

All routers that i have are Cisco this one that i test is old one but its good (Cisco IOS Software, 1841 Software (C1841-IPBASEK9-M), Version 12.4(10b), RELEASE SOFTWARE (fc3)) so here is what iv done for now and i can say that im a nearly satisfied. On a Router on the interfaces 0/0 is connected to the network where is Nagios on. On the interface 0/1 is connected with other router and here on both sides of the routers i have put secondary interfaces. So when i plug out the interface 0/1 it show me that this interfaces are down ...

In Nagios in router/host configuration file i have put this ...

Code: Select all

define host{
        use                                 test1
        host_name                      RouterTest
        alias                               TestFaInter0/0
        address                           10.10.10.1
        _SNMPCOMMUNITY          TestCisco
        contacts                          Ivan
        check_interval                 1
        retry_interval                  1
        max_check_attempts       1
}

define host{
        use                               test1
        host_name                    Test1.1
        alias                             TestRFA0/1.1
        address                         192.168.1.1
        _SNMPCOMMUNITY         TestCisco
        contacts                        Ivan
        check_interval               1
        retry_interval                 1
        max_check_attempts      1
}

define host{
        use                               test1
        host_name                    Test1.2
        alias                             TestRFA0/1.2
        address                         192.168.1.2
        _SNMPCOMMUNITY         TestCisco
        contacts                        Ivan
        check_interval               1
        retry_interval                 1
        max_check_attempts      1
}
and in the template file the host part i have define like this :

Code: Select all

define host{
        name                    test1
        use                     generic-host
        check_period            24x7
#       check_interval          1
#        check_interval          5
#        retry_interval          1
#       max_check_attempts      5
#        max_check_attempts      10
        check_command           check-host-alive
        notification_options    d,r
        notification_interval   0
        hostgroups              routers-zgrada
        register                0
}
The big part that i think is geting my jobe done is in the nagios.cfg file ... and that is
# INTERVAL LENGTH
# This is the seconds per unit interval as used in the
# host/contact/service configuration files. Setting this to 60 means
# that each interval is one minute long (60 seconds). Other settings
# have not been tested much, so your mileage is likely to vary...

# lengthinterval_length=1
interval_length=60
If i put this to 1 then i have fast reply (approximately one minute) ... but the CPU usage go to 80 % - 90 % ... so is there a way to make this interval_length for just a few hosts not all of them ??

And my second questions is: In this situation ... i have this : Router 10 (Inter0/1)<---------->(Inter0/1)Router 1(Inter0/0)<------->Nagios .... i unplug Inter0/1 from Router 10 and on Router 1 send this snmp trap to Nagios ... all nagios have to do is to take this snmp traps message and process, and saying that the status of Router 1 (Inter0/1) or the host Router 10 is not active ???

And is there a faster way of processing this info ?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Host and service notification

Post by sreinhardt »

If i put this to 1 then i have fast reply (approximately one minute) ... but the CPU usage go to 80 % - 90 % ... so is there a way to make this interval_length for just a few hosts not all of them ??
I cannot stress enough, DO NOT DO THIS. This is basically a multiplier for how long things should take, in seconds not minutes. This means 5 minute intervals are ALL now 5 seconds. If you wish to alter this, you would need to also alter every single template, check, notification and other items that you want to keep on thier current interval.
And my second questions is: In this situation ... i have this : Router 10 (Inter0/1)<---------->(Inter0/1)Router 1(Inter0/0)<------->Nagios .... i unplug Inter0/1 from Router 10 and on Router 1 send this snmp trap to Nagios ... all nagios have to do is to take this snmp traps message and process, and saying that the status of Router 1 (Inter0/1) or the host Router 10 is not active ???
In this case, router 1 should notify nagios that the interface or vpn connection on if 0/1 is down, or it may be slightly different if the virtual interface is labeled differently than the physical one. Personally, this would be the route I would use, provided your device can send traps for this, please contact the vendor to verify.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Host and service notification

Post by MPIvan »

In this case, router 1 should notify nagios that the interface or vpn connection on if 0/1 is down, or it may be slightly different if the virtual interface is labeled differently than the physical one. Personally, this would be the route I would use, provided your device can send traps for this, please contact the vendor to verify.
That what iv say. Router 1 to tell nagios about Router 10, Router 1 will send SNMP message that Router 10 is down. Now what iv know for now is, if i enable SNMP, then Nagios send or ask the host to send SNMP message, and this duration is about 3-5 minutes.
Question 1: What should i change in configuration of the hosts ( cfg files ) and templates and nagiso.cfg files to make this duration be 1 minute.

Second
Now im trying to works with TRAPS or SNMP TRAPS ... that means that if Router 1 or any Host make some changes ( in my situation is interface up or down ) tell the Monitoring system, and that is Nagios, and Nagios should immediately see this change. For what iv read so far in the Nagios Documentation is this:
Note: Nagios is not designed to be a replacement for a full-blown SNMP management application
like HP OpenView or OpenNMS. However, you can set things up so that SNMP traps received by a host
on your network can generate alerts in Nagios.
As if designed to make the Gods of Hypocrisy die of laughter, SNMP is anything but simple. Translating
SNMP traps and getting them into Nagios (as passive check results) can be a bit tedious. To make this
task easier, I suggest you check out Alex Burger’s SNMP Trap Translator project located at
http://www.snmptt.org. When combined with Net-SNMP, SNMPTT provides an enhanced trap
handling system that can be integrated with Nagios.
So what iv understand is that Nagios dont understand TRAPS ... to learn i should install SNMPTT ?? i guess already have Net-SNMP :))
I cannot stress enough, DO NOT DO THIS.
Sorry i made you stress or nervous, but if i dont tested i wouldn't know ;) :D ...
It's important to note that we can also define the units used by the check_interval and
retry_interval commands. They only use minutes by default, checking the interval_
length setting that's normally defined in the root configuration file for Nagios Core, by default
/usr/local/nagios/etc/nagios.cfg:
interval_length=60
If we wanted to specify these periods in seconds instead, we could set this value to 1 instead
of 60:
interval_length=1
This would allow us, for example, to set check_interval to 15, to check a host every
15 seconds. Note that if we have a lot of hosts with such a tight checking schedule, it might
overburden the Nagios Core process, particularly if the checks take a long time to complete.
Don't forget that changing these properties for a large number of hosts can be tedious, so if
it's necessary to set these directives to some common value for more than a few hosts, then
it may be appropriate to set the values in a host template and then have these hosts inherit
from it.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Host and service notification

Post by slansing »

So what is your current question? How to set up SNMPTT?
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: Host and service notification

Post by MPIvan »

My current question is: Does Nagios know how to process or get or read the SNMP TRAPS or do i have to set up SNMPTT ? If i have to set up SNMPTT i would like to open a new post or make it here, if some one can gave me step by step procedure to configure and install ...
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Host and service notification

Post by slansing »

Yes you would need to set up the nagios SNMPTT and forward traps through it so to speak. Would you open a new thread for this please?
Locked