1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2026-02-13 02:20:57 +01:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Your Name
e45625a179 Automatic commit of package [nagios-okplugin-check_xroad_token] release [1.0.3-1]. 2020-09-14 11:03:48 +00:00
Garðar Þorsteinsson
df42d6ee6d Merge pull request #41 from opinkerfi/xroad-check_xroad_token
check_xroad_token plugin created
2020-09-11 16:04:15 +00:00
Garðar Þorsteinsson
223331510b check_xroad_token plugin created 2020-09-11 16:01:05 +00:00
Garðar Þorsteinsson
ea93f8126f Fix masking of exit code 2020-09-11 11:09:40 +00:00
Garðar Þorsteinsson
3ad7f64f55 Merge pull request #40 from opinkerfi/check_service
Added check_service plugin
2020-04-21 12:58:41 +00:00
6 changed files with 76 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -o pipefail
# Author: Jon Schipp
# 2015-03-09 [Pascal Hegy] - Add sudo for linux

View File

@@ -0,0 +1,15 @@
#!/bin/bash
xroad_list_tokens=$(signer-console list-tokens)
if [[ $xroad_list_tokens == "Token: 0 (OK, writable, available, active)" ]]
then
echo "OK - $xroad_list_tokens"
exit 0
elif [[ $xroad_list_tokens != "Token: 0 (OK, writable, available, active)" ]]
then
echo "Critical - $xroad_list_tokens"
exit 2
else
echo "Unknown - $xroad_list_tokens"
exit 3
fi

View File

@@ -0,0 +1,55 @@
%define debug_package %{nil}
Summary: A Nagios plugin to check status of XROAD soft-token
Name: nagios-okplugin-check_xroad_token
Version: 1.0.3
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL: https://github.com/opinkerfi/nagios-plugins/issues
Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_xroad_token/releases/nagios-okplugin-check_xroad_token-%{version}.tar.gz
Requires: nagios-nrpe
Requires: xroad-signer
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Packager: Gardar Thorsteinsson <gardar@ok.is>
%description
A Nagios plugin to check status of XROAD soft-token
%prep
%setup -q
#perl -pi -e "s|/usr/lib64|%{_libdir}|g" nrpe.d/check_xroad_token.cfg
%build
%install
rm -rf %{buildroot}
install -D -p -m 0755 check_xroad_token.sh %{buildroot}%{_libdir}/nagios/plugins/check_xroad_token.sh
install -D -p -m 0755 nrpe.d/check_xroad_token.cfg %{buildroot}/etc/nrpe.d/check_xroad_token.cfg
install -D -p -m 0644 sudoers.d/check_xroad_token %{buildroot}/etc/sudoers.d/check_xroad_token
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
#%doc README LICENSE
%{_libdir}/nagios/plugins/*
/etc/nrpe.d/check_xroad_token.cfg
/etc/sudoers.d/check_xroad_token
%post
restorecon -v %{_libdir}/nagios/plugins/check_xroad_token.sh /etc/nrpe.d/check_xroad_token.cfg /etc/sudoers.d/check_xroad_token
%changelog
* Mon Sep 14 2020 Your Name <you@example.com> 1.0.3-1
- new package built with tito
* Mon Sep 14 2020 Your Name <you@example.com>
- new package built with tito
* Fri Sep 11 2020 Gardar Thorsteinsson <gardart@gmail.com> 1.0.1-1
- Initial packaging

View File

@@ -0,0 +1,2 @@
# xroad plugin to check for tokens
command[check_xroad_token]=sudo -u xroad /usr/lib64/nagios/plugins/check_xroad_token.sh

View File

@@ -0,0 +1,2 @@
Defaults:nrpe !requiretty
nrpe ALL = (xroad) NOPASSWD: /usr/bin/signer-console list-tokens, /usr/lib64/nagios/plugins/check_xroad_token.sh

View File

@@ -0,0 +1 @@
1.0.3-1 check_xroad_token/