Ad Widget

Collapse

Zabbix trapperr shell script output to zabbix_sender

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dragan979
    Member
    • Apr 2018
    • 49

    #1

    Zabbix trapperr shell script output to zabbix_sender


    I have powershell script which monitors MS Azure Status
    Script output:

    <?xml version="1.0" encoding="utf-8"?> <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"> <channel xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <title>Azure Status</title> <link>https://azure.microsoft.com/en-us/status/</link> <description>Azure Status</description> <language>en-US</language> <lastBuildDate>Mon, 27 Aug 2018 13:14:55 Z</lastBuildDate> </channel> </rss> On : All services are working properly I want to send this output to Zabbix server. I created item status.azure-type:zabbix trapper-Type of information:text i installed powershell on Zabbix server and created a bash script to run powershell.Script works without issues
    created a script:

    .
    Code:
    /1.sh
    zabbix_sender -z localhost -s "London" -k status.azure -o 1.sh
    this script send 1.sh as value to zabbix

    Is there a way, apart from UserParameters to send script output to Zabbix ?
  • dragan979
    Member
    • Apr 2018
    • 49

    #2
    solved:
    Code:
     out=$(pwsh /usr/lib/zabbix/externalscripts/1.ps1)
    zabbix_sender -z localhost -p 10051 -s "London" -k status.azure -o "$out"

    Comment

    Working...