SNMP Device Monitoring

Hi,

I wish to use Sensu to monitor SNMP devices for which the client cannot be installed on. From what I’ve this can be done with Proxy Clients, however I’m clear from the documentation how to submit the results to Sensu without using some sort of external app.

If I manually submit results as follow the checks show up in Uchiwa as expected, just got a basic ping check at the moment:

echo ‘{“source”: “net-router”, “name”: “ping”, “output”: “test event”, “status”: 2}’ | nc localhost 3030

But it’s showing as from a different client:

{“timestamp”:“2016-11-24T21:13:54.750978+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“my-first-sensu-client”,“check”:{“source”:“net-router”,“name”:“ping”,“output”:“test event”,“status”:1,“executed”:1480022034,“issued”:1480022034}}}

the check is configured as below:

{

“checks”: {

“ping”: {

“command”: “check_ping.sh :::address:::”,

“standalone”: true,

“subscribers”: [

“network”

],

“interval”: 60

}

}

}

And although I’ve manually submitted the check result, I did also try creating a client manually:

{

“client”: {

“name”: “net-router”,

“source”: “net-router”,

“address”: “1.2.3.4”,

“subscribers”: [ “network” ],

“keepalives”: false

}

}

The above config doesn’t match with the docs but I thought it at least it logically makes sense.

The docs says that the “source” attribute can be added to the check but I don’t understand how that is scaleable, would it not mean having to have a separate check for every IP needing to be monitored on the network? If so it would be backward step from the way the host/check setup works on Nagios.

I know this has been asked a few times before but the posts appear to be at least 2 years old so hoping things have moved on a bit. Is what I’m trying to do possible with Sensu at the moment?

Really hope it is as I love the architecture in comparison to Nagios (and more commercial vendors) as it’s more data driven than being some kind of monalithic platform.

If what I’m trying do won’t work, I guess a separate agent could be used to somehow get the “virtual clients” info from the clients api, running the check against those devices and then submitting the results back to Sensu but that would seem like doubling up effort.

Thanks in advance

Hd

Comments online.

Hi,

I wish to use Sensu to monitor SNMP devices for which the client cannot be installed on. From what I've this can be done with Proxy Clients, however I'm clear from the documentation how to submit the results to Sensu without using some sort of external app.

If I manually submit results as follow the checks show up in Uchiwa as expected, just got a basic ping check at the moment:
echo '{"source": "net-router", "name": "ping", "output": "test event", "status": 2}' | nc localhost 3030

But it's showing as from a different client:
{"timestamp":"2016-11-24T21:13:54.750978+0000","level":"info","message":"publishing check result","payload":{"client":"my-first-sensu-client","check":{"source":"net-router","name":"ping","output":"test event","status":1,"executed":1480022034,"issued":1480022034}}}

the check is configured as below:
{
  "checks": {
    "ping": {
      "command": "check_ping.sh :::address:::",
      "standalone": true,
      "subscribers": [
        "network"
      ],
      "interval": 60
    }
  }
}

And although I've manually submitted the check result, I did also try creating a client manually:
{
  "client": {
    "name": "net-router",
    "source": "net-router",
    "address": "1.2.3.4",
    "subscribers": [ "network" ],
    "keepalives": false
  }
}

The above config doesn't match with the docs but I thought it at least it logically makes sense.

The docs says that the "source" attribute can be added to the check but I don't understand how that is scaleable, would it not mean having to have a separate check for every IP needing to be monitored on the network? If so it would be backward step from the way the host/check setup works on Nagios.

I know this has been asked a few times before but the posts appear to be at least 2 years old so hoping things have moved on a bit. Is what I'm trying to do possible with Sensu at the moment?

Really hope it is as I love the architecture in comparison to Nagios (and more commercial vendors) as it's more data driven than being some kind of monalithic platform.

If what I'm trying do won't work, I guess a separate agent could be used to somehow get the "virtual clients" info from the clients api, running the check against those devices and then submitting the results back to Sensu but that would seem like doubling up effort.

Thanks in advance

Hd

