Ad Widget

Collapse

Start script on specific host via email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galavichid
    Member
    • Mar 2021
    • 40

    #1

    Start script on specific host via email

    Hi,

    I am looking for idea how can I start batch file on zabbix host (windows based) monitored by agent2 by sending e-mail with specific subject to trigger the zabbix starting the script.

    By now, I have added the script via zabbix web interface, add new key in zabbix.conf (agent) and i can start the script via the interface (pressing on the host, choosing the script)

    for the next step i am looking for a way to trigger this process easily, by phone from everywhere, and i think that maybe e-mail will be the easiest and possible,

    any ideas or other solution are welcome !

    thank you!
  • TheOddPerson
    Junior Member
    • Feb 2024
    • 12

    #2

    This sounds like a very bad idea. I hope you're doing it on your your homelab and not production somewhere.
    How does the zabbix server you know the e-mail received is legit?
    How does the zabbix server know if the batch file has not been altered?
    I would start by using a signed powershell script and some action that isnt harmful if triggered and unnecessary

    but those concerns aside you could write a script to check for e-mail and provide the contents as items that are exposed to the zabbix agent via something like a registry key or event log
    You would run this on one of your client devices then configure a trigger and action to do what you need.



    Comment


    • galavichid
      galavichid commented
      Editing a comment
      Ill give you the problem, maybe it will clear things up

      I would like to have the option to turn off environment, with my phone.
      In case someone forgot the environment on, I get notify its still on. then I would like to be able to run the 'shutdown' script from my phone.
      I think that doing it via e-mail would be the easiest. I can login to my zabbix web with VPN and scroll around find the host and run the action manually, but I would like to simplify it.
      The small trick with the shutdown its not 100% always someone forgot, there are still a chance someone left it on with a reason.
Working...