Ad Widget

Collapse

external check script get liunx host environment variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • menghao
    Junior Member
    • Oct 2017
    • 4

    #1

    external check script get liunx host environment variables

    Hi all,
    i have a shell scripts , and use external checks type.

    in my linux system i have a environment variables. for example
    " export test='xxx' ";

    when i run script from zabbix , i can't get the test value.


    so , how to get clinet environment variables from zabbix run shell.

    If someone has any idea, thank you.
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    Hello !

    Are you trying to get zabbix user environment variables ?
    Which OS are you using ?

    Regards,
    Kaspars

    Comment

    • menghao
      Junior Member
      • Oct 2017
      • 4

      #3
      think your reply

      I‘m use CentOS 7.2

      Comment

      • voculus
        Junior Member
        • Dec 2017
        • 3

        #4
        Getting environment variables from a bash script into a global macro

        Hi,

        I also have a requirement where I run an snmpbulkget to query a master switch for the number of stack members in a switch stack and construct the necessary OIDs to get the serial numbers of each stack member.

        How can I reference bash environment variables run by a bash script (by the zabbix user) and put it into a global macro?

        Alternatively, would it be possible to periodically scan the contents of a file (which contains a list of SNMP numeric OIDs) and put them as individual global macros?

        Thanks.

        Comment

        Working...