Ad Widget

Collapse

[patch] for alert.c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amcorreia
    Member
    • Mar 2006
    • 73

    #1

    [patch] for alert.c

    this is a simple patch for alert.c,

    in execl();
    int execl(const char *path, const char *arg, ...);

    if /*path/ contain a initial white space the command not is executed.

    follow is from my zabbix_server.log
    ----cut----

    002340:20060811:140038 Parameter [net.if.in[int]] became supported by agent on host [fw1b]
    002340:20060811:140107 Parameter [net.if.in[int]] is not supported by agent on host [fw1b] Old status [0]
    002327:20060811:140116 Unsupported media type [3] for alert ID [2132]
    002327:20060811:140116 Unsupported media type [3] for alert ID [2135]
    008383:20060811:140316 Error executing [ /home/zabbix/bin/zabbix_envia_email.sh] [No such file or directory]
    002327:20060811:140332 Unsupported media type [3] for alert ID [2137]
    002327:20060811:140332 Unsupported media type [3] for alert ID [2140]

    ----cut----



    --- zabbix-1.1.1.ori/src/zabbix_server/alerter/alerter.c Fri Jun 2 10:49:14 2006
    +++ zabbix-1.1.1/src/zabbix_server/alerter/alerter.c Fri Aug 11 15:23:17 2006
    @@ -135,6 +135,7 @@ static int execute_action(DB_ALERT *aler
    strscpy(full_path,CONFIG_ALERT_SCRIPTS_PATH);
    strncat(full_path,"/",MAX_STRING_LEN);
    strncat(full_path,mediatype->exec_path,MAX_STRING_LEN);
    + ltrim_spaces (full_path);
    zabbix_log( LOG_LEVEL_DEBUG, "Before executing [%s] [%m]", full_path);
    if(-1 == execl(full_path,mediatype->exec_path,alert->sendto,alert->subject,alert->message,(char *)0))
    {
    Attached Files
    Last edited by amcorreia; 15-08-2006, 15:09.
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,

    Nice catch Amcorreia. I have added this to a patch I am building for the CVS repository for inclusion in 1.1.3.
    Unofficial Zabbix Developer

    Comment

    • James Wells
      Senior Member
      • Jun 2005
      • 664

      #3
      This has now been submitted to CVS
      Unofficial Zabbix Developer

      Comment

      Working...