Search code examples
zabbix

Output from a curl command using system.run


I have an active Zabbix item running a curl command on my server.

Key: system.run[curl http://localhost:8080/mypage]

When I run this curl command manually the output is a number, but in Zabbix I get:

Output:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100     3  100     3    0     0    434      0 --:--:-- --:--:-- --:--:--   500
146

The only thing I want to see is the '146' at the end, can I stop Zabbix from outputting the other information.

Preferably I would like the data type to be numeric - decimal but I'm having to set it to text for the item to work. Am I going about this the wrong way?


Solution

  • Add -s (--silent) parameter to curl, like so:

    system.run[curl -s http://localhost:8080/mypage]