Please help me in solving the issue. Thanks in advance.
Subject: |
RE: COMMAND data source testing failing |
Author: |
Jane Curry |
Posted: |
2018-09-11 04:43 |
I have set up the same template and it works for me - no errors. I am on Zenoss 4.2.5 SUP 743.
Bear in mind that a template expects to provide performance data - ie numbers - and your test script doesn't. Different versions of Zenoss may respond differently to this scenario. For example, if there is a datapoint in your performance template then it probably will fail.
Try running zencommand standalone in debug against your test device, for example:
zencommand run -v 10 -d zen42.class.example.org > /tmp/fred 2>&1
and then inspect /tmp/fred, looking for the name of your template.
If you want a little test script that runs a COMMAND and generates numbers, I use the following:
[zenoss@zen42 local]$ cat test.sh
#!/bin/sh
# Nagios return codes
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
#
exitstatus=$STATE_OK
# Nagios format echos information and status followed by pipe |
# followed by <var name>=<value> tuples
# Note that Zenoss datapoints must match these var names exactly
#
echo "This is a test - status OK | timevar=74s sizevar=9B percentvar=10% countervar=123c"
exit $exitstatus
Make sure that your template has datapoints for timevar, sizevar percentvar and countervar.
Cheers,
Jane
------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------