-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nagios plugin documentation and example files.
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
needrestart - nagios plugin mode | ||
================================ | ||
|
||
Needrestart can be used as a nagios plugin: | ||
|
||
```console | ||
# needrestart -p | ||
CRIT - Kernel: 3.16.0-4-amd64, Services: none, Containers: 1 (!), Sessions: none|Kernel=0;0;;0;2 Services=0;;0;0 Containers=1;;0;0 Sessions=0;0;;0 | ||
``` | ||
|
||
Since needrestart requires root privileges to scan processes of other | ||
users you should use sudo. Needrestart ships some example files to run | ||
needrestart as nagios plugin using sudo: | ||
|
||
- `ex/nagios/check_needrestart` - calls sudo to invoke needrestart | ||
- `ex/nagios/needrestart` - sudo(8) config allowing nagios to run needrestart as root | ||
- `ex/nagios/check_needrestart.conf` - nagios(8) integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# needrestart - Restart daemons after library updates. | ||
# | ||
# Authors: | ||
# Thomas Liske <thomas@fiasko-nw.net> | ||
# | ||
# Copyright Holder: | ||
# 2013 - 2015 (C) Thomas Liske [http://fiasko-nw.net/~thomas/] | ||
# | ||
# License: | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
|
||
exec sudo -n -- /usr/sbin/needrestart -p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# needrestart nagios plugin sudoers.d config file | ||
# ----------------------------------------------- | ||
# | ||
# Please consider a look at /etc/sudoers.d/README howto enable this file. | ||
# | ||
|
||
# Allow nagios to execute the needrestart command | ||
nagios ALL=NOPASSWD: /usr/sbin/needrestart -p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## remember: check_needrestart is a local check only | ||
define command { | ||
command_name check_needrestart | ||
command_line /usr/lib/nagios/plugins/check_needrestart | ||
} | ||
|
||
## example service | ||
#define service { | ||
# host_name localhost | ||
# service_description NEEDRESTART | ||
# check_command check_needrestart | ||
# use generic-service | ||
#} |