[Check_mk (english)] Getting an inventory error for a new check

ROB HUGHES bob.hughes at btinternet.com
Fri Jul 1 11:01:08 CEST 2016


Hi Andreas,
yes, I must be doing something silly.
I have stripped things back and this is the plugin I am using:
#!/bin/bashecho '<<<cloudera>>>'echo "hive" "STARTED" "GOOD"
The python check I have is this:
#!/usr/bin/python# Author: Rob Hughes# Date: 29/06/2016# Version 1.0## Script which checks the Cloudera Services which are running and their status # the inventory functiondef inventory_cloudera(info): # begin with empty inventory     inventory = []     service = info[0]     inventory.append( ('service', service) )     return inventory # the check functiondef check_cloudera(item, params, info):     service = line[0]     return (1, "%s is OK" % service) check_info['cloudera'] = {     "check_function" : check_cloudera,     "inventory_function" : inventory_cloudera,     "service_description" : "Cloudera Services Health",}
I then tried the following:
CMD[mastermon]:~$ cmk --flush hmn-01hmn-01: counters cache autochecks(28)
CMD[mastermon]:~$ cmk -II hmn-01[['hive', 'STARTED', 'GOOD']]
CMD[mastermon]:~$ cmk -v hmn-01
Shows all the services but doesn't show the cloudera service
 

    On Thursday, 30 June 2016, 19:28, Andreas Döhler <andreas.doehler at gmail.com> wrote:
 

 Hi Rob

The output you posted looks like some debug output you put inside your code.
This is the reason why you get error inside web front end.
The inventory function normally don't return any printable output.
At the end of inventory function you have only a return statement for the found elements.

Best regards
Andreas
ROB HUGHES <bob.hughes at btinternet.com> schrieb am Do., 30. Juni 2016 um 16:21:

 Hi,
I am trying to write a new check for giving me the status of Cloudera Services. I have written a python script which gives me the output back when I run: check_mk --checks=cloudera -I hostname
[['hive', 'STARTED', 'GOOD'], ['zookeeper', 'STARTED', 'GOOD']]
But I am now struggling to get my check to work and I am seeing an error when I go to services for the host.
Service discovery failed for this host: Error running check_mk --automation try-inventory -- @noscan hostname Invalid output from webservice 9invalid syntax (<string>, line 2)):
RegardsRob_______________________________________________
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/20160701/e16db103/attachment.html>


More information about the checkmk-en mailing list