Ad Widget

Collapse

Change syslog tag

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #1

    Change syslog tag

    Hello,

    Syslog messages send by ZABBIX Server and Agent can not be parsed correctly because the syslog tag includes a blank:

    - "Zabbix Server"
    - "Zabbix Agent"

    That results for instance in a syslog tag "Zabbix" and a message "Agent (daemon)[32614]: zabbix_agentd listener started"

    Is there any way to change the syslog tag?

    Thanks in advance
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    Fixing the files below solves the problem.
    Code:
    [root@rpmbuild SOURCES]# grep -hom1 "\..*[ch]" *[ch].patch
    ./include/common.h
    ./src/zabbix_proxy/proxy.c
    ./src/zabbix_server/server.c
    ./src/zabbix_agent/zabbix_agent.c
    ./src/zabbix_get/zabbix_get.c
    ./src/zabbix_sender/zabbix_sender.c
    [root@rpmbuild SOURCES]#
    After applying the following patches (r)syslog is able to identify the 'syslogtag' correctly

    Code:
    [root@rpmbuild SOURCES]# cat *[ch].patch
    *** ./include/common.h.orig	Tue Jan  4 14:58:37 2011
    --- ./include/common.h	Fri Feb 11 21:55:51 2011
    ***************
    *** 117,121 ****
      #define OFF	0
      
    ! #define	APPLICATION_NAME	"Zabbix Agent"
      #define	ZABBIX_REVDATE		"4 January 2011"
      #define	ZABBIX_VERSION		"1.8.4"
    --- 117,121 ----
      #define OFF	0
      
    ! #define	APPLICATION_NAME	"Zabbix-Agent"
      #define	ZABBIX_REVDATE		"4 January 2011"
      #define	ZABBIX_VERSION		"1.8.4"
    *** ./src/zabbix_proxy/proxy.c.orig	Tue Jan  4 14:57:50 2011
    --- ./src/zabbix_proxy/proxy.c	Fri Feb 11 21:53:18 2011
    ***************
    *** 48,52 ****
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix Proxy";
      const char	usage_message[] = "[-hV] [-c <file>]";
      
    --- 48,52 ----
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix-Proxy";
      const char	usage_message[] = "[-hV] [-c <file>]";
      
    *** ./src/zabbix_server/server.c.orig	Tue Jan  4 14:57:50 2011
    --- ./src/zabbix_server/server.c	Fri Feb 11 21:53:13 2011
    ***************
    *** 52,56 ****
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix Server";
      const char	usage_message[] = "[-hV] [-c <file>] [-n <nodeid>]";
      
    --- 52,56 ----
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix-Server";
      const char	usage_message[] = "[-hV] [-c <file>] [-n <nodeid>]";
      
    *** ./src/zabbix_agent/zabbix_agent.c.orig	Tue Jan  4 14:57:51 2011
    --- ./src/zabbix_agent/zabbix_agent.c	Fri Feb 11 21:54:05 2011
    ***************
    *** 28,32 ****
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix Agent";
      const char	usage_message[] = "[-Vhp] [-c <file>] [-t <item>]";
      #ifndef HAVE_GETOPT_LONG
    --- 28,32 ----
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix-Agent";
      const char	usage_message[] = "[-Vhp] [-c <file>] [-t <item>]";
      #ifndef HAVE_GETOPT_LONG
    *** ./src/zabbix_get/zabbix_get.c.orig	Tue Jan  4 14:57:51 2011
    --- ./src/zabbix_get/zabbix_get.c	Fri Feb 11 21:53:48 2011
    ***************
    *** 27,31 ****
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix Get";
      const char	usage_message[] = "[-hV] -s <host name or IP> [-p <port>] [-I <IP address>] -k <key>";
      
    --- 27,31 ----
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix-Get";
      const char	usage_message[] = "[-hV] -s <host name or IP> [-p <port>] [-I <IP address>] -k <key>";
      
    *** ./src/zabbix_sender/zabbix_sender.c.orig	Tue Jan  4 14:57:50 2011
    --- ./src/zabbix_sender/zabbix_sender.c	Fri Feb 11 21:53:44 2011
    ***************
    *** 28,32 ****
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix Sender";
      const char	usage_message[] = "[-Vhv] {[-zpsI] -ko | [-zpI] -T -i <file> -r} [-c <file>]";
      
    --- 28,32 ----
      
      const char	*progname = NULL;
    ! const char	title_message[] = "Zabbix-Sender";
      const char	usage_message[] = "[-Vhv] {[-zpsI] -ko | [-zpI] -T -i <file> -r} [-c <file>]";
      
    [root@rpmbuild SOURCES]#

    Comment

    Working...