Simple check to see if a service is running

Hello! I am new to sensu, I have managed to install it on the Server and Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if the service ssh or postfix is running? I have not been able to find an simple example yet. Thanks alot.

Most people are probably using the nagios check_procs plugin.

{
  "checks": {
    "sshd-min1-max12": {
      "command": "PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
sshd -c 1:12",
      "handlers": [
        "bby"
      ],
      "subscribers": [
        “web"
      ],
      "interval": 60,
      "refresh": 1800,
      "occurrences": 2
    }
  }
}

···

On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen <anders.steria@gmail.com> wrote:

Hello! I am new to sensu, I have managed to install it on the Server and
Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if the
service ssh or postfix is running? I have not been able to find an simple
example yet. Thanks alot.

Is it any way to do it with sensu?

···

On Tuesday, November 4, 2014 5:53:38 PM UTC+1, agent462 wrote:

Most people are probably using the nagios check_procs plugin.

{
“checks”: {
“sshd-min1-max12”: {
“command”: “PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
sshd -c 1:12”,
“handlers”: [
“bby”
],
“subscribers”: [
“web"
],
“interval”: 60,
“refresh”: 1800,
“occurrences”: 2
}
}
}

On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen > anders...@gmail.com wrote:

Hello! I am new to sensu, I have managed to install it on the Server and
Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if the
service ssh or postfix is running? I have not been able to find an simple
example yet. Thanks alot.

This is using sensu. You can use any of the nagios plugins with Sensu.

It’s talked about here: http://sensuapp.org/docs/latest/checks

···

On Tue, Nov 4, 2014 at 10:57 AM, anders johannsen <anders.steria@gmail.com> wrote:

Is it any way to do it with sensu?

On Tuesday, November 4, 2014 5:53:38 PM UTC+1, agent462 wrote:

Most people are probably using the nagios check_procs plugin.

{
  "checks": {
    "sshd-min1-max12": {
      "command": "PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
sshd -c 1:12",
      "handlers": [
        "bby"
      ],
      "subscribers": [
        “web"
      ],
      "interval": 60,
      "refresh": 1800,
      "occurrences": 2
    }
  }
}

On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen >> <anders...@gmail.com> wrote:
> Hello! I am new to sensu, I have managed to install it on the Server and
> Client and the Keep Alive works great.
>
> Is anyone able to show me an example of a simple check which checks if
> the
> service ssh or postfix is running? I have not been able to find an
> simple
> example yet. Thanks alot.

Thanks! One fast question for you. Do I need both the plugin and check configuration on both client and the server ?

···

On Tuesday, November 4, 2014 5:59:55 PM UTC+1, agent462 wrote:

This is using sensu. You can use any of the nagios plugins with Sensu.

It’s talked about here: http://sensuapp.org/docs/latest/checks

On Tue, Nov 4, 2014 at 10:57 AM, anders johannsen > anders...@gmail.com wrote:

Is it any way to do it with sensu?

On Tuesday, November 4, 2014 5:53:38 PM UTC+1, agent462 wrote:

Most people are probably using the nagios check_procs plugin.

{
“checks”: {
“sshd-min1-max12”: {
“command”: “PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
sshd -c 1:12”,
“handlers”: [
“bby”
],
“subscribers”: [
“web"
],
“interval”: 60,
“refresh”: 1800,
“occurrences”: 2
}
}
}

On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen > >> anders...@gmail.com wrote:

Hello! I am new to sensu, I have managed to install it on the Server and
Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if
the
service ssh or postfix is running? I have not been able to find an
simple
example yet. Thanks alot.

I copy-pasted the plugin and changed the service to “ssh”, and the configurtion. But I am getting this error in sensu: Dropbox - Error - Simplify your life

···

On Tuesday, November 4, 2014 5:59:55 PM UTC+1, agent462 wrote:

This is using sensu. You can use any of the nagios plugins with Sensu.

It’s talked about here: http://sensuapp.org/docs/latest/checks

On Tue, Nov 4, 2014 at 10:57 AM, anders johannsen > anders...@gmail.com wrote:

Is it any way to do it with sensu?

On Tuesday, November 4, 2014 5:53:38 PM UTC+1, agent462 wrote:

Most people are probably using the nagios check_procs plugin.

{
“checks”: {
“sshd-min1-max12”: {
“command”: “PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
sshd -c 1:12”,
“handlers”: [
“bby”
],
“subscribers”: [
“web"
],
“interval”: 60,
“refresh”: 1800,
“occurrences”: 2
}
}
}

On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen > >> anders...@gmail.com wrote:

Hello! I am new to sensu, I have managed to install it on the Server and
Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if
the
service ssh or postfix is running? I have not been able to find an
simple
example yet. Thanks alot.

The answer would depend on what type you are using. There are
stand-alone checks and subscriptions.

At the top of these articles, you will see bullet points of what are needed:
http://sensuapp.org/docs/latest/adding_a_check
http://sensuapp.org/docs/latest/adding_a_standalone_check

···

On Tue, Nov 4, 2014 at 11:22 AM, anders johannsen <anders.steria@gmail.com> wrote:

Thanks! One fast question for you. Do I need both the plugin and check
configuration on both client and the server ?

On Tuesday, November 4, 2014 5:59:55 PM UTC+1, agent462 wrote:

This is using sensu. You can use any of the nagios plugins with Sensu.

It’s talked about here: http://sensuapp.org/docs/latest/checks

On Tue, Nov 4, 2014 at 10:57 AM, anders johannsen >> <anders...@gmail.com> wrote:
> Is it any way to do it with sensu?
>
> On Tuesday, November 4, 2014 5:53:38 PM UTC+1, agent462 wrote:
>>
>> Most people are probably using the nagios check_procs plugin.
>>
>> {
>> "checks": {
>> "sshd-min1-max12": {
>> "command": "PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
>> sshd -c 1:12",
>> "handlers": [
>> "bby"
>> ],
>> "subscribers": [
>> “web"
>> ],
>> "interval": 60,
>> "refresh": 1800,
>> "occurrences": 2
>> }
>> }
>> }
>>
>> On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen >> >> <anders...@gmail.com> wrote:
>> > Hello! I am new to sensu, I have managed to install it on the Server
>> > and
>> > Client and the Keep Alive works great.
>> >
>> > Is anyone able to show me an example of a simple check which checks
>> > if
>> > the
>> > service ssh or postfix is running? I have not been able to find an
>> > simple
>> > example yet. Thanks alot.

I copy-pasted the configuration you linked to but changed the service to ssh. It’s not working at all. Dropbox - Error - Simplify your life

···

On Tuesday, November 4, 2014 5:59:55 PM UTC+1, agent462 wrote:

This is using sensu. You can use any of the nagios plugins with Sensu.

It’s talked about here: http://sensuapp.org/docs/latest/checks

On Tue, Nov 4, 2014 at 10:57 AM, anders johannsen > anders...@gmail.com wrote:

Is it any way to do it with sensu?

On Tuesday, November 4, 2014 5:53:38 PM UTC+1, agent462 wrote:

Most people are probably using the nagios check_procs plugin.

{
“checks”: {
“sshd-min1-max12”: {
“command”: “PATH=$PATH:/usr/lib64/nagios/plugins check_procs -C
sshd -c 1:12”,
“handlers”: [
“bby”
],
“subscribers”: [
“web"
],
“interval”: 60,
“refresh”: 1800,
“occurrences”: 2
}
}
}

On Tue, Nov 4, 2014 at 10:49 AM, anders johannsen > >> anders...@gmail.com wrote:

Hello! I am new to sensu, I have managed to install it on the Server and
Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if
the
service ssh or postfix is running? I have not been able to find an
simple
example yet. Thanks alot.

This is literally the first task in the Documentation after installing Sensu:

http://sensuapp.org/docs/latest/adding_a_check

Replace “crond” in that example with “sshd” or whatever.

···

On Tuesday, November 4, 2014 8:49:02 AM UTC-8, anders johannsen wrote:

Hello! I am new to sensu, I have managed to install it on the Server and Client and the Keep Alive works great.

Is anyone able to show me an example of a simple check which checks if the service ssh or postfix is running? I have not been able to find an simple example yet. Thanks alot.