Pass in a HostGoup name as part of Service Trap
Posted: Thu Feb 22, 2018 3:22 pm
Nagios team,
I've setup a service to check on a few things on windows servers but one of the requirements is to include a HostGroup name in trap that particular server in trouble belongs to. Here is what I have found at MIBs file for Host vs Service traps:
The .5 trap does have it, so I want to make this:
nHostEvent NOTIFICATION-TYPE
OBJECTS { nHostname, nHostStateID, nHostStateType, nHostAttempt,
nHostDurationSec, nHostGroupName, nHostLastCheck, nHostLastChange,
nHostOutput }
::= { nagiosNotify 5 }
(Notice that trap 7 below doesn’t have the nHostGroupName in it)
nSvcEvent NOTIFICATION-TYPE
OBJECTS { nHostname, nHostStateID, nSvcDesc, nSvcStateID, nSvcAttempt,
nSvcDurationSec, nSvcLastCheck, nSvcLastChange,
nSvcOutput }
::= { nagiosNotify 7 }
Look like this:
nSvcEvent NOTIFICATION-TYPE
OBJECTS { nHostname, nHostStateID, nSvcDesc, nSvcStateID, nSvcAttempt,
nSvcDurationSec, nHostGroupName, nSvcGroupName, nSvcLastCheck, nSvcLastChange,
nSvcOutput }
::= { nagiosNotify 7 }
So that the .7 trap populates the nHostGroupName data.
My questions are: is this something I can do and if so, how do I update the trap definition in Nagios once I upload the modified NAGIOS-NOTIFY-MIB.txt file? Any other options/suggestions how to accomplish it?
thanks!
I've setup a service to check on a few things on windows servers but one of the requirements is to include a HostGroup name in trap that particular server in trouble belongs to. Here is what I have found at MIBs file for Host vs Service traps:
The .5 trap does have it, so I want to make this:
nHostEvent NOTIFICATION-TYPE
OBJECTS { nHostname, nHostStateID, nHostStateType, nHostAttempt,
nHostDurationSec, nHostGroupName, nHostLastCheck, nHostLastChange,
nHostOutput }
::= { nagiosNotify 5 }
(Notice that trap 7 below doesn’t have the nHostGroupName in it)
nSvcEvent NOTIFICATION-TYPE
OBJECTS { nHostname, nHostStateID, nSvcDesc, nSvcStateID, nSvcAttempt,
nSvcDurationSec, nSvcLastCheck, nSvcLastChange,
nSvcOutput }
::= { nagiosNotify 7 }
Look like this:
nSvcEvent NOTIFICATION-TYPE
OBJECTS { nHostname, nHostStateID, nSvcDesc, nSvcStateID, nSvcAttempt,
nSvcDurationSec, nHostGroupName, nSvcGroupName, nSvcLastCheck, nSvcLastChange,
nSvcOutput }
::= { nagiosNotify 7 }
So that the .7 trap populates the nHostGroupName data.
My questions are: is this something I can do and if so, how do I update the trap definition in Nagios once I upload the modified NAGIOS-NOTIFY-MIB.txt file? Any other options/suggestions how to accomplish it?
thanks!