Ad Widget

Collapse

Escaping character in windows service_state

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andreas Bollhalder
    Senior Member
    Zabbix Certified Specialist
    • Apr 2007
    • 144

    #1

    Escaping character in windows service_state

    Hello

    I have a problem with monitoring a windows service under ZABBIX v1.4. Because I'm unable to use the internal Service Name, I use the Display Name. This works for all services, only for one it won't. The reason is, that the name has an ampersant "&" in its name.

    How can I escape this character in service_state ? I tried "^&", but that doesn't work.

    Better would be to use the Service Name from the windows host. Unfortunatly as stated, this doesn't work on my installation.

    I have both v1.4 of the server and agent (win32). The server to monitor is a Windows 2000 Standard Server.

    Any suggestions ?

    Andreas
    Zabbix statistics
    Total hosts: 380 - Total items: 12190 - Total triggers: 4530 - Required server performance: 224.2
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Please give us a full name which does not work.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Andreas Bollhalder
      Senior Member
      Zabbix Certified Specialist
      • Apr 2007
      • 144

      #3
      First I have to say, that I'm using templates. My template names start with an "_".

      The "display name" of the windows service is:
      "Backup Exec Device & Media Service"

      The "service Name" is:
      BackupExecDeviceMediaService

      The key of the item is:
      service_state[Backup Exec Device & Media Service]

      The Expression of the trigger is:
      {_s_windows-backupexec:service_state[Backup Exec Device & Media Service].last(0)}#0

      Zabbix tells me, that an "&" is invalid. So I tried "^&" which will be accepted, but the value of the windows service is always 255.

      Andreas
      Zabbix statistics
      Total hosts: 380 - Total items: 12190 - Total triggers: 4530 - Required server performance: 224.2

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        I'm not sure what you mean. Does ZABBIX complain about the trigger expression?
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • NOB
          Senior Member
          Zabbix Certified Specialist
          • Mar 2007
          • 469

          #5
          Originally posted by Andreas Bollhalder
          Hello

          I have a problem with monitoring a windows service under ZABBIX v1.4. Because I'm unable to use the internal Service Name, I use the Display Name.

          ...
          Sorry, no suggestion, here.
          But your expirience is right, you have to use the display name for
          monitoring windows services.
          This is in contradiction to the manual.

          Regards,

          Norbert.

          Comment

          • Andreas Bollhalder
            Senior Member
            Zabbix Certified Specialist
            • Apr 2007
            • 144

            #6
            Hello Alexei

            When creating the item with a key containing an "&" in the service name, ZABBIX tells me:

            Code:
            [B][ERROR: Cannot add item][/B]
            Key should contain '[]0-9a-zA-Z!_,:()+.*\ $'- characters only
            Therefore, I can't create a trigger, because I can't create the item to monitor.

            The question is, how can I monitor a Windows service which contains an "&" in its Display Name.

            Andreas
            Zabbix statistics
            Total hosts: 380 - Total items: 12190 - Total triggers: 4530 - Required server performance: 224.2

            Comment

            • Eugene
              Member
              • Feb 2006
              • 57

              #7
              You can use this simple patch.
              Attached Files

              Comment

              • Andreas Bollhalder
                Senior Member
                Zabbix Certified Specialist
                • Apr 2007
                • 144

                #8
                Hello Eugene

                Thank you very much! I applied the patch and now its working fine. Hopefully, this will be included in v1.4.1.

                Andreas
                Zabbix statistics
                Total hosts: 380 - Total items: 12190 - Total triggers: 4530 - Required server performance: 224.2

                Comment

                • jas
                  Junior Member
                  • May 2007
                  • 4

                  #9
                  I can't get the state for a service name containing square brackets, []
                  It returns 255. Other service states are OK.

                  Do those characters have to be escaped ?

                  Comment

                  Working...