Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuris Miščenko <git-no-reply@zabbix.com>2014-09-03 18:36:18 +0400
committerJuris Miščenko <git-no-reply@zabbix.com>2014-09-03 18:36:18 +0400
commit1ef2f8bf39f99b300361c37bd48685fa39ac1910 (patch)
tree49dbd0bed6f9956184650ba8d9dac2959d374818
parent4a9f7b7b4277c0f731b9ae97b3cacc9fdb13353b (diff)
.......... [ZBXNEXT-2325] added two new request types to system.cpu.util to support guest and guest_nice statistics on linux
-rw-r--r--include/sysinfo.h4
-rw-r--r--src/libs/zbxsysinfo/linux/cpu.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/include/sysinfo.h b/include/sysinfo.h
index 4d48cda4d05..aa5a1701719 100644
--- a/include/sysinfo.h
+++ b/include/sysinfo.h
@@ -141,7 +141,9 @@ extern int CONFIG_UNSAFE_USER_PARAMETERS;
#define ZBX_CPU_STATE_IOWAIT 5
#define ZBX_CPU_STATE_SOFTIRQ 6
#define ZBX_CPU_STATE_STEAL 7
-#define ZBX_CPU_STATE_COUNT 8
+#define ZBX_CPU_STATE_GCPU 8
+#define ZBX_CPU_STATE_GNICE 9
+#define ZBX_CPU_STATE_COUNT 10
#define ZBX_PROC_STAT_ALL 0
#define ZBX_PROC_STAT_RUN 1
diff --git a/src/libs/zbxsysinfo/linux/cpu.c b/src/libs/zbxsysinfo/linux/cpu.c
index 5abeb9d7c4b..91f13c4b0ce 100644
--- a/src/libs/zbxsysinfo/linux/cpu.c
+++ b/src/libs/zbxsysinfo/linux/cpu.c
@@ -140,6 +140,10 @@ int SYSTEM_CPU_UTIL(AGENT_REQUEST *request, AGENT_RESULT *result)
state = ZBX_CPU_STATE_SOFTIRQ;
else if (0 == strcmp(tmp, "steal"))
state = ZBX_CPU_STATE_STEAL;
+ else if (0 == strcmp(tmp, "guest"))
+ state = ZBX_CPU_STATE_GCPU;
+ else if (0 == strcmp(tmp, "guest_nice"))
+ state = ZBX_CPU_STATE_GNICE;
else
{
SET_MSG_RESULT(result, zbx_strdup(NULL, "Invalid second parameter."));