Different parameters for the same check on a per host basis


#1

Hi all,

I have the following perhaps trivial question but I have been going at it for a little while with no avail. I want to configure a load check with different parameters for the web server and some image processing servers. For example, the load on the image processing servers is almost always going to be higher than the webserver, and I want to configure different thresholds. I also want to monitor a number of databases with different names, which in essense is the same problem with parameters as before.

Any ideas on how I go around implementing this? A small detail is that I am using Chef to deploy sensu. Thanks for any suggestions!


#2

Hi Athanasois,
I would recommend defining those checks inside the appropriate cookbook using a sensu_check definition and use the standalone parameter. This way the check is defined on the client itself and you have the flexibility to change the check parameters on a per-recipe basis.

For the databases, you construct an array of database names, either using Chef search or manually, and wrap the sensu_check definition in a .each loop to define the checks.

Bethany

···

On Thu, Aug 1, 2013 at 9:48 AM, Athanasios Kostopoulos athanasioskostopoulos@gmail.com wrote:

Hi all,
I have the following perhaps trivial question but I have been going at it for a little while with no avail. I want to configure a load check with different parameters for the web server and some image processing servers. For example, the load on the image processing servers is almost always going to be higher than the webserver, and I want to configure different thresholds. I also want to monitor a number of databases with different names, which in essense is the same problem with parameters as before.

Any ideas on how I go around implementing this? A small detail is that I am using Chef to deploy sensu. Thanks for any suggestions!


Bethany Erskine

DevOps Engineer

http://www.paperlesspost.com


#3

Hi Bethany,

thanks for thte quick reply. Is there a way to do it without using “standalone” checks? My understanding is that standalone checks do not show up on the dashboard, and this, for the sake of easy visual identification, I would like to avoid. The rest is clear to me and thanks!

···

On Thursday, August 1, 2013 4:10:11 PM UTC+2, Bethany Erskine wrote:

Hi Athanasois,
I would recommend defining those checks inside the appropriate cookbook using a sensu_check definition and use the standalone parameter. This way the check is defined on the client itself and you have the flexibility to change the check parameters on a per-recipe basis.

For the databases, you construct an array of database names, either using Chef search or manually, and wrap the sensu_check definition in a .each loop to define the checks.

Bethany

On Thu, Aug 1, 2013 at 9:48 AM, Athanasios Kostopoulos athanasios...@gmail.com wrote:

Hi all,
I have the following perhaps trivial question but I have been going at it for a little while with no avail. I want to configure a load check with different parameters for the web server and some image processing servers. For example, the load on the image processing servers is almost always going to be higher than the webserver, and I want to configure different thresholds. I also want to monitor a number of databases with different names, which in essense is the same problem with parameters as before.

Any ideas on how I go around implementing this? A small detail is that I am using Chef to deploy sensu. Thanks for any suggestions!


Bethany Erskine

DevOps Engineer

http://www.paperlesspost.com


#4

I think in that case it makes better sense to define a different load check for each subscriber role that needs different check parameters. Perhaps someone else on the list has a more elegant solution though?

···

On Thu, Aug 1, 2013 at 10:14 AM, Athanasios Kostopoulos athanasioskostopoulos@gmail.com wrote:

Hi Bethany,
thanks for thte quick reply. Is there a way to do it without using “standalone” checks? My understanding is that standalone checks do not show up on the dashboard, and this, for the sake of easy visual identification, I would like to avoid. The rest is clear to me and thanks!

On Thursday, August 1, 2013 4:10:11 PM UTC+2, Bethany Erskine wrote:

Hi Athanasois,
I would recommend defining those checks inside the appropriate cookbook using a sensu_check definition and use the standalone parameter. This way the check is defined on the client itself and you have the flexibility to change the check parameters on a per-recipe basis.

For the databases, you construct an array of database names, either using Chef search or manually, and wrap the sensu_check definition in a .each loop to define the checks.

Bethany

On Thu, Aug 1, 2013 at 9:48 AM, Athanasios Kostopoulos athanasios...@gmail.com wrote:

Hi all,
I have the following perhaps trivial question but I have been going at it for a little while with no avail. I want to configure a load check with different parameters for the web server and some image processing servers. For example, the load on the image processing servers is almost always going to be higher than the webserver, and I want to configure different thresholds. I also want to monitor a number of databases with different names, which in essense is the same problem with parameters as before.

Any ideas on how I go around implementing this? A small detail is that I am using Chef to deploy sensu. Thanks for any suggestions!


Bethany Erskine

DevOps Engineer

http://www.paperlesspost.com


Bethany Erskine

DevOps Engineer

http://www.paperlesspost.com


#5

Hi Athanasios,

You can populate the client data with node specific threshold values, and then use those attributes with check command token substitution.

eg. “client”: {“load_thresholds”: {“warning”: 8, “critical”: 12}} “checks”: {“check_load”: {“command”: “check_load.rb -w :::load_thresholds.warning::: -c :::load_thresholds.critical:::”}}

Sean.

···

On Thu, Aug 1, 2013 at 7:35 AM, Bethany Erskine bethany@paperlesspost.com wrote:

I think in that case it makes better sense to define a different load check for each subscriber role that needs different check parameters. Perhaps someone else on the list has a more elegant solution though?


Cheers,

Sean Porter

{ blog: “http://portertech.ca”, projects: “https://github.com/portertech” }

On Thu, Aug 1, 2013 at 10:14 AM, Athanasios Kostopoulos athanasioskostopoulos@gmail.com wrote:

Hi Bethany,
thanks for thte quick reply. Is there a way to do it without using “standalone” checks? My understanding is that standalone checks do not show up on the dashboard, and this, for the sake of easy visual identification, I would like to avoid. The rest is clear to me and thanks!

On Thursday, August 1, 2013 4:10:11 PM UTC+2, Bethany Erskine wrote:

Hi Athanasois,
I would recommend defining those checks inside the appropriate cookbook using a sensu_check definition and use the standalone parameter. This way the check is defined on the client itself and you have the flexibility to change the check parameters on a per-recipe basis.

For the databases, you construct an array of database names, either using Chef search or manually, and wrap the sensu_check definition in a .each loop to define the checks.

Bethany

On Thu, Aug 1, 2013 at 9:48 AM, Athanasios Kostopoulos athanasios...@gmail.com wrote:

Hi all,
I have the following perhaps trivial question but I have been going at it for a little while with no avail. I want to configure a load check with different parameters for the web server and some image processing servers. For example, the load on the image processing servers is almost always going to be higher than the webserver, and I want to configure different thresholds. I also want to monitor a number of databases with different names, which in essense is the same problem with parameters as before.

Any ideas on how I go around implementing this? A small detail is that I am using Chef to deploy sensu. Thanks for any suggestions!


Bethany Erskine

DevOps Engineer

http://www.paperlesspost.com


Bethany Erskine

DevOps Engineer

http://www.paperlesspost.com


#6