Ad Widget

Collapse

Show user who logged in

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • konxsolution
    Junior Member
    • Mar 2016
    • 7

    #1

    Show user who logged in

    Hi Guys,

    Need some help here.

    I have setup actions to run command who -a while user logged is triggered.

    How can I set this to send an email including the logged user to our email?

    Thank you.

    Zabbix 3.0.1
    Agent and Server Host Centos 6.7
    Last edited by konxsolution; 30-03-2016, 02:12.
  • konxsolution
    Junior Member
    • Mar 2016
    • 7

    #2
    Anyone can help us with this?

    Comment

    • LenR
      Senior Member
      • Sep 2009
      • 1005

      #3
      See the use of {ITEM.VALUE1} in the doc https://www.zabbix.com/documentation...eration/macros

      Comment

      • konxsolution
        Junior Member
        • Mar 2016
        • 7

        #4
        Hi, thank you for your reply. We did checked and studied that doc earlier but there is no example pointing out to return the script data, for example, who -a for the remote command.

        Comment

        • akbar415
          Senior Member
          • May 2015
          • 119

          #5
          Originally posted by konxsolution
          Hi, thank you for your reply. We did checked and studied that doc earlier but there is no example pointing out to return the script data, for example, who -a for the remote command.
          Create a script to
          A) Execute who -a
          B) Send a email with the output pf who -a

          Start this script as a action on Zabbix.

          So, instead to execute 'who -a' action, you will execute 'my_script.sh'

          Comment

          • konxsolution
            Junior Member
            • Mar 2016
            • 7

            #6
            Originally posted by akbar415
            Create a script to
            A) Execute who -a
            B) Send a email with the output pf who -a

            Start this script as a action on Zabbix.

            So, instead to execute 'who -a' action, you will execute 'my_script.sh'
            Thank you bro! Definitely will try that out.

            Comment

            • cedric.marcoux
              Junior Member
              • May 2018
              • 10

              #7
              Code:
              system.run[%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy ByPass -nologo -Command "(Get-WMIObject -class Win32_ComputerSystem | select username).username"]

              Comment

              Working...