From a5d2a3d579829881d502aa74e25b261e5d5aa416 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 30 Apr 2007 20:20:33 +0000 Subject: [PATCH] Added outbound size MIB --- mbtask/outstat.c | 8 +++++++- mbtask/taskstat.c | 11 +++++++++++ mbtask/taskstat.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mbtask/outstat.c b/mbtask/outstat.c index 074acdb9..32ac0bde 100644 --- a/mbtask/outstat.c +++ b/mbtask/outstat.c @@ -264,7 +264,7 @@ int outstat() DIR *dp = NULL; struct dirent *de; struct stat sb; - unsigned int ibnmask = 0, ifcmask = 0, itnmask = 0; + unsigned int ibnmask = 0, ifcmask = 0, itnmask = 0, outsize = 0; nodelist_modem **tmpm; for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) { @@ -682,6 +682,7 @@ int outstat() /* * Show callresult for this node. */ + outsize += (unsigned int)tmp->size; fmt = calloc(81, sizeof(char)); buf = calloc(81, sizeof(char)); size_str_r(tmp->size, fmt); @@ -717,6 +718,11 @@ int outstat() Syslog('c', "Removed semafore do_inet"); } + /* + * Update outbound size MIB + */ + mib_set_outsize(outsize); + /* * Log results */ diff --git a/mbtask/taskstat.c b/mbtask/taskstat.c index fc3eafdd..0baf94ec 100644 --- a/mbtask/taskstat.c +++ b/mbtask/taskstat.c @@ -125,6 +125,8 @@ typedef struct { unsigned int tfilesmagic; /* MIB tosser files magics */ unsigned int tfileshatched; /* MIB tosser files hatched */ + unsigned int ooutsize; /* MIB outbound size */ + unsigned int bsessions; /* MIB BBS sessions */ unsigned int bminutes; /* MIB BBS minutes used */ unsigned int bposted; /* MIB BBS msgs posted */ @@ -692,3 +694,12 @@ void mib_set_files(char *data) } + +void mib_set_outsize(unsigned int size) +{ + status.ooutsize = size; + Syslog('m', "MIB outbound: %d", status.ooutsize); + + status_write(); +} + diff --git a/mbtask/taskstat.h b/mbtask/taskstat.h index c3bf9b4e..1dad175a 100644 --- a/mbtask/taskstat.h +++ b/mbtask/taskstat.h @@ -29,6 +29,7 @@ void mib_set_email(char *); /* MIB set email data */ void mib_set_news(char *); /* MIB set news data */ void mib_set_echo(char *); /* MIB set echomail data */ void mib_set_files(char *); /* MIB set files data */ +void mib_set_outsize(unsigned int); /* MIB set outbound size */ #endif