Add a mib for worker process ID.

MFC after:	3 days
This commit is contained in:
trociny 2013-07-02 18:54:39 +00:00
parent 4d7db5ab42
commit 2971dd80c2
3 changed files with 19 additions and 1 deletions

View File

@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY
REVISION "201304130000Z"
DESCRIPTION
"Initial revision."
REVISION "201307010000Z"
DESCRIPTION
"Added hastResourceWorkerPid."
::= { begemot 220 }
begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 }
@ -116,7 +119,8 @@ HastResourceEntry ::= SEQUENCE {
hastResourceReadErrors Counter64,
hastResourceWriteErrors Counter64,
hastResourceDeleteErrors Counter64,
hastResourceFlushErrors Counter64
hastResourceFlushErrors Counter64,
hastResourceWorkerPid INTEGER
}
hastResourceIndex OBJECT-TYPE
@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE
"Count of resource local flush operations that failed."
::= { hastResourceEntry 21 }
hastResourceWorkerPid OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Worker process ID."
::= { hastResourceEntry 22 }
END

View File

@ -78,6 +78,7 @@ struct hast_snmp_resource {
uint64_t write_errors;
uint64_t delete_errors;
uint64_t flush_errors;
pid_t workerpid;
};
static TAILQ_HEAD(, hast_snmp_resource) resources =
@ -343,6 +344,7 @@ update_resources(void)
nv_get_uint64(nvout, "stat_delete_error%u", i);
res->flush_errors =
nv_get_uint64(nvout, "stat_flush_error%u", i);
res->workerpid = nv_get_int32(nvout, "workerpid%u", i);
TAILQ_INSERT_TAIL(&resources, res, link);
}
nv_free(nvout);
@ -498,6 +500,9 @@ op_hastResourceTable(struct snmp_context *context __unused,
case LEAF_hastResourceFlushErrors:
value->v.counter64 = res->flush_errors;
break;
case LEAF_hastResourceWorkerPid:
value->v.integer = res->workerpid;
break;
default:
ret = SNMP_ERR_RES_UNAVAIL;
break;

View File

@ -59,6 +59,7 @@
(19 hastResourceWriteErrors COUNTER64 GET)
(20 hastResourceDeleteErrors COUNTER64 GET)
(21 hastResourceFlushErrors COUNTER64 GET)
(22 hastResourceWorkerPid INTEGER GET)
)
)
)