An Elastic Beat for all the Nagios checks
Perl ApacheConf Go Shell Makefile Python Groovy
Latest commit 472ec5d Jul 30, 2016 @PhaedrusTheGreek committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
beater Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
blog Update README.md Jun 15, 2016
check Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
config Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
dev-tools/packer 0.6.0 builds Jul 29, 2016
docs Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
etc Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagiosperf Fixed bugs where invalid perfs were publishing Jan 14, 2016
packages removed 0.5.x builds from this tree Jul 29, 2016
tests/system Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
CHANGES Update CHANGES Jul 29, 2016
LICENSE Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
Makefile Fixes packaging Jul 28, 2016
README.build updates for building Jul 29, 2016
README.md Update README.md Jul 30, 2016
main.go Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
main_test.go Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagioscheckbeat-osx.yml Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagioscheckbeat-sar-example.yml Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagioscheckbeat.full.yml Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagioscheckbeat.template-es2x.json Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagioscheckbeat.template.json Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
nagioscheckbeat.yml Updated for Elastic Stack 5.x (libbeat, cookie-cutter, packaging, etc) Jul 27, 2016
ss.png added a screenshot Jan 14, 2016

README.md

NagiosCheckBeat

NagiosCheckBeat is the Beat used for running Nagios checks.

Check out this blog post on how it works.

You can integrate with Watcher (How-To) or Nagios Core (How-To) for Alerting.

Kibana Screenshot

Compatibility

NagiosCheckBeat 0.6.0 is meant to be compatible with Elasticsaerch 2.x and higher. For Elasticsearch 1.x compatibility, see the 0.5.x branch.

Download

Packages for Windows, Debian, RPM and OSX are available in the packages/ folder

Template

In NagiosCheckBeat 0.6.0, we have updated to the newest version of libbeat, and the template now installs itself.

Configuration

############################# Input ############################################
input:
  checks:
    -
      name: "heartbeat"
      cmd: "/usr/lib64/nagios/plugins/check_dummy"
      args: "0 Checking In!"
      period: "10s"
    -
      name: "disks"
      cmd: "/usr/lib64/nagios/plugins/check_disk"
      args: "-w 80 -c 90 -x /dev"
      period: "1h"
    -
      name: "load"
      cmd: "/usr/lib64/nagios/plugins/check_load"
      args: "-w 5 -c 10"
      period: "1m"
    -
      name: "io"
      cmd: "/usr/lib64/nagios/plugins/check_sar_perf.py"
      args: "io_transfer"
      period: "30s"
      enabled: false

Produces

Firstly, the metrics, individually as documents:

