Zabbix trapperr Shell脚本输出到zabbix_sender

时间:2018-08-27 13:20:52

标签: bash powershell zabbix

我有用于监视MS Azure状态的Powershell脚本

脚本输出:

<?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

我想将此输出发送到Zabbix服务器。我创建了项目status.azure-type:z​​abbix trapper-信息类型:text 我在Zabbix服务器上安装了powershell并创建了一个bash脚本来运行powershell.Script可以正常工作

创建了一个脚本:

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

我在zabbix中得到以下输出:

2018-08-27 16:38:43

[3;J[H[2J



                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <?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>http://azure.microsoft.com/en-us/status/</link>

    <description>Azure Status</description>

    <language>en-US</language>

    <lastBuildDate>Mon, 27 Aug 2018 14:38:43 Z</lastBuildDate>

  </channel>

</rss>
 On : All services are working properly

有人可以解释[3;J[H[2J是什么意思吗?

0 个答案:

没有答案
相关问题