Ad Widget

Collapse

Windows environment variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xibbaz
    Member
    Zabbix Certified Specialist
    • Jun 2009
    • 74

    #1

    Windows environment variables

    How do you retreive them?

    I would like to have a key "system.environment" to retreive any variables on a windows system.

    I tried several version:
    - Putting %VAR% in the item definition and system.environement[*], echo $1
    - Putting VAR in the item definition and system.environement[*], echo %$1%
    - Tried with cmd /c, with and without quotes, etc...

    All the client does is returning the exact string I sent to it plus whatever is in the echo command.

    To be clear, I wish to retreive windows environement variable to the zabbix server.
  • Anth0ny
    Member
    • Nov 2009
    • 85

    #2
    Originally posted by xibbaz
    How do you retreive them?

    I would like to have a key "system.environment" to retreive any variables on a windows system.

    I tried several version:
    - Putting %VAR% in the item definition and system.environement[*], echo $1
    - Putting VAR in the item definition and system.environement[*], echo %$1%
    - Tried with cmd /c, with and without quotes, etc...

    All the client does is returning the exact string I sent to it plus whatever is in the echo command.

    To be clear, I wish to retreive windows environement variable to the zabbix server.
    =)

    try like this:

    Description: CMD – Get Host CPU Count
    Type: ZABBIX agent
    Key: system.run[cmd /c @echo %NUMBER_OF_PROCESSORS%]
    Type of information: Text

    For full list of available variables, enter at cmd console SET command.

    Comment

    • xibbaz
      Member
      Zabbix Certified Specialist
      • Jun 2009
      • 74

      #3
      Dho! Works for system variables, not users. I'll try with zabbix_sender and a trapper on the server.

      Comment

      • Anth0ny
        Member
        • Nov 2009
        • 85

        #4
        works for all variables, accessed for agent's account.

        Comment

        • xibbaz
          Member
          Zabbix Certified Specialist
          • Jun 2009
          • 74

          #5
          And that too, of course We have a client software for which the server to connect to is define in a user's variable. We which to be alerted if that variable is not set to what is expected for each client.

          Comment

          • jzondervan
            Junior Member
            • Jul 2010
            • 19

            #6
            Every found a solution?

            I'd like to read a user envo variable as well, any luck with this?

            Comment

            Working...