Ad Widget

Collapse

[1.3.4] Windows agent: service_state returns always 255 ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #1

    [1.3.4] Windows agent: service_state returns always 255 ?

    Hi

    I used the package created by scotty (see http://www.zabbix.com/forum/showthread.php?t=4476 for
    details).

    If I do an zabbix_get from the server:
    Code:
    zabbix_get -si3.xxx.org -k'service_state[Zabbix Agent]'
    0
    it returns, as expected a '0'.

    However, for every other service I tried it returned '255' meaning
    "no such service". This is wrong. Example:
    Code:
    zabbix_get -si3xxx.org -k'service_state[sshd]'
    255
    Regards,

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

    #2
    Solved: is an error in the documentation !

    Hi,

    in contrary to the documentation, the "service display name" must be used
    to request the service state.

    In that case it works perfectly.

    The service name (in the registry) and the display name are the same for the
    "Zabbix Agent", that's why it worked in that case.

    Regards,

    Norbert.

    Comment

    • alnoid
      Junior Member
      • Jul 2008
      • 2

      #3
      Note that in the current install of 1.6, the templates for Exchange server all use the service name (according to registry), not the service display name. So if one uses the default template provided by zabbix, those all fail and need to be changed to the display names.

      I see that this issue was last visited over a year ago--hasn't it been noticed since? It seems that monitoring services would be a common use of zabbix. Or is everybody who uses zabbix lately accustomed to the nuance, so they don't particularly notice it?

      Comment

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

        #4
        Originally posted by alnoid
        Note that in the current install of 1.6, the templates for Exchange server all use the service name (according to registry), not the service display name. So if one uses the default template provided by zabbix, those all fail and need to be changed to the display names.

        I see that this issue was last visited over a year ago--hasn't it been noticed since? It seems that monitoring services would be a common use of zabbix. Or is everybody who uses zabbix lately accustomed to the nuance, so they don't particularly notice it?
        You are right. The documentation should be updated.
        Perhaps an entry in the ZABBIX bug tracker will do it.

        I will add it to my soon to be published "the undocumented ZABBIX"
        or the "ZABBIX - Tips & Tricks" web page.

        We now know what the problem is, though.

        For the general discussion there are pros and cons for both names.
        1. service name does not change for l10n
        2. service display name is shown by net start command


        The first allows unmodified monitoring even if some stupid guy
        installs, say, the german version of McAfee anti-virus on an otherwise
        english OS.
        Guess what happened: instead of McAfee Framework Service we now have
        McAfee Framework-Dienst !

        The second one has the advantage that - if allowed - you can run a
        zabbix_agentd -s Windowshost -k 'system.run[net start]' and get the
        service names to monitor.

        Regards

        Norbert.

        Comment

        • alnoid
          Junior Member
          • Jul 2008
          • 2

          #5
          The second one has the advantage that - if allowed - you can run a
          zabbix_agentd -s Windowshost -k 'system.run[net start]' and get the
          service names to monitor.
          Oooh, I never thought to do that but that sounds really cool.

          my preference is for the service name, not description, because it makes me nervous having all that free-form white space in the item key. Zabbix seems to handle it fine, but a key like: service_state[TCP/IP NetBIOS Helper] feels like something is bound to break. I'm not sure what kind of characters Windows allows in the service name, but I bet they'd let you put a closing bracket in it, which would break the way (I assume) Zabbix parses the name from service_state.

          So, that's my vote!

          Comment

          • moridin777
            Junior Member
            • Nov 2015
            • 7

            #6
            if nothing

            Good afternoon.
            Has anyone got this problem in service_state?
            "not following parameter = value notation"

            When the service zabbiks working correctly. When you add the line and the service is restarted.Get alerts:"not following parameter = value notation".
            But if you do not restart the service, the state of the service is monitored correct on Zabbix server.

            zabbix-conf:
            Code:
            LogFile=c:\tmp\zabbix_agentd.log
            EnableRemoteCommands=1
            LogRemoteCommands=1
            Server=zabbixserver
            UnsafeUserParameters=1
            service_state[Spooler]

            Comment

            Working...