"LC_ALL=C pacman -Qi 2>/dev/null | grep -E '^(Name|Installed Size|Version|Architecture|(Install|Build) Date)' | cut -f2- -d: | paste -d, - - - - - -",
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#define SW_OS_FULL "/proc/version"
#define SW_OS_SHORT "/proc/version_signature"
#define SW_OS_NAME "/etc/issue.net"
#define SW_OS_NAME_RELEASE "/etc/os-release"
#define SW_OS_OPTION_PRETTY_NAME "PRETTY_NAME"
#define TIME_FMT "%a %b %e %H:%M:%S %Y"
int system_sw_arch(AGENT_REQUEST *request, AGENT_RESULT *result)
SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot obtain system information: %s", zbx_strerror(errno)));
SET_STR_RESULT(result, zbx_strdup(NULL, name.machine));
static int get_line_from_file(char **line, int size, FILE *f)
if (NULL == fgets(*line, size, f))
*line = zbx_strdup(*line, "Cannot read from file.");
zbx_rtrim(*line, ZBX_WHITESPACE);
static int get_os_name(char **line)
char tmp_line[MAX_STRING_LEN];
*line = zbx_malloc(NULL, sizeof(char) * MAX_STRING_LEN);
if (NULL != (f = fopen(SW_OS_NAME_RELEASE, "r")))
char line2[MAX_STRING_LEN];
while (NULL != fgets(tmp_line, sizeof(tmp_line), f))
if (0 != strncmp(tmp_line, SW_OS_OPTION_PRETTY_NAME,
ZBX_CONST_STRLEN(SW_OS_OPTION_PRETTY_NAME)))