Results 1 to 5 of 5

Thread: Which are the allowed chars in macro arguments ?

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    3

    Which are the allowed chars in macro arguments ?

    Hello,

    I'm using shinken 0.8 on Debian Squeeze.
    I'm trying to use a semi colon ( ; ) in a macro argument but it does not work.

    Here is the configuration I use :

    Code:
    define command {
     command_name launch-command
     command_line /etc/shinken/eventhandlers/launch-command.bash "$HOSTNAME$" "$SERVICEDESC$" "$SERVICESTATE$" "$SERVICESTATETYPE$" "$SERVICEATTEMPT$" "$MAXSERVICEATTEMPTS$" "$ARG1$"
    }
    
    define service {
        use           generic-service
        name          test
        host_name        myhost
        check_command      check_snmp_process!toto
    	event_handler_enabled	1
    	event_handler		launch-command!sudo -s pkill toto ; cd /my/path && ./toto
    }
    It seems that the semi-colon is interpreted as a comment mark.

    When I try to escape it with a backslash, shinken arbiter start fail with an error :

    Code:
    Error : the parameter event_handler       launch-command!sudo -s pkill toto } is malformed! (no = sign)
    So here is my question : is there a way to use a semi-colon in a macro argument or maybe should I fill a bug report ?

    Regards,

    Xavier.

  2. #2
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Which are the allowed chars in macro arguments ?

    I think there is no way indeed. I'll try to look for the "\;" way
    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Which are the allowed chars in macro arguments ?

    Ok it's managed ;D

    cf the patch https://github.com/naparuba/shinken/...60e20bda3bd556

    No direct support by personal message. Please open a thread so everyone can see the solution

  4. #4
    Junior Member
    Join Date
    Dec 2011
    Posts
    3

    Re: Which are the allowed chars in macro arguments ?

    Thank you.
    I'm really impressed by your reactivity !
    I will test this asap.

    Regard.

    Xavier.

  5. #5
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Which are the allowed chars in macro arguments ?

    You're welcome
    No direct support by personal message. Please open a thread so everyone can see the solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •