Added trap for unexpected restart.
git-svn-id: http://voip.null.ro/svn/yate@5384 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
33d89afa04
commit
269ad3f190
|
@ -327,6 +327,7 @@ public:
|
|||
ENGINE_NODENAME = 12,
|
||||
ENGINE_STATE = 13,
|
||||
ENGINE_CALL_ACCEPT = 14,
|
||||
ENGINE_UNEX_RESTART = 15,
|
||||
};
|
||||
// Constructor
|
||||
inline EngineInfo()
|
||||
|
@ -1063,6 +1064,7 @@ static TokenDict s_categories[] = {
|
|||
{"semaphores", Monitor::ENGINE},
|
||||
{"waitingSemaphores", Monitor::ENGINE},
|
||||
{"acceptStatus", Monitor::ENGINE},
|
||||
{"unexpectedRestart", Monitor::ENGINE},
|
||||
// node info
|
||||
{"runAttempt", Monitor::ENGINE},
|
||||
{"name", Monitor::ENGINE},
|
||||
|
@ -1242,6 +1244,7 @@ static TokenDict s_engineQuery[] = {
|
|||
{"runAttempt", EngineInfo::ENGINE_RUNATTEMPT},
|
||||
{"name", EngineInfo::ENGINE_NODENAME},
|
||||
{"state", EngineInfo::ENGINE_STATE},
|
||||
{"unexpectedRestart", EngineInfo::ENGINE_UNEX_RESTART},
|
||||
{0,0}
|
||||
};
|
||||
|
||||
|
@ -1259,6 +1262,7 @@ TokenDict EngineInfo::s_engineInfo[] = {
|
|||
{"runattempt", EngineInfo::ENGINE_RUNATTEMPT},
|
||||
{"nodename", EngineInfo::ENGINE_NODENAME},
|
||||
{"acceptcalls", EngineInfo::ENGINE_CALL_ACCEPT},
|
||||
{"lastsignal", EngineInfo::ENGINE_UNEX_RESTART},
|
||||
{0,0}
|
||||
};
|
||||
|
||||
|
@ -1619,6 +1623,12 @@ bool EngineStartHandler::received(Message& msg)
|
|||
if (!notif.null())
|
||||
__plugin.sendTrap(notif,String(s_yateRun));
|
||||
}
|
||||
int lastsignal = Engine::runParams().getIntValue(YSTRING("lastsignal"),0);
|
||||
if (lastsignal >= 0) {
|
||||
String notif = lookup(EngineInfo::ENGINE_UNEX_RESTART,s_engineQuery,"");
|
||||
if (!notif.null())
|
||||
__plugin.sendTrap(notif,String(lastsignal));
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
|
|
@ -1850,6 +1850,20 @@ mgcpGatewayUp OBJECT-TYPE
|
|||
|
||||
-- mgcpAlarms END
|
||||
|
||||
-- engineAlarms BEGIN
|
||||
|
||||
engineAlarms OBJECT IDENTIFIER ::= { alarms 6 }
|
||||
|
||||
unexpectedRestart OBJECT-TYPE
|
||||
SYNTAX Counter32
|
||||
MAX-ACCESS read-only
|
||||
STATUS current
|
||||
DESCRIPTION
|
||||
"Signal code that caused last YATE restart."
|
||||
::= { engineAlarms 1 }
|
||||
|
||||
-- engineAlarms END
|
||||
|
||||
-- alarms END
|
||||
|
||||
|
||||
|
|
|
@ -1282,6 +1282,14 @@ name=mgcpGatewayUp
|
|||
access=accessible-for-notify
|
||||
type=DisplayString
|
||||
|
||||
[1.3.6.1.4.1.34501.1.8.6]
|
||||
name=engineAlarms
|
||||
|
||||
[1.3.6.1.4.1.34501.1.8.6.1]
|
||||
name=unexpectedRestart
|
||||
access=read-only
|
||||
type=Counter32
|
||||
|
||||
[1.3.6.1.4.1.34501.1.9]
|
||||
name=commands
|
||||
|
||||
|
|
Loading…
Reference in New Issue