diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-10-09 21:02:01 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-10-09 21:02:01 +0300 |
commit | ea8c4c7782bedfea75156a8e574c83590de141f3 (patch) | |
tree | 3b2d9db1b9b06075e627c9c8382507629ef495d8 | |
parent | a0338af56fec5eb90a5f7f968d6eb67b5b8ad3dd (diff) | |
download | hostproc-ea8c4c7782bedfea75156a8e574c83590de141f3.tar.gz hostproc-ea8c4c7782bedfea75156a8e574c83590de141f3.tar.bz2 |
Reorganize OIDs
-rw-r--r-- | HOSTPROC-MIB.txt | 26 | ||||
-rw-r--r-- | config.c | 2 | ||||
-rw-r--r-- | hostproc.8 | 60 | ||||
-rw-r--r-- | hostproc_mib.mib2c | 4 |
4 files changed, 54 insertions, 38 deletions
diff --git a/HOSTPROC-MIB.txt b/HOSTPROC-MIB.txt index 1166740..aaf326a 100644 --- a/HOSTPROC-MIB.txt +++ b/HOSTPROC-MIB.txt @@ -14,24 +14,34 @@ IMPORTS FROM SNMPv2-TC; hostprocMIB MODULE-IDENTITY - LAST-UPDATED "202010091021Z" + LAST-UPDATED "202010091559Z" ORGANIZATION "Gray Software" CONTACT-INFO "Sergey Poznyakoff <gray@gnu.org>" DESCRIPTION "This MIB module defines objects for detailed host processes statistics." - REVISION "202010091021Z" + REVISION "202010091559Z" DESCRIPTION "First release." ::= { enterprises 9163 104 } +hostprocManagement OBJECT IDENTIFIER ::= { hostprocMIB 1 } + hostprocUpTime OBJECT-TYPE SYNTAX TimeStamp MAX-ACCESS read-only STATUS current DESCRIPTION "Total uptime of the Hostproc SNMP agent." - ::= { hostprocMIB 1 } + ::= { hostprocManagement 1 } + +processGroupModify OBJECT-TYPE + SYNTAX OCTET STRING (SIZE(0..1024)) + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "String which when set, registers new group." + ::= { hostprocManagement 2 } ProcessEntry ::= SEQUENCE { processIndex Integer32, @@ -629,15 +639,7 @@ processExcludedRSS OBJECT-TYPE total RSS becomes greater than this value." ::= { processExcludedEntry 17 } -processGroupMgmt OBJECT-TYPE - SYNTAX OCTET STRING (SIZE(0..1024)) - MAX-ACCESS read-write - STATUS current - DESCRIPTION - "String which when set, registers new group." - ::= { hostprocMIB 5 } - -hostMemInfo OBJECT IDENTIFIER ::= { hostprocMIB 6 } +hostMemInfo OBJECT IDENTIFIER ::= { hostprocMIB 5 } hostMemTotal OBJECT-TYPE SYNTAX Gauge32 @@ -979,7 +979,7 @@ static struct hostproc_mib_config config[] = { parse_config_rss }, { "cpu", "PCT", parse_config_cpu }, - { "defgroup", NULL, + { "defgroup", "excl:1|0 name:STRING pattern:STRING field:0|1|2 match:0|1|2 min_count:NUMBER max_count:NUMBER vsize_max:NUMBER rss_max:NUMBER cpu_max:NUMBER", parse_config_defgroup }, { NULL } }; @@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License along .\" with hostproc. If not, see <http://www.gnu.org/licenses/>. */ -.TH HOSTPROC 8 "October 2, 2020" "HOSTPROC" "System Manager's Manual" +.TH HOSTPROC 8 "October 9, 2020" "HOSTPROC" "System Manager's Manual" .SH NAME hostproc \- process list SNMP agent .SH SYNOPSIS @@ -62,29 +62,39 @@ foreground and to log its diagnostics on the standard error. .SH MIB Please see the file \fBHOSTPROC-MIB.txt\fR for the description of OID instances returned by \fBhostproc\fR. In general, they fall into the -following four categories: general information variables, the -\fBprocessTable\fR subtree, the \fBprocessGroupTable\fR subtree and the -\fBprocessExcludedTable\fR subtree. -.SS General variables +following five categories: management variables, process table, +process group table, exclusion group table and system memory +information. +.SS Management variables These supply information about the running instance of -\fBhostproc\fR. As of version 0.1, this group contains only one OID: -\fBhostprocUpTime\fR, which holds the number of seconds expired +\fBhostproc\fR and provide facilities for its remote management. +.PP +The \fBhostprocUpTime\fR variable holds the number of seconds expired since the program was started. -.SS processTable -This table contains information about running processes. Each -conceptual row represents a single process. It contains the following -information: PID, parent PID, UID, GID, CPU usage (percent), CPU time -used in this process, process state, nice and priority values, virtual -and resident set sizes, process name (argv[0]), process command line, -and process executable file name. +.PP +The \fBprocessGroupModify\fR variable, when set to a correctly +formatted JSON request, applies the requested modifications to a +process group (see below). This allows the administrator to create, +delete or modify groups remotely. It is used, in particular, by the +.BR stevedore (8) +SNMP agent to reflect the information about running docker services in +the exclusion group table. +.SS Process table +The \fBprocessTable\fR subtree contains information about running +processes. Each conceptual row represents a single process. It +contains the following information: PID, parent PID, UID, GID, average +and instantaneous CPU usage (percent), CPU time used in this process, +process state, nice and priority values, virtual and resident set +sizes, process name (argv[0]), process command line, and process +executable file name. .PP The table is indexed by the process ID (PID). -.SS processGroupTable -The entries in this table aggregate information about processes with -names matching a certain pattern, defined in the configuration file. -Here, the "name" can be the process argv[0] name, the executable name, -or the full command line. Either exact or regular expression matching -can be used. +.SS Process groups +The entries in the \fBprocessGroupTable\fR aggregate information about +processes with names matching a certain pattern, defined in the +configuration file. Here, "name" can be the process argv[0] name, +the executable name, or the full command line. Either exact or +regular expression matching can be used. .PP The group definition in the configuration file can impose limits on one or more of the following parameters: minimum and maximum number of @@ -96,8 +106,8 @@ The information included in each processGroupTable entry is: process matching criteria (the field of the processTable entry used for selection and the type of matching implemented), the process OK status, the actual number of processes in this group, the total amount of -virtual memory and RSS they occupy, total CPU time and CPU usage (in -percent), as well as the limits configured for these values. +virtual memory and RSS they occupy, average, instantaneous and maximum +CPU usage, as well as the limits configured for these values. .SS processExcludedTable This table hosts exclusion process groups. An exclusion group aggregates processes that descend from a common set of ancestor @@ -110,6 +120,9 @@ the exclusion group. Each entry in this table describes a single exclusion group and has the same structure as the \fBprocessGroupTable\fR. In particular, the same set of limits can be imposed on the processes in this group. +.SS System memory information +The \fBhostMemInfo\fR subtree contains information about available and +free amount of RAM and swap. .SH OPTIONS .TP .B \-A @@ -285,7 +298,8 @@ The MIB in \fBHOSTPROC-MIB.txt\fR. .sp .BR snmpd (8), .BR snmpd.conf (5), -.BR snmpcmd (1). +.BR snmpcmd (1), +.BR stevedore (8). .SH AUTHORS Sergey Poznyakoff .SH "BUG REPORTS" diff --git a/hostproc_mib.mib2c b/hostproc_mib.mib2c index 596429f..4155bea 100644 --- a/hostproc_mib.mib2c +++ b/hostproc_mib.mib2c @@ -24,8 +24,8 @@ @startperl@ $vars{'hostproc_translate_table'} = { hostprocUpTime => { get => qw{agent_hostprocUpTime()} }, - processGroupMgmt => { get => qw{""}, - set_action => qw{hostproc_group_mgmt_set} }, + processGroupModify => { get => qw{""}, + set_action => qw{hostproc_group_mgmt_set} }, hostMemTotal => { get => qw(meminfo.mem_total) }, hostMemFree => { get => qw(meminfo.mem_free) }, hostMemAvailable => { get => qw(meminfo.mem_available) }, |