Posts by nocor

This forum was archived to /woltlab and is now in read-only mode.

    OK so i managed to rewrite a lot of the snmp_info code and implemented a parse_function to get the values into a tuple in a much better method
    i think im close now. the last part is the check routine.
    can anyone point me to an example custom check that will show me how to use the check_temperature include correctly?


    i think my school of thought might be slightly off. eg i grab the bulkwalk data for all 5 sensors and split into [name, value]
    now these (up to) 5 sensors may be temperature, humidity or other fun things. i have included temperature.include and and also humidity.include in my main function in preparation for correct usage ;)


    im not sure how to handle the routine in check_ where it performs the actual check. i know that function receives 'item' but i currently use a for loop to check is item == sensorname
    surely this isnt the best method to work it out. im presuming something like a 'where' statement would at least be more logical eg


    Code
    1. where item == sensorname
    2. check_temperature(sensordata, params)



    last question: am i correctly defining my default params in the plugin if i want them to be configurable via a WATO rule instead? im not sure if i still have to set defaults with the file yet.


    oh and i just realised my code above wasnt tagged correctly - useless without that; will fix up now and post my GREATLY revised code to make things easier to follow
    Conor

    Hello
    I initially wrote a check to get the temperature from our ServersCheck sensorgateway. As im not great with python it worked, but not well. Now that I have updated to check_mk 1.2.8p10 (up from 1.2.6.x) I have found the sensor check not working well. From reading through all the change notes I believe that it should be possible to use the built in logic and warn/crit levels, etc from temperature.include.
    Initially I also had lots of trouble with my tuples and so would love to get things running smoother.


    The device details are available here, including the mib which I have dropped into the mibs folder and it seems to be resolving where necessary (given my very limited knowledge)
    http://downloads.serverscheck.com/sensors/sensorgateway.mib


    and here is a copy or my code; as you will see there are large sections commented out from either previous attempts or to remind me how to check things, etc – as I never got it running 100% I never cleaned up the code.


    I found that the instructions to write your own plugin were quite out of date and quite broken up into pieces for someone who had limited knowledge. So here is my pieced together mess. I would like to use the new built in warn/crit levels for ease of maintenance and also my discovery oid routine needs much work. this is all code i wrote/copied from various sources. now i realise that much of what i have written can be performed by the temperature api within temperature.include and all i have to do is popupate and parse the actual data [info]


    Edit: for code tags - spaces have already been stripped so its useless - will post revised code soon


    RegardsConor