[Check_mk (english)] perf-o-meter for local checks

I can’t get perf-o-meter to work with custom local checks. There is no instruction on the document on how to do this. What command name should I use to register local checks? Are this function even allowed for local checks and MRPE checks?

thanks,

Henry

Existing perfometers are in the files in
/omd/versions/[version]/share/check_mk/web/plugins/perfometer and
you should be able to drop additions into the folder
/omd/sites/[site]/local/share/check_mk/web/plugins/perfometer. You
simply need to define a function to render the perfometer in HTML
and then append it to the ‘perfometers’ dict. You can also re-use
existing perfometers if your data is structured similarly.

eg. For a custom check I created called 'df_inodes' my script in the

perfometers folder is simply:

    perfometers["check_mk-df_inodes"] = perfometer_check_mk_df
···

On 2013-12-10 1:03 AM, Henry Huang
wrote:

      I

can’t get perf-o-meter to work with custom local checks. There
is no instruction on the document on how to do this. What
command name should I use to register local checks? Are this
function even allowed for local checks and MRPE checks?

thanks,

Henry

_______________________________________________
checkmk-en mailing list
-- Wade Rossmann
Systems Administrator

checkmk-en@lists.mathias-kettner.dehttp://lists.mathias-kettner.de/mailman/listinfo/checkmk-enrossmann.wade@realestatewebmasters.com

Hi Wade,

I have read the documentation and understand the locations and things to put in the script. I have created custom script that sits in the target node under

/usr/lib/check_mk_agent/local/freeswitch

the output of the check looks like this

<<>>

0 Call_Count count=200;;500;0;1000 200 live calls, Call counts looks good.

0 Calls_Per_Second cps=0;15;20;0;30 0 calls per second

What would be the name of the check that I use for perf-o-meter. I have tried to use “Call_Count”, “check_mk-local”, “check_mk-Call_Count” as names, but none of them shows a perf-o-meter for me.

Thanks,

Henry

···

On Tue, Dec 10, 2013 at 9:43 AM, Wade Rossmann rossmann.wade@realestatewebmasters.com wrote:

Existing perfometers are in the files in

/omd/versions/[version]/share/check_mk/web/plugins/perfometer and
you should be able to drop additions into the folder
/omd/sites/[site]/local/share/check_mk/web/plugins/perfometer. You
simply need to define a function to render the perfometer in HTML
and then append it to the ‘perfometers’ dict. You can also re-use
existing perfometers if your data is structured similarly.

eg. For a custom check I created called 'df_inodes' my script in the

perfometers folder is simply:

    perfometers["check_mk-df_inodes"] = perfometer_check_mk_df



  On 2013-12-10 1:03 AM, Henry Huang

wrote:

      I

can’t get perf-o-meter to work with custom local checks. There
is no instruction on the document on how to do this. What
command name should I use to register local checks? Are this
function even allowed for local checks and MRPE checks?

thanks,

Henry

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
[http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en](http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en)

-- Wade Rossmann
Systems Administrator
rossmann.wade@realestatewebmasters.com

checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Hi Henry,

firstly said: I neither did test this myself nor use local checks.

The command name should be "check_mk-local" as this is the command for
all local checks (all local checks will get the same perfometer).
Did you restart the webserver ("omd restart apache" if using OMD)
after changing the command name in perfometer config?

Regards,
Marcel

···

2013/12/10 Henry Huang <red.rain.seven@gmail.com>:

Hi Wade,

I have read the documentation and understand the locations and things to put
in the script. I have created custom script that sits in the target node
under

/usr/lib/check_mk_agent/local/freeswitch

the output of the check looks like this

<<<local>>>
0 Call_Count count=200;;500;0;1000 200 live calls, Call counts looks good.
0 Calls_Per_Second cps=0;15;20;0;30 0 calls per second

What would be the name of the check that I use for perf-o-meter. I have
tried to use "Call_Count", "check_mk-local", "check_mk-Call_Count" as names,
but none of them shows a perf-o-meter for me.

Thanks,

Henry

On Tue, Dec 10, 2013 at 9:43 AM, Wade Rossmann > <rossmann.wade@realestatewebmasters.com> wrote:

Existing perfometers are in the files in
/omd/versions/[version]/share/check_mk/web/plugins/perfometer and you should
be able to drop additions into the folder
/omd/sites/[site]/local/share/check_mk/web/plugins/perfometer. You simply
need to define a function to render the perfometer in HTML and then append
it to the 'perfometers' dict. You can also re-use existing perfometers if
your data is structured similarly.

eg. For a custom check I created called 'df_inodes' my script in the
perfometers folder is simply:

    perfometers["check_mk-df_inodes"] = perfometer_check_mk_df

On 2013-12-10 1:03 AM, Henry Huang wrote:

I can't get perf-o-meter to work with custom local checks. There is no
instruction on the document on how to do this. What command name should I
use to register local checks? Are this function even allowed for local
checks and MRPE checks?

thanks,

Henry

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

--
Wade Rossmann
Systems Administrator
rossmann.wade@realestatewebmasters.com

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Unfortunately I’m not intimately familiar with local checks, but I’d
imagine investigating how the perfometer gets to the page would be
the way to go. I’ve gotten as far as paint_perfometer() in
web/plugins/views/perfometer.py

I can’t find anywhere where that’s actually called, but I imagine
that if you were to capture the ‘row’ parameter, and the subsequent
parsing to ‘check_command’ that should be the name you want to give
your perfometer.

···

http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob;f=web/plugins/views/perfometer.py#l122

  On 2013-12-10 10:25 AM, Henry Huang