Below is my working config standalone snmp check snippet:

  "checks": {
    "inQueueSize-spam1.mum.aws.xxx": {
      "standalone": true,
      "interval": 60,
      "refresh": 900,
      "source": "spam1.mum.aws.xxx",
      "command": ":::nagios_plugin_path:::/check_snmp -H spam1.mum.aws.xxx —community=XXXX -o 1.3.6.1.4.1.20632.2.2 -w 50 -c 60 -l inQueueSize -t 10",
      "occurrences": 3,
      "handlers": [
        "default",
        "mailer",
        "sms"
      ]
    }
}

All the checks get listed under the source "spam1.mum.aws.xxx”.

Hth.
@shankerbalan

···

On 25-Nov-2016, at 2:57 AM, Head In The Cloud <hdinthkld@gmail.com> wrote:

Thanks Shanker,

So I wasn’t too far from the mark.

It still suffers the same issue though that you have to have one check for each device and therefore multiples for the same check, this does currently look a backward step for me.

I’ll probably stick to keeping the clientless checks in Naemon for now but perhaps using the same proxy client method I can get all the info into Sensu so any alerts, dashboards etc just need to be built via those APIs

Completely appreciate that Sensu is still early days so hopefully we’ll have a better way of doing this type of stuff in the future.

Hd

···

On Friday, 25 November 2016 10:08:51 UTC, Shanker Balan wrote:

Comments online.

On 25-Nov-2016, at 2:57 AM, Head In The Cloud hdin...@gmail.com wrote:

Hi,

I wish to use Sensu to monitor SNMP devices for which the client cannot be installed on. From what I’ve this can be done with Proxy Clients, however I’m clear from the documentation how to submit the results to Sensu without using some sort of external app.

If I manually submit results as follow the checks show up in Uchiwa as expected, just got a basic ping check at the moment:
echo ‘{“source”: “net-router”, “name”: “ping”, “output”: “test event”, “status”: 2}’ | nc localhost 3030

But it’s showing as from a different client:
{“timestamp”:“2016-11-24T21:13:54.750978+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“my-first-sensu-client”,“check”:{“source”:“net-router”,“name”:“ping”,“output”:“test event”,“status”:1,“executed”:1480022034,“issued”:1480022034}}}

the check is configured as below:
{
“checks”: {
“ping”: {
“command”: “check_ping.sh :::address:::”,
“standalone”: true,
“subscribers”: [
“network”
],
“interval”: 60
}
}
}

And although I’ve manually submitted the check result, I did also try creating a client manually:
{
“client”: {
“name”: “net-router”,
“source”: “net-router”,
“address”: “1.2.3.4”,
“subscribers”: [ “network” ],
“keepalives”: false
}
}

The above config doesn’t match with the docs but I thought it at least it logically makes sense.

The docs says that the “source” attribute can be added to the check but I don’t understand how that is scaleable, would it not mean having to have a separate check for every IP needing to be monitored on the network? If so it would be backward step from the way the host/check setup works on Nagios.

I know this has been asked a few times before but the posts appear to be at least 2 years old so hoping things have moved on a bit. Is what I’m trying to do possible with Sensu at the moment?

Really hope it is as I love the architecture in comparison to Nagios (and more commercial vendors) as it’s more data driven than being some kind of monalithic platform.

If what I’m trying do won’t work, I guess a separate agent could be used to somehow get the “virtual clients” info from the clients api, running the check against those devices and then submitting the results back to Sensu but that would seem like doubling up effort.

Thanks in advance

Hd

Below is my working config standalone snmp check snippet:

“checks”: {
“inQueueSize-spam1.mum.aws.xxx”: {
“standalone”: true,
“interval”: 60,
“refresh”: 900,
“source”: “spam1.mum.aws.xxx”,
“command”: “:::nagios_plugin_path:::/check_snmp -H spam1.mum.aws.xxx —community=XXXX -o 1.3.6.1.4.1.20632.2.2 -w 50 -c 60 -l inQueueSize -t 10”,
“occurrences”: 3,
“handlers”: [
“default”,
“mailer”,
“sms”
]
}
}

All the checks get listed under the source "spam1.mum.aws.xxx”.

