diff options
Diffstat (limited to 'src/libs/zbxsysinfo/openbsd/boottime.c')
-rw-r--r-- | src/libs/zbxsysinfo/openbsd/boottime.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/zbxsysinfo/openbsd/boottime.c b/src/libs/zbxsysinfo/openbsd/boottime.c index 94bc9d80fd7..0deacfe5b68 100644 --- a/src/libs/zbxsysinfo/openbsd/boottime.c +++ b/src/libs/zbxsysinfo/openbsd/boottime.c @@ -19,6 +19,7 @@ #include "common.h" #include "sysinfo.h" +#include "log.h" int SYSTEM_BOOTTIME(AGENT_REQUEST *request, AGENT_RESULT *result) { @@ -33,12 +34,17 @@ int SYSTEM_BOOTTIME(AGENT_REQUEST *request, AGENT_RESULT *result) len = sizeof(struct timeval); if (-1 == sysctl(mib, 2, &boottime, &len, NULL, 0)) + { + SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot obtain system information: %s", zbx_strerror(errno))); return SYSINFO_RET_FAIL; + } SET_UI64_RESULT(result, boottime.tv_sec); return SYSINFO_RET_OK; #else + SET_MSG_RESULT(result, zbx_strdup(NULL, "Agent was compiled without support for \"kern.boottime\" system" + " parameter.")); return SYSINFO_RET_FAIL; -#endif /* HAVE_FUNCTION_SYSCTL_KERN_BOOTTIME */ +#endif } |