wrote:

      Hi

Wade,

      I

have read the documentation and understand the locations and
things to put in the script. I have created custom script that
sits in the target node under

/usr/lib/check_mk_agent/local/freeswitch

      the

output of the check looks like this

<<>>

          0 Call_Count

count=200;;500;0;1000 200 live calls, Call counts looks
good.

          0 Calls_Per_Second

cps=0;15;20;0;30 0 calls per second

          What would be the name of the

check that I use for perf-o-meter. I have tried to use
“Call_Count”, “check_mk-local”, “check_mk-Call_Count” as
names, but none of them shows a perf-o-meter for me.

Thanks,

Henry

      On Tue, Dec 10, 2013 at 9:43 AM, Wade

Rossmann rossmann.wade@realestatewebmasters.com
wrote:

          Existing perfometers

are in the files in
/omd/versions/[version]/share/check_mk/web/plugins/perfometer
and you should be able to drop additions into the folder
/omd/sites/[site]/local/share/check_mk/web/plugins/perfometer.
You simply need to define a function to render the
perfometer in HTML and then append it to the ‘perfometers’
dict. You can also re-use existing perfometers if your
data is structured similarly.

          eg. For a custom check I created called 'df_inodes' my

script in the perfometers folder is simply:

              perfometers["check_mk-df_inodes"] =

perfometer_check_mk_df

On 2013-12-10 1:03 AM, Henry Huang wrote:

                    I

can’t get perf-o-meter to work with custom local
checks. There is no instruction on the document
on how to do this. What command name should I
use to register local checks? Are this function
even allowed for local checks and MRPE checks?

thanks,

Henry

_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
[http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en](http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en)

-- Wade Rossmann
Systems Administrator
rossmann.wade@realestatewebmasters.com
        _______________________________________________

        checkmk-en mailing list

        checkmk-en@lists.mathias-kettner.de

        [http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en](http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en)
-- Wade Rossmann
Systems Administrator

rossmann.wade@realestatewebmasters.com

Alright, I got it all figured out. Solved (thanks again Marcel)

Here’s what happened. In my earlier tests, I have tried to use “check_mk-local” as the perf-o-meter name and I also restarted apache using this command “service apache2 restart” and no perf-o-meter will show up for my local script. I had to use “omd restart site apache” instead like Marcel instructed, then viola~ the perf-o-meter shows. I am going to make it easy for everyone here.

  1. Follow the official perf-o-meter document on defining your template

  2. If you want to use perf-o-meter for local checks, use this command name for perf-o-meter

perfometers[“check_mk-local”] = perfometer_your_custom_template_name

Or if you want to put MRPE checks on perf-o-meter, use the actual command name that is executed in the /etc/check_mk/mrpe.cfg , here we will use “check_mysql_health” as an example

perfometers[“check_mysql_health”] = perfometer_your_custom_template_name

  1. After you are done with the changes, restart apache for your monitoring instance if you are using OMD

omd restart sitename apache

  1. Check on Multisite, refresh your page, you should now see the perf-o-meter showing up

The downside for check_mk-local is that no matter how many different script you have, they all have to share one perf-o-meter template under the same “check_mk-local” command name. I hope this can be addressed in the future check_mk or OMD release. Same goes for MRPE checks, the same command name will be used for many different output, some are counts, some are percentage, it will be hard to display them all using perf-o-meter under one template.

Other than that, I am a happy camper to see some nice perf-o-meter for my custom scripts.

Henry

···

On Tue, Dec 10, 2013 at 10:50 AM, Marcel Schulte schulte.marcel@gmail.com wrote:

Hi Henry,

firstly said: I neither did test this myself nor use local checks.

The command name should be “check_mk-local” as this is the command for

all local checks (all local checks will get the same perfometer).

Did you restart the webserver (“omd restart apache” if using OMD)

after changing the command name in perfometer config?

Regards,

Marcel

2013/12/10 Henry Huang red.rain.seven@gmail.com:

Hi Wade,

I have read the documentation and understand the locations and things to put

in the script. I have created custom script that sits in the target node

under

/usr/lib/check_mk_agent/local/freeswitch

the output of the check looks like this

<<>>

0 Call_Count count=200;;500;0;1000 200 live calls, Call counts looks good.

0 Calls_Per_Second cps=0;15;20;0;30 0 calls per second

What would be the name of the check that I use for perf-o-meter. I have

tried to use “Call_Count”, “check_mk-local”, “check_mk-Call_Count” as names,

but none of them shows a perf-o-meter for me.

Thanks,

Henry

On Tue, Dec 10, 2013 at 9:43 AM, Wade Rossmann

rossmann.wade@realestatewebmasters.com wrote:

Existing perfometers are in the files in

/omd/versions/[version]/share/check_mk/web/plugins/perfometer and you should

be able to drop additions into the folder

/omd/sites/[site]/local/share/check_mk/web/plugins/perfometer. You simply

need to define a function to render the perfometer in HTML and then append

it to the ‘perfometers’ dict. You can also re-use existing perfometers if

your data is structured similarly.

eg. For a custom check I created called ‘df_inodes’ my script in the

perfometers folder is simply:

perfometers["check_mk-df_inodes"] = perfometer_check_mk_df

On 2013-12-10 1:03 AM, Henry Huang wrote:

I can’t get perf-o-meter to work with custom local checks. There is no

instruction on the document on how to do this. What command name should I

use to register local checks? Are this function even allowed for local

checks and MRPE checks?

thanks,

Henry


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

Wade Rossmann

Systems Administrator

rossmann.wade@realestatewebmasters.com


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en