Hey, I've read the related docs and configured a both a UserParameter and a few items.
The client here is Windows, though that mostly doesn't matter. Expect for Cmdline-quoting/escaping and the Active agent.
The UserParameter is configured like so:
zbx-filemon.exe is a custom tool that returns a JSON object like:
The tool, like you probably guessed, globs some files and sums the total size.
Now, the main item is setup like so:
with depended items (only showing one for brevity):
But the Zabbix server either never gets any data or discards it(?). That is "latest data" remains blank.
From the host, I know that the tool gets invoked by the Zabbix agent and it doesn't log any errors:
A note/rant about the UserParameter escape/quoting situation. This and/or this is, almost guaranteed not, what anyone wants.
It makes quoting a PITA or straight impossible.
The solution here is to call CreateProcessW and let the user worry about properly using UserParameter.
Whatever is the first (or only) value should be used passed as lpApplicationName and the rest (if any) is lpCommandLine, as is.
Should lpApplicationName contain spaces, then the user has to quote it.
Back on topic. Please tell me what I can fix or am missing.
The client here is Windows, though that mostly doesn't matter. Expect for Cmdline-quoting/escaping and the Active agent.
The UserParameter is configured like so:
Code:
UserParameter=filemon.example,C:\zbx-filemon.exe C:\Example\**\*.example
Code:
{
file_count: 1,
total_size: 1000,
globs: "C:\Some\Directory\**\*.example"
}
Now, the main item is setup like so:
with depended items (only showing one for brevity):
But the Zabbix server either never gets any data or discards it(?). That is "latest data" remains blank.
From the host, I know that the tool gets invoked by the Zabbix agent and it doesn't log any errors:
A note/rant about the UserParameter escape/quoting situation. This and/or this is, almost guaranteed not, what anyone wants.
It makes quoting a PITA or straight impossible.
The solution here is to call CreateProcessW and let the user worry about properly using UserParameter.
Whatever is the first (or only) value should be used passed as lpApplicationName and the rest (if any) is lpCommandLine, as is.
Should lpApplicationName contain spaces, then the user has to quote it.
Back on topic. Please tell me what I can fix or am missing.
Comment