summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCoprDistGit <copr-devel@lists.fedorahosted.org>2022-06-13 17:40:57 +0000
committerCoprDistGit <copr-devel@lists.fedorahosted.org>2022-06-13 17:40:57 +0000
commitee333849e00320407261d042ba5c58699e4394a1 (patch)
treebc61c4e74b5b607bc24b69c863794afb7709c24a
parent37748bec3cdf30c0d766c1499130eeb5159b9992 (diff)
-rw-r--r--.gitignore1
-rw-r--r--Patch-checkexpire46
-rw-r--r--nagios-plugins-check_expire_dns_zone.spec43
-rw-r--r--sources1
4 files changed, 91 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..22e3491 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/nagios-plugins-check_expire_dns_zone-0.1.tar.gz
diff --git a/Patch-checkexpire b/Patch-checkexpire
new file mode 100644
index 0000000..dd93c2f
--- /dev/null
+++ b/Patch-checkexpire
@@ -0,0 +1,46 @@
+--- checkexpire/checkexpire.sh.orig 2015-06-30 12:55:40.000000000 +0100
++++ checkexpire/checkexpire.sh 2022-06-13 16:48:39.508124808 +0100
+@@ -34,7 +34,8 @@
+ OPTIONS:
+ -h Show this message
+- -m Master NS
++ -m Master NS
+ -s Slave NS
+ -v Verbose
++ -f Domains File
+
+ DOMAINS FILE:
+@@ -44,12 +45,5 @@
+ }
+
+-if [ ! -f $DOMAINSFILE ]
+-then
+- echo "File $DOMAINSFILE not found"
+- usage
+- exit $STATE_UNKNOWN
+-fi
+-
+-while getopts ":s:m:vh" opt; do
++while getopts ":s:m:f:vh" opt; do
+ case $opt in
+ s)
+@@ -59,4 +53,7 @@
+ DNSMAS=$OPTARG
+ ;;
++ f)
++ DOMAINSFILE="$DIRECTORY/$OPTARG"
++ ;;
+ v)
+ _V=1
+@@ -73,4 +70,11 @@
+ done
+
++if [ ! -f $DOMAINSFILE ]
++then
++ echo "File $DOMAINSFILE not found"
++ usage
++ exit $STATE_UNKNOWN
++fi
++
+ if [[ -z $DNSSRV ]] || [[ -z $DNSMAS ]]
+ then
diff --git a/nagios-plugins-check_expire_dns_zone.spec b/nagios-plugins-check_expire_dns_zone.spec
new file mode 100644
index 0000000..0266443
--- /dev/null
+++ b/nagios-plugins-check_expire_dns_zone.spec
@@ -0,0 +1,43 @@
+# SPEC file overview:
+# https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/#con_rpm-spec-file-overview
+# Fedora packaging guidelines:
+# https://docs.fedoraproject.org/en-US/packaging-guidelines/
+
+
+Name: nagios-plugins-check_expire_dns_zone
+Version: 0.1
+Release: 1.ndias%{?dist}
+Summary: Nagios plugin to compare the slave and the master DNS nameservers SOA records
+
+License: GPLv2
+URL: https://github.com/alcir/nagios/tree/master/checkexpire
+Source0: https://github.com/alcir/nagios/archive/refs/heads/master.zip#/%{name}-%{version}.tar.gz
+Patch0: Patch-checkexpire
+
+BuildArch: noarch
+
+%description
+This script uses dig to query two dns servers and to compare the SOA record.
+Useful to check if a slave zone is not in sync with the master.
+
+%prep
+%setup -q -n nagios-master
+
+%patch0 -p0
+
+%build
+
+
+%install
+install -p -m 755 -D checkexpire/checkexpire.sh %{buildroot}/%{_libdir}/nagios/plugins/checkexpire.sh
+
+
+%files
+%doc checkexpire/README.md
+%license LICENSE
+
+%{_libdir}/nagios/plugins/checkexpire.sh
+
+%changelog
+* Mon Jun 13 2022 Nuno Dias <Nuno.Dias@gmail.com> - 0.1-1.ndias
+- Version 0.1
diff --git a/sources b/sources
new file mode 100644
index 0000000..c70678c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+b845506199de93e39feee4bae50e26c8 nagios-plugins-check_expire_dns_zone-0.1.tar.gz