[Check_mk (english)] perfometer advise

David Callahan dwcallahan at gmail.com
Tue Jul 26 22:24:20 CEST 2016


I believe I have figure out my issue.  My works probably are not
technically correct as I'm not a programmer.  Basically I was failing on
the part of the code to "paint" the perf data on the screen.  In my case
this is what I did.

def perfometer_check_mk_idc_rx_level(row, check_command, perf_data):
left = float(perf_data[0][1])
warn = float(perf_data[0][3])
crit = float(perf_data[0][4])
if left >= crit:
color = "#ff0000"
elif left <= warn:
color = "#ffff00"
else:
color = "#00ff00"

return "%.0f%% % left, perfometer_linear (left, color)

perfometers["check_mk-idc_rx_level"] = perfometer_check_mk_idc_rx_level

--
Dave Callahan

On Mon, Jul 25, 2016 at 2:49 PM, David Callahan <dwcallahan at gmail.com>
wrote:

> I have ran into the same problem Joe had and sounds like from a PM he is
> still having some issues but had moved on.  I'm running 1.2.8p4 RAW and
> according to the documentation and Ken's response I have formatted
> everything properly.
>
>
> The name of my check is ~/local.share/check_mk/checks/idc_rx_level
> The name of the perfometer is ~/local/share/check_mk/web/plugins/
> perfometer/idc_rx_level.py
>
> The check does make perfdata.
>
>
> #!/usr/bin/python
>
> def perfometer_check_mk_idc_rx_level(row, check_command, perf_data):
> return repr(perf_data), ''
>
> perfometers["check_mk-idc_rx_level"] = perfometer_check_mk_idc_rx_level
>
>
> --
> Dave Callahan
>
> On Thu, May 26, 2016 at 11:41 AM, Ken Smith <smithk190 at macewan.ca> wrote:
>
>> Joe,
>>
>>   I am assuming that your check actually returns perf data .....
>>
>>   That being said, your perfometer looks properly defined but you may be
>> missing the mark with the naming of the check.  It is unclear if the check
>> is called "truecopy.pairstate" or "truecopy_pairstate".
>>
>>   We'll assume that it is the "truecopy_pairstate" format.  So your
>> perfometer should be:
>>     ~/local/share/check_mk/web/plugins/perfometer/truecopy_pairstate.py
>>
>>   (Note the .py at the end)
>>
>>   Then the perfometer definition should be:
>>   perfometers["check_mk-truecopy_pairstate"] =
>> perfometer_check_mk_truecopy_pairstate
>>
>>   Finally, to instantiate the new perfometer, you will need to run:
>>     omd restart apache
>>
>>   I hope that helps ......
>>
>>   Ken
>>
>>
>>
>> >>> Joe Hedrick <joecam1673 at gmail.com> 5/24/2016 06:20 PM >>>
>>
>> Hi everyone,
>>
>> I was hoping someone might have some perfometer advise for me. I'm
>> running OMD 1.30 and I've written my own check to watch my TrueCopy pairs.
>> I'm trying to get a perfometer for the check up and running now but I'm not
>> having much luck. It just doesn't seem to want to show up...
>>
>>
>> The check is called truecopy.pairstate and my perfometer is in
>> ~/local/share/check_mk/web/plugins/perfometer
>>
>>
>> Here's the sample code I'm trying:
>>
>>
>> #!/usr/bin/python
>>
>>
>> def perfometer_check_mk_truecopy_pairstate(row, check_command,
>> perf_data):
>>
>> return repr(perf_data), ''
>>
>>
>> perfometers["check_mk-truecopy.pairstate"] =
>> perfometer_check_mk_truecopy_pairstate
>>
>>
>> Anyone have similar issues or know how I might go chasing perfometer
>> problems?
>>
>>
>> Thanks,
>>
>> joe
>>
>> _______________________________________________
>> checkmk-en mailing list
>> checkmk-en at lists.mathias-kettner.de
>> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mathias-kettner.de/pipermail/checkmk-en/attachments/20160726/03b60902/attachment-0001.html>


More information about the checkmk-en mailing list