Module: sip-router
Branch: master
Commit: 41e163ccd7ea6b52886e67928d453f454a239208
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=41e163c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Jan 28 09:16:05 2011 +0100
snmpstats: start the agentx process
---
modules_k/snmpstats/snmpstats.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/modules_k/snmpstats/snmpstats.c b/modules_k/snmpstats/snmpstats.c
index 9e52c03..248e693 100644
--- a/modules_k/snmpstats/snmpstats.c
+++ b/modules_k/snmpstats/snmpstats.c
@@ -266,6 +266,9 @@ static int mod_init(void)
/* Register the alarm checking function to run periodically */
register_timer(run_alarm_check, 0, ALARM_AGENT_FREQUENCY_IN_SECONDS);
+ /* add space for one extra process */
+ register_procs(1);
+
return 0;
}
@@ -275,11 +278,21 @@ static int mod_init(void)
* process, and register a handler for any state changes of our child. */
static int mod_child_init(int rank)
{
+ int pid;
+
/* We only want to setup a single process, under the main attendant. */
if (rank != PROC_MAIN) {
return 0;
}
+ pid=fork_process(PROC_NOCHLDINIT, "SNMP AgentX", 1);
+ if (pid<0)
+ return -1; /* error */
+ if(pid==0){
+ /* child */
+ agentx_child(1);
+ }
+
/* Spawn a child that will check the system up time. */
spawn_sysUpTime_child();