summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2009-01-16 01:42:29 +0000
committerStef Walter <stef@memberwebs.com>2009-01-16 01:42:29 +0000
commit2316a0d0c4a584b565f2cf9d2d1ec38ac4592e97 (patch)
treeaa7b5042635249ff16f6db410828ff015df6f7ed /module
parent663a4dce7c52dd50fefd1d71d9ff3ec811acb795 (diff)
Add support for listing threads
Diffstat (limited to 'module')
-rw-r--r--module/bsnmp-jails.c6
-rw-r--r--module/jails-tree.def3
2 files changed, 8 insertions, 1 deletions
diff --git a/module/bsnmp-jails.c b/module/bsnmp-jails.c
index b88cdd7..b6eca88 100644
--- a/module/bsnmp-jails.c
+++ b/module/bsnmp-jails.c
@@ -168,6 +168,7 @@ struct jaildat {
uint32_t cpu_time_total;
uint32_t cpu_time_offset;
uint32_t n_processes;
+ uint32_t n_threads;
/* Top process information */
uint32_t n_ptops;
@@ -903,6 +904,7 @@ process_refresh_all (void)
jail->ptops[i].status = PROC_GONE;
jail->n_processes = 0;
+ jail->n_threads = 0;
jail->cpu_time_total = jail->cpu_time_offset;
}
@@ -920,6 +922,7 @@ process_refresh_all (void)
continue;
jail->n_processes += 1;
+ jail->n_threads += kp[i].ki_numthreads;
/* Find the top level process within jail to account to */
tkp = &kp[i];
@@ -1438,6 +1441,9 @@ op_jailentry (struct snmp_context *ctx, struct snmp_value *value,
case LEAF_jailProcesses:
value->v.integer = jail->n_processes;
return SNMP_ERR_NOERROR;
+ case LEAF_jailThreads:
+ value->v.integer = jail->n_threads;
+ return SNMP_ERR_NOERROR;
case LEAF_jailCpuTime:
value->v.integer = jail->cpu_time_total;
return SNMP_ERR_NOERROR;
diff --git a/module/jails-tree.def b/module/jails-tree.def
index 06bb10f..3be0826 100644
--- a/module/jails-tree.def
+++ b/module/jails-tree.def
@@ -53,7 +53,8 @@
(13 jailOutPackets COUNTER64 GET)
(20 jailProcesses INTEGER GET)
- (21 jailCpuTime TIMETICKS GET)
+ (21 jailThreads INTEGER GET)
+ (25 jailCpuTime TIMETICKS GET)
(30 jailDiskSpace COUNTER64 GET)
(31 jailDiskFiles COUNTER64 GET)