summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/zbxsysinfo/Makefile.am2
-rw-r--r--src/libs/zbxsysinfo/file.c2
-rw-r--r--src/libs/zbxsysinfo/sysinfo.c5
-rw-r--r--src/libs/zbxsysinfo/system.c34
4 files changed, 40 insertions, 3 deletions
diff --git a/src/libs/zbxsysinfo/Makefile.am b/src/libs/zbxsysinfo/Makefile.am
index d4ee27ca..558d7c8e 100644
--- a/src/libs/zbxsysinfo/Makefile.am
+++ b/src/libs/zbxsysinfo/Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS=
lib_LIBRARIES=libzbxsysinfo.a
-libzbxsysinfo_a_SOURCES=cpu.c diskio.c diskspace.c file.c inodes.c memory.c sensors.c swap.c uptime.c sysinfo.c
+libzbxsysinfo_a_SOURCES=cpu.c diskio.c diskspace.c file.c inodes.c memory.c sensors.c swap.c uptime.c sysinfo.c system.c
libzbxsysinfo_a_LIBADD = ../zbxcrypto/libzbxcrypto.a
diff --git a/src/libs/zbxsysinfo/file.c b/src/libs/zbxsysinfo/file.c
index 36ad20cc..851cb8e6 100644
--- a/src/libs/zbxsysinfo/file.c
+++ b/src/libs/zbxsysinfo/file.c
@@ -82,7 +82,7 @@
#include "common.h"
#include "sysinfo.h"
-int FILESIZE(const char *cmd, const char *filename,double *value)
+int FS_FILE_SIZE(const char *cmd, const char *filename,double *value)
{
struct stat buf;
diff --git a/src/libs/zbxsysinfo/sysinfo.c b/src/libs/zbxsysinfo/sysinfo.c
index 0908bb40..0ba98190 100644
--- a/src/libs/zbxsysinfo/sysinfo.c
+++ b/src/libs/zbxsysinfo/sysinfo.c
@@ -175,7 +175,9 @@ COMMAND agent_commands[]=
{"md5sum[*]" ,0, MD5SUM, "/etc/services"},
- {"filesize[*]" ,FILESIZE, 0, "/etc/passwd"},
+ {"filesize[*]" ,FS_FILE_SIZE, 0, "/etc/passwd"},
+ {"fs.file.size[*]" ,FS_FILE_SIZE, 0, "/etc/passwd"},
+
{"file[*]" ,ISFILE, 0, "/etc/passwd"},
{"cpu[idle1]" ,CPUIDLE1, 0, 0},
@@ -249,6 +251,7 @@ COMMAND agent_commands[]=
{"system[procrunning]" ,EXECUTE, 0, "cat /proc/loadavg|cut -f1 -d'/'|cut -f4 -d' '"},
#endif
{"system[hostname]" ,0, EXECUTE_STR, "hostname"},
+ {"system.localtime" ,SYSTEM_LOCALTIME, 0, 0},
{"system[uname]" ,0, EXECUTE_STR, "uname -a"},
{"system[uptime]" ,UPTIME, 0, 0},
{"system[users]" ,EXECUTE, 0,"who|wc -l"},
diff --git a/src/libs/zbxsysinfo/system.c b/src/libs/zbxsysinfo/system.c
new file mode 100644
index 00000000..87a712f1
--- /dev/null
+++ b/src/libs/zbxsysinfo/system.c
@@ -0,0 +1,34 @@
+/*
+** ZABBIX
+** Copyright (C) 2000-2005 SIA Zabbix
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**/
+
+#include "config.h"
+
+#include <time.h>
+
+#include "common.h"
+#include "sysinfo.h"
+
+int SYSTEM_LOCALTIME(const char *cmd, const char *parameter,double *value)
+{
+ int ret = SYSINFO_RET_OK;
+
+ *value=(double)time(NULL);
+
+ return ret;
+}