I've got a Zabbix discovery rule for Windows servers to run a powershell script and return some SQL instance and database names. This Zabbix agent version (3.4.6) and configuration is working perfectly for the discovery on dozens of other servers, but for some reason this server in particular is adding extra text to the output, which renders the JSON invalid.
Here's a sample of a zabbix_get against that host:
[root@zabbix]# zabbix_get -s host1 -k mssql.db.discovery
Active code page: 1252
{
"data":[
{ "{#INST}" : "Instance1", "{#DBNAME}" : "Database1" },
{ "{#INST}" : "Instance1", "{#DBNAME}" : "Database2" }
]
}
The "Active code page: 1252" message is breaking the JSON. I have a feeling that this is an encoding issue, but I'm not sure where it could be. All of the configs and scripts were copied from the same source that the working servers got theirs from, so I don't know what the difference is.
Interestingly, it isn't just limited to powershell scripts. Running a simple command also generates the message:
[root@zabbix]# zabbix_get -s host1 -k system.run["hostname.exe"]
Active code page: 1252
host1
And another note - running zabbix_agentd.exe -t "mssql.db.discovery"
on the host in question also produces the same message. But, executing the script by itself in Powershell ISE, on that host, doesn't produce that message.
My question is this - does anyone know of a way to stop Windows/Zabbix from adding that message, or a workaround to keep it from breaking my JSON?