{
   "took": 1,
   "timed_out": false,
   "_shards": {
      "total": 1,
      "successful": 1,
      "failed": 0
   },
   "hits": {
      "total": 12,
      "max_score": 1,
      "hits": [
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bdpWMO5Jb2lqbx",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.924Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 50178,
               "label": "/",
               "max": 50268,
               "min": 0,
               "name": "disks",
               "type": "nagiosmetric",
               "uom": "MB",
               "value": 33124,
               "warning": 50188
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bdpWMO5Jb2lqby",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.924Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 3910,
               "label": "/dev/shm",
               "max": 4000,
               "min": 0,
               "name": "disks",
               "type": "nagiosmetric",
               "uom": "MB",
               "value": 0,
               "warning": 3920
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bdpWMO5Jb2lqbz",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.924Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 386,
               "label": "/boot",
               "max": 476,
               "min": 0,
               "name": "disks",
               "type": "nagiosmetric",
               "uom": "MB",
               "value": 154,
               "warning": 396
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bdpWMO5Jb2lqb0",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.924Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 76800,
               "label": "/home",
               "max": 76890,
               "min": 0,
               "name": "disks",
               "type": "nagiosmetric",
               "uom": "MB",
               "value": 363,
               "warning": 76810
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bdpWMO5Jb2lqb2",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.933Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 10,
               "label": "load1",
               "max": 0,
               "min": 0,
               "name": "load",
               "type": "nagiosmetric",
               "uom": "",
               "value": 0.16,
               "warning": 5
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bepWMO5Jb2lqb3",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.933Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 10,
               "label": "load5",
               "max": 0,
               "min": 0,
               "name": "load",
               "type": "nagiosmetric",
               "uom": "",
               "value": 0.05,
               "warning": 5
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7bepWMO5Jb2lqb4",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.933Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 10,
               "label": "load15",
               "max": 0,
               "min": 0,
               "name": "load",
               "type": "nagiosmetric",
               "uom": "",
               "value": 0.06,
               "warning": 5
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7pTpWMO5Jb2lqb6",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.948Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 0,
               "label": "tps",
               "max": 0,
               "min": 0,
               "name": "io",
               "type": "nagiosmetric",
               "uom": "",
               "value": 0,
               "warning": 0
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7pTpWMO5Jb2lqb7",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.948Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 0,
               "label": "rtps",
               "max": 0,
               "min": 0,
               "name": "io",
               "type": "nagiosmetric",
               "uom": "",
               "value": 0,
               "warning": 0
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagiosmetric",
            "_id": "AVH0P7pTpWMO5Jb2lqb8",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.948Z",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "count": 1,
               "critical": 0,
               "label": "wtps",
               "max": 0,
               "min": 0,
               "name": "io",
               "type": "nagiosmetric",
               "uom": "",
               "value": 0,
               "warning": 0
            }
         }
      ]
   }
}

Secondly, the results of the actual Nagios Checks, as a separate type

{
   "took": 1,
   "timed_out": false,
   "_shards": {
      "total": 1,
      "successful": 1,
      "failed": 0
   },
   "hits": {
      "total": 4,
      "max_score": 1,
      "hits": [
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagioscheck",
            "_id": "AVH0P7bdpWMO5Jb2lqbv",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.922Z",
               "args": "0 Hello",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "cmd": "/usr/lib64/nagios/plugins/check_dummy",
               "count": 1,
               "message": "OK: Hello\n",
               "status": "OK",
               "took_ms": 2,
               "type": "nagioscheck"
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagioscheck",
            "_id": "AVH0P7bdpWMO5Jb2lqbw",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.924Z",
               "args": "-w 80 -c 90 -x /dev",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "cmd": "/usr/lib64/nagios/plugins/check_disk",
               "count": 1,
               "message": "DISK OK - free space: / 14568 MB (30% inode=94%); /dev/shm 4000 MB (100% inode=99%); /boot 292 MB (65% inode=99%); /home 72598 MB (99% inode=99%);",
               "status": "OK",
               "took_ms": 8,
               "type": "nagioscheck"
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagioscheck",
            "_id": "AVH0P7bdpWMO5Jb2lqb1",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.933Z",
               "args": "-w 5 -c 10",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "cmd": "/usr/lib64/nagios/plugins/check_load",
               "count": 1,
               "message": "OK - load average: 0.16, 0.05, 0.06",
               "status": "OK",
               "took_ms": 14,
               "type": "nagioscheck"
            }
         },
         {
            "_index": "nagioscheckbeat-2015.12.30",
            "_type": "nagioscheck",
            "_id": "AVH0P7pTpWMO5Jb2lqb5",
            "_score": 1,
            "_source": {
               "@timestamp": "2015-12-30T18:56:33.948Z",
               "args": "io_transfer",
               "beat": {
                  "hostname": "max.elastic.co",
                  "name": "max.elastic.co"
               },
               "cmd": "/usr/lib64/nagios/plugins/check_sar_perf.py",
               "count": 1,
               "message": "sar OK ",
               "status": "OK",
               "took_ms": 1062,
               "type": "nagioscheck"
            }
         }
      ]
   }
}