Hth.
@shankerbalan

Comments inline.

Thanks Shanker,

So I wasn't too far from the mark.

It still suffers the same issue though that you have to have one check for each device and therefore multiples for the same check, this does currently look a backward step for me.

I'll probably stick to keeping the clientless checks in Naemon for now but perhaps using the same proxy client method I can get all the info into Sensu so any alerts, dashboards etc just need to be built via those APIs

Completely appreciate that Sensu is still early days so hopefully we'll have a better way of doing this type of stuff in the future.

Agree with your assessment that having unique check names for the same check across for standalone services
is a step back.

For now, I am happy to live with it since the checks in my environment are generated via Ansible. I add new devices
to the inventory list and unique check names get generated per device on the sensu server(s) across regions.

In fact, my primary reason for ditching Nagios/Icinga/Zabbix was to have a fully automated monitoring platform setup.

Regards.
@shankerbalan

···

On 25-Nov-2016, at 23:06, Head In The Cloud <hdinthkld@gmail.com> wrote:

Hd

On Friday, 25 November 2016 10:08:51 UTC, Shanker Balan wrote:
Comments online.

> On 25-Nov-2016, at 2:57 AM, Head In The Cloud <hdin...@gmail.com> wrote:
>
> Hi,
>
> I wish to use Sensu to monitor SNMP devices for which the client cannot be installed on. From what I've this can be done with Proxy Clients, however I'm clear from the documentation how to submit the results to Sensu without using some sort of external app.
>
> If I manually submit results as follow the checks show up in Uchiwa as expected, just got a basic ping check at the moment:
> echo '{"source": "net-router", "name": "ping", "output": "test event", "status": 2}' | nc localhost 3030
>
> But it's showing as from a different client:
> {"timestamp":"2016-11-24T21:13:54.750978+0000","level":"info","message":"publishing check result","payload":{"client":"my-first-sensu-client","check":{"source":"net-router","name":"ping","output":"test event","status":1,"executed":1480022034,"issued":1480022034}}}
>
> the check is configured as below:
> {
> "checks": {
> "ping": {
> "command": "check_ping.sh :::address:::",
> "standalone": true,
> "subscribers": [
> "network"
> ],
> "interval": 60
> }
> }
> }
>
> And although I've manually submitted the check result, I did also try creating a client manually:
> {
> "client": {
> "name": "net-router",
> "source": "net-router",
> "address": "1.2.3.4",
> "subscribers": [ "network" ],
> "keepalives": false
> }
> }
>
> The above config doesn't match with the docs but I thought it at least it logically makes sense.
>
> The docs says that the "source" attribute can be added to the check but I don't understand how that is scaleable, would it not mean having to have a separate check for every IP needing to be monitored on the network? If so it would be backward step from the way the host/check setup works on Nagios.
>
> I know this has been asked a few times before but the posts appear to be at least 2 years old so hoping things have moved on a bit. Is what I'm trying to do possible with Sensu at the moment?
>
> Really hope it is as I love the architecture in comparison to Nagios (and more commercial vendors) as it's more data driven than being some kind of monalithic platform.
>
> If what I'm trying do won't work, I guess a separate agent could be used to somehow get the "virtual clients" info from the clients api, running the check against those devices and then submitting the results back to Sensu but that would seem like doubling up effort.
>
> Thanks in advance
>
> Hd

Below is my working config standalone snmp check snippet:

  "checks": {
    "inQueueSize-spam1.mum.aws.xxx": {
      "standalone": true,
      "interval": 60,
      "refresh": 900,
      "source": "spam1.mum.aws.xxx",
      "command": ":::nagios_plugin_path:::/check_snmp -H spam1.mum.aws.xxx —community=XXXX -o 1.3.6.1.4.1.20632.2.2 -w 50 -c 60 -l inQueueSize -t 10",
      "occurrences": 3,
      "handlers": [
        "default",
        "mailer",
        "sms"
      ]
    }
}

All the checks get listed under the source "spam1.mum.aws.xxx”.

Hth.
@shankerbalan

That’s fair, hadn’t thought it that way.

I’ve recently starting looking at similar tools with Chef/Puppet so may give it a try.

···

On 26 Nov 2016 7:53 am, “Shanker Balan” mail@shankerbalan.net wrote:

Comments inline.

On 25-Nov-2016, at 23:06, Head In The Cloud hdinthkld@gmail.com wrote:

Thanks Shanker,

So I wasn’t too far from the mark.

It still suffers the same issue though that you have to have one check for each device and therefore multiples for the same check, this does currently look a backward step for me.

I’ll probably stick to keeping the clientless checks in Naemon for now but perhaps using the same proxy client method I can get all the info into Sensu so any alerts, dashboards etc just need to be built via those APIs

Completely appreciate that Sensu is still early days so hopefully we’ll have a better way of doing this type of stuff in the future.

Agree with your assessment that having unique check names for the same check across for standalone services

is a step back.

For now, I am happy to live with it since the checks in my environment are generated via Ansible. I add new devices

to the inventory list and unique check names get generated per device on the sensu server(s) across regions.

In fact, my primary reason for ditching Nagios/Icinga/Zabbix was to have a fully automated monitoring platform setup.

Regards.

@shankerbalan

Hd

On Friday, 25 November 2016 10:08:51 UTC, Shanker Balan wrote:

Comments online.

On 25-Nov-2016, at 2:57 AM, Head In The Cloud hdin...@gmail.com wrote:

Hi,

I wish to use Sensu to monitor SNMP devices for which the client cannot be installed on. From what I’ve this can be done with Proxy Clients, however I’m clear from the documentation how to submit the results to Sensu without using some sort of external app.

If I manually submit results as follow the checks show up in Uchiwa as expected, just got a basic ping check at the moment:

echo ‘{“source”: “net-router”, “name”: “ping”, “output”: “test event”, “status”: 2}’ | nc localhost 3030

But it’s showing as from a different client:

{“timestamp”:“2016-11-24T21:13:54.750978+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“my-first-sensu-client”,“check”:{“source”:“net-router”,“name”:“ping”,“output”:“test event”,“status”:1,“executed”:1480022034,“issued”:1480022034}}}

the check is configured as below:

{

“checks”: {

"ping": {
  "command": "check_ping.sh :::address:::",
  "standalone": true,
  "subscribers": [
    "network"
  ],
  "interval": 60
}

}

}

And although I’ve manually submitted the check result, I did also try creating a client manually:

{

“client”: {

"name": "net-router",
"source": "net-router",
"address": "1.2.3.4",
"subscribers": [ "network" ],
"keepalives": false

}

}

The above config doesn’t match with the docs but I thought it at least it logically makes sense.

The docs says that the “source” attribute can be added to the check but I don’t understand how that is scaleable, would it not mean having to have a separate check for every IP needing to be monitored on the network? If so it would be backward step from the way the host/check setup works on Nagios.

I know this has been asked a few times before but the posts appear to be at least 2 years old so hoping things have moved on a bit. Is what I’m trying to do possible with Sensu at the moment?

Really hope it is as I love the architecture in comparison to Nagios (and more commercial vendors) as it’s more data driven than being some kind of monalithic platform.

If what I’m trying do won’t work, I guess a separate agent could be used to somehow get the “virtual clients” info from the clients api, running the check against those devices and then submitting the results back to Sensu but that would seem like doubling up effort.

Thanks in advance

Hd

Below is my working config standalone snmp check snippet:

“checks”: {

"inQueueSize-spam1.mum.aws.xxx": {
  "standalone": true,
  "interval": 60,
  "refresh": 900,
  "source": "spam1.mum.aws.xxx",
  "command": ":::nagios_plugin_path:::/check_snmp -H spam1.mum.aws.xxx —community=XXXX -o 1.3.6.1.4.1.20632.2.2 -w 50 -c 60 -l inQueueSize -t 10",
  "occurrences": 3,
  "handlers": [
    "default",
    "mailer",
    "sms"
  ]
}

}

All the checks get listed under the source "spam1.mum.aws.xxx”.

Hth.

@shankerbalan