summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rwxr-xr-x.github/mock.sh50
-rw-r--r--.github/monitoring-plugins.spec975
-rw-r--r--.github/os_detect.sh18
-rwxr-xr-x.github/prepare_debian.sh8
-rw-r--r--.github/workflows/codeql-analysis.yml4
-rw-r--r--.github/workflows/spellcheck.yml27
-rw-r--r--.github/workflows/test-next.yml78
-rw-r--r--.github/workflows/test.yml90
8 files changed, 1194 insertions, 56 deletions
diff --git a/.github/mock.sh b/.github/mock.sh
new file mode 100755
index 0000000..7fbe690
--- /dev/null
+++ b/.github/mock.sh
@@ -0,0 +1,50 @@
1#!/bin/bash
2
3set -x
4
5export DEBIAN_FRONTEND=noninteractive
6
7BASE_PATH="/src"
8
9ls -la ${BASE_PATH}/.github/os_detect.sh
10. ${BASE_PATH}/.github/os_detect.sh
11
12SRCRPM_DIR="/tmp/result-srcrpm"
13RPM_DIR="/tmp/result-rpm"
14SPEC_DIR="${BASE_PATH}/.github/"
15SOURCE_DIR="."
16SPEC_FILE="${SPEC_DIR}monitoring-plugins.spec"
17
18cd ${BASE_PATH}
19
20dnf -y --setopt="tsflags=nodocs" update && \
21 if [ ${distro_id} != "fedora" ]; then dnf -y --setopt="tsflags=nodocs" install epel-release; else platform_id="$(echo ${platform_id} | sed s/^f/fc/)"; fi && \
22 case ${distro_id} in
23 ol)
24 case ${platform_id} in
25 el9)
26 dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/mock/mock-stable/repo/epel-9/group_mock-mock-stable-epel-9.repo
27 ;;
28 el8)
29 dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/mock/mock-stable/repo/epel-8/group_mock-mock-stable-epel-8.repo
30 ;;
31 esac
32 ;;
33 esac
34 dnf -y --setopt="tsflags=nodocs" install mock rpm-build git-core && \
35 usermod -a -G mock $(whoami)
36SRC_RPM="monitoring-plugins-*-1.${platform_id}.src.rpm"
37if command -v git > /dev/null 2>&1; then
38 git config --global --add safe.directory ${BASE_PATH}
39 SHA="$(git rev-parse HEAD)"
40 sed "s/^%global commit.*/%global commit ${SHA}/" ${SPEC_FILE} > ${SPEC_DIR}monitoring-plugins-git.spec
41 sed -i "s/^%global fromgit.*/%global fromgit 1/" ${SPEC_DIR}monitoring-plugins-git.spec
42 SPEC_FILE="${SPEC_DIR}monitoring-plugins-git.spec"
43 SRC_RPM="monitoring-plugins-*git.$(echo ${SHA:0:7})*.${platform_id}.src.rpm"
44fi
45mkdir -p "${SRCRPM_DIR}" "${RPM_DIR}"
46#rpmbuild --undefine=_disable_source_fetch --define "_sourcedir ${SOURCE_DIR}" -ba ${SPEC_FILE}
47dnf -y --setopt="tsflags=nodocs" install rpmdevtools && spectool -g -C ${SOURCE_DIR} ${SPEC_FILE} && \
48mock --dnf --clean --spec ${SPEC_FILE} --sources=${SOURCE_DIR} --result=${SRCRPM_DIR} --build || { cat ${SRCRPM_DIR}/{root,build}.log; exit 1; }
49mock --dnf --clean --sources=${SOURCE_DIR} --result=${RPM_DIR} --rebuild ${SRCRPM_DIR}/${SRC_RPM} || { cat ${RPM_DIR}/{root,build}.log; exit 1; }
50ls -la ${SOURCE_DIR} ${SRCRPM_DIR} ${RPM_DIR}
diff --git a/.github/monitoring-plugins.spec b/.github/monitoring-plugins.spec
new file mode 100644
index 0000000..5cae3e5
--- /dev/null
+++ b/.github/monitoring-plugins.spec
@@ -0,0 +1,975 @@
1%global upstream_name monitoring-plugins
2%global version 2.3.3
3%global plugindir %{_libdir}/monitoring/plugins
4%global commit 72dd0a308130b9778828d143d1b9d9906218d6ac
5%global shortcommit %(c=%{commit}; echo ${c:0:7})
6%global fromgit 0
7
8%define _unpackaged_files_terminate_build 0
9
10Name: %{upstream_name}
11Version: %{version}
12Summary: Monitoring Plugins from the Monitoring Plugins Team
13
14License: GPLv3
15URL: https://www.monitoring-plugins.org
16## When using checkouts from git, use the following
17%if 0%{?fromgit}
18Release: git.%{?shortcommit}.1%{?dist}
19Source0: https://github.com/monitoring-plugins/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
20%else
21Release: 1%{?dist}
22Source0: https://www.monitoring-plugins.org/download/monitoring-plugins-%{version}.tar.gz
23%endif
24Conflicts: nagios-plugins
25
26
27
28
29##### BUILD REQUIREMENTS #####
30# Needed for the git code
31%if 0%{?fromgit}
32BuildRequires: automake
33BuildRequires: autoconf
34BuildRequires: gettext-devel
35%endif
36### General build requirements
37BuildRequires: gcc
38BuildRequires: make
39BuildRequires: automake
40
41### Check Plugin specific build requirements
42# check_by_ssh
43BuildRequires: openssh-clients
44
45# check_curl
46BuildRequires: libcurl-devel >= 7.15.2
47BuildRequires: openssl-devel
48BuildRequires: uriparser-devel >= 0.7.5
49
50# check_dbi
51%if 0%{?rhel} != 9
52BuildRequires: libdbi-devel
53%endif
54
55# check_dig check_dns
56BuildRequires: bind-utils
57
58# check_disk_smb
59%if 0%{?rhel} == 7
60BuildRequires: samba-client
61%endif
62
63# check_fping
64BuildRequires: fping
65
66# check_game
67%if 0%{?rhel} != 8
68BuildRequires: qstat
69%endif
70
71# check_hpjd
72BuildRequires: net-snmp-utils
73
74# check_ldap check_ldaps
75BuildRequires: openldap-devel
76
77# check_load
78BuildRequires: procps-ng
79
80# check_mysql check_mysql_query
81%if 0%{?rhel} == 7
82BuildRequires: mariadb-devel
83%endif
84
85# check_pgsql
86BuildRequires: postgresql-devel
87
88# check_radius
89BuildRequires: radcli-devel
90
91%description
92Common files for Monitoring Plugins
93
94%files
95%{plugindir}/negate
96%{plugindir}/urlize
97%{plugindir}/utils.pm
98%{plugindir}/utils.sh
99%doc ABOUT-NLS
100%doc ACKNOWLEDGEMENTS
101%doc AUTHORS
102%doc CODING
103%doc FAQ
104%doc NEWS
105%doc README
106%doc REQUIREMENTS
107%doc SUPPORT
108%license COPYING
109
110
111
112
113##### ACTUAL BUILD #####
114%prep
115%if 0%{?fromgit}
116%autosetup -n %{upstream_name}-%{commit}
117%else
118%autosetup -n %{upstream_name}-%{version}
119%endif
120
121
122%build
123%if 0%{?fromgit}
124./tools/setup
125%endif
126%configure \
127 --prefix=%{_prefix} \
128 --libexecdir=%{plugindir} \
129 --with-openssl=/usr \
130 --with-ping-command="/usr/bin/ping -4 -n -U -w %d -c %d %s" \
131 --with-ping6-command="/usr/bin/ping -6 -n -U -w %d -c %d %s"
132%make_build
133
134%if 0%{?fromgit}
135make THANKS
136%endif
137
138%install
139%make_install
140%{__make} install-root DESTDIR=%{buildroot} INSTALL="%{__install} -p"
141
142
143
144
145##### SUB PACKAGES #####
146# all
147%package all
148Summary: Monitoring Plugins - All Check Plugins
149Requires: %{name}
150Requires: %{name}-apt
151Requires: %{name}-breeze
152Requires: %{name}-by_ssh
153Requires: %{name}-cluster
154Requires: %{name}-curl
155%if 0%{?rhel} != 9
156Requires: %{name}-dbi
157%endif
158Requires: %{name}-dhcp
159Requires: %{name}-dig
160Requires: %{name}-disk
161%if 0%{?rhel} == 7
162Requires: %{name}-disk_smb
163%endif
164Requires: %{name}-dns
165Requires: %{name}-dummy
166Requires: %{name}-file_age
167Requires: %{name}-flexlm
168Requires: %{name}-fping
169%if 0%{?rhel} != 8
170Requires: %{name}-game
171%endif
172Requires: %{name}-hpjd
173Requires: %{name}-http
174Requires: %{name}-icmp
175Requires: %{name}-ide_smart
176Requires: %{name}-ifoperstatus
177Requires: %{name}-ifstatus
178Requires: %{name}-ircd
179Requires: %{name}-ldap
180Requires: %{name}-load
181Requires: %{name}-log
182Requires: %{name}-mailq
183Requires: %{name}-mrtg
184Requires: %{name}-mrtgtraf
185%if 0%{?rhel} == 7
186Requires: %{name}-mysql
187Requires: %{name}-mysql_query
188%endif
189Requires: %{name}-nagios
190Requires: %{name}-nt
191Requires: %{name}-ntp
192Requires: %{name}-ntp_peer
193Requires: %{name}-ntp_time
194Requires: %{name}-nwstat
195Requires: %{name}-oracle
196Requires: %{name}-overcr
197Requires: %{name}-pgsql
198Requires: %{name}-ping
199Requires: %{name}-procs
200Requires: %{name}-radius
201Requires: %{name}-real
202Requires: %{name}-rpc
203Requires: %{name}-sensors
204Requires: %{name}-smtp
205Requires: %{name}-snmp
206Requires: %{name}-ssh
207Requires: %{name}-swap
208Requires: %{name}-tcp
209Requires: %{name}-time
210Requires: %{name}-ups
211Requires: %{name}-uptime
212Requires: %{name}-users
213Requires: %{name}-wave
214
215%description all
216Meta package that requires all the check plugins of the Monitoring Plugins
217
218%files all
219
220
221
222# check_apt
223%package apt
224Summary: Monitoring Plugins - check_apt
225Requires: %{name} = %{version}-%{release}
226
227%description apt
228Provides check_apt of the Monitoring Plugins.
229
230%files apt
231%{plugindir}/check_apt
232
233
234
235# check_breeze
236%package breeze
237Summary: Monitoring Plugins - check_breeze
238Requires: %{name} = %{version}-%{release}
239
240%description breeze
241Provides check_breeze of the Monitoring Plugins.
242
243%files breeze
244%{plugindir}/check_breeze
245
246
247
248# check_by_ssh
249%package by_ssh
250Summary: Monitoring Plugins - check_by_ssh
251Requires: %{name} = %{version}-%{release}
252
253%description by_ssh
254Provides check_by_ssh of the Monitoring Plugins.
255
256%files by_ssh
257%{plugindir}/check_by_ssh
258
259
260
261# check_cluster
262%package cluster
263Summary: Monitoring Plugins - check_cluster
264Requires: %{name} = %{version}-%{release}
265
266%description cluster
267Provides check_cluster of the Monitoring Plugins.
268
269%files cluster
270%{plugindir}/check_cluster
271
272
273
274# check_curl
275%package curl
276Summary: Monitoring Plugins - check_curl
277Requires: %{name} = %{version}-%{release}
278
279%description curl
280Provides check_curl of the Monitoring Plugins.
281
282%files curl
283%{plugindir}/check_curl
284
285
286
287# check_dbi
288%if 0%{?rhel} != 9
289%package dbi
290Summary: Monitoring Plugins - check_dbi
291Requires: %{name} = %{version}-%{release}
292
293%description dbi
294Provides check_dbi of the Monitoring Plugins.
295
296%files dbi
297%{plugindir}/check_dbi
298%endif
299
300
301
302# check_dhcp
303%package dhcp
304Summary: Monitoring Plugins - check_dhcp
305Requires: %{name} = %{version}-%{release}
306
307%description dhcp
308Provides check_dhcp of the Monitoring Plugins.
309
310%files dhcp
311%{plugindir}/check_dhcp
312
313
314
315# check_dig
316%package dig
317Summary: Monitoring Plugins - check_dig
318Requires: %{name} = %{version}-%{release}
319Requires: bind-utils
320
321%description dig
322Provides check_dig of the Monitoring Plugins.
323
324%files dig
325%{plugindir}/check_dig
326
327
328
329# check_disk
330%package disk
331Summary: Monitoring Plugins - check_disk
332Requires: %{name} = %{version}-%{release}
333
334%description disk
335Provides check_disk of the Monitoring Plugins.
336
337%files disk
338%{plugindir}/check_disk
339
340
341
342# check_disk_smb
343%if 0%{?rhel} == 7
344%package disk_smb
345Summary: Monitoring Plugins - check_disk_smb
346Requires: %{name} = %{version}-%{release}
347Requires: samba-client
348
349%description disk_smb
350Provides check_disk_smb of the Monitoring Plugins.
351
352%files disk_smb
353%{plugindir}/check_disk_smb
354%endif
355
356
357
358# check_dns
359%package dns
360Summary: Monitoring Plugins - check_dns
361Requires: %{name} = %{version}-%{release}
362Requires: bind-utils
363
364%description dns
365Provides check_dns of the Monitoring Plugins.
366
367%files dns
368%{plugindir}/check_dns
369
370
371
372# check_dummy
373%package dummy
374Summary: Monitoring Plugins - check_dummy
375Requires: %{name} = %{version}-%{release}
376
377%description dummy
378Provides check_dummy of the Monitoring Plugins.
379
380%files dummy
381%{plugindir}/check_dummy
382
383
384
385# check_file_age
386%package file_age
387Summary: Monitoring Plugins - check_file_age
388Requires: %{name} = %{version}-%{release}
389
390%description file_age
391Provides check_file_age of the Monitoring Plugins.
392
393%files file_age
394%{plugindir}/check_file_age
395
396
397
398# check_flexlm
399%package flexlm
400Summary: Monitoring Plugins - check_flexlm
401Requires: %{name} = %{version}-%{release}
402
403%description flexlm
404Provides check_flexlm of the Monitoring Plugins.
405
406%files flexlm
407%{plugindir}/check_flexlm
408
409
410
411# check_fping
412%package fping
413Summary: Monitoring Plugins - check_fping
414Requires: %{name} = %{version}-%{release}
415Requires: fping
416
417%description fping
418Provides check_fping of the Monitoring Plugins.
419
420%files fping
421%{plugindir}/check_fping
422
423
424
425# check_game
426%if 0%{?rhel} != 8
427%package game
428Summary: Monitoring Plugins - check_fping
429Requires: %{name} = %{version}-%{release}
430Requires: qstat
431
432%description game
433Provides check_game of the Monitoring Plugins.
434
435%files game
436%{plugindir}/check_game
437%endif
438
439
440
441# check_hpjd
442%package hpjd
443Summary: Monitoring Plugins - check_hpjd
444Requires: %{name} = %{version}-%{release}
445
446%description hpjd
447Provides check_hpjd of the Monitoring Plugins.
448
449%files hpjd
450%{plugindir}/check_hpjd
451
452
453
454# check_http
455%package http
456Summary: Monitoring Plugins - check_http
457Requires: %{name} = %{version}-%{release}
458
459%description http
460Provides check_http of the Monitoring Plugins.
461
462%files http
463%{plugindir}/check_http
464
465
466
467# check_icmp
468%package icmp
469Summary: Monitoring Plugins - check_icmp
470Requires: %{name} = %{version}-%{release}
471
472%description icmp
473Provides check_icmp of the Monitoring Plugins.
474
475%files icmp
476%{plugindir}/check_icmp
477
478
479
480# check_ide_smart
481%package ide_smart
482Summary: Monitoring Plugins - check_ide_smart
483Requires: %{name} = %{version}-%{release}
484
485%description ide_smart
486Provides check_ide_smart of the Monitoring Plugins.
487
488%files ide_smart
489%{plugindir}/check_ide_smart
490
491
492
493# check_ifoperstatus
494%package ifoperstatus
495Summary: Monitoring Plugins - check_ifoperstatus
496Requires: %{name} = %{version}-%{release}
497Requires: perl(Net::SNMP)
498
499%description ifoperstatus
500Provides check_ifoperstatus of the Monitoring Plugins.
501
502%files ifoperstatus
503%{plugindir}/check_ifoperstatus
504
505
506
507# check_ifstatus
508%package ifstatus
509Summary: Monitoring Plugins - check_ifstatus
510Requires: %{name} = %{version}-%{release}
511
512%description ifstatus
513Provides check_ifstatus of the Monitoring Plugins.
514
515%files ifstatus
516%{plugindir}/check_ifstatus
517
518
519
520# check_ircd
521%package ircd
522Summary: Monitoring Plugins - check_ircd
523Requires: %{name} = %{version}-%{release}
524
525%description ircd
526Provides check_ircd of the Monitoring Plugins.
527
528%files ircd
529%{plugindir}/check_ircd
530
531
532
533# check_ldap
534%package ldap
535Summary: Monitoring Plugins - check_ldap
536Requires: %{name} = %{version}-%{release}
537
538%description ldap
539Provides check_ldap of the Monitoring Plugins.
540
541%files ldap
542%{plugindir}/check_ldap
543%{plugindir}/check_ldaps
544
545
546
547# check_load
548%package load
549Summary: Monitoring Plugins - check_load
550Requires: %{name} = %{version}-%{release}
551Requires: procps-ng
552
553%description load
554Provides check_load of the Monitoring Plugins.
555
556%files load
557%{plugindir}/check_load
558
559
560
561# check_log
562%package log
563Summary: Monitoring Plugins - check_log
564Requires: %{name} = %{version}-%{release}
565
566%description log
567Provides check_log of the Monitoring Plugins.
568
569%files log
570%{plugindir}/check_log
571
572
573
574# check_mailq
575%package mailq
576Summary: Monitoring Plugins - check_mailq
577Requires: %{name} = %{version}-%{release}
578
579%description mailq
580Provides check_mailq of the Monitoring Plugins.
581
582%files mailq
583%{plugindir}/check_mailq
584
585
586
587# check_mrtg
588%package mrtg
589Summary: Monitoring Plugins - check_mrtg
590Requires: %{name} = %{version}-%{release}
591
592%description mrtg
593Provides check_mrtg of the Monitoring Plugins.
594
595%files mrtg
596%{plugindir}/check_mrtg
597
598
599
600# check_mrtgtraf
601%package mrtgtraf
602Summary: Monitoring Plugins - check_mrtgtraf
603Requires: %{name} = %{version}-%{release}
604
605%description mrtgtraf
606Provides check_mrtgtraf of the Monitoring Plugins.
607
608%files mrtgtraf
609%{plugindir}/check_mrtgtraf
610
611
612
613%if 0%{?rhel} == 7
614# check_mysql
615%package mysql
616Summary: Monitoring Plugins - check_mysql
617Requires: %{name} = %{version}-%{release}
618
619%description mysql
620Provides check_mysql of the Monitoring Plugins.
621
622%files mysql
623%{plugindir}/check_mysql
624
625
626
627# check_mysql_query
628%package mysql_query
629Summary: Monitoring Plugins - check_mysql_query
630Requires: %{name} = %{version}-%{release}
631
632%description mysql_query
633Provides check_mysql_query of the Monitoring Plugins.
634
635%files mysql_query
636%{plugindir}/check_mysql_query
637%endif
638
639
640
641# check_nagios
642%package nagios
643Summary: Monitoring Plugins - check_nagios
644Requires: %{name} = %{version}-%{release}
645
646%description nagios
647Provides check_nagios of the Monitoring Plugins.
648
649%files nagios
650%{plugindir}/check_nagios
651
652
653
654# check_nt
655%package nt
656Summary: Monitoring Plugins - check_nt
657Requires: %{name} = %{version}-%{release}
658
659%description nt
660Provides check_nt of the Monitoring Plugins.
661
662%files nt
663%{plugindir}/check_nt
664
665
666
667# check_ntp
668%package ntp
669Summary: Monitoring Plugins - check_ntp
670Requires: %{name} = %{version}-%{release}
671
672%description ntp
673Provides check_ntp of the Monitoring Plugins.
674
675%files ntp
676%{plugindir}/check_ntp
677
678
679
680# check_ntp_peer
681%package ntp_peer
682Summary: Monitoring Plugins - check_ntp_peer
683Requires: %{name} = %{version}-%{release}
684
685%description ntp_peer
686Provides check_ntp_peer of the Monitoring Plugins.
687
688%files ntp_peer
689%{plugindir}/check_ntp_peer
690
691
692
693# check_ntp_time
694%package ntp_time
695Summary: Monitoring Plugins - check_ntp_time
696Requires: %{name} = %{version}-%{release}
697
698%description ntp_time
699Provides check_ntp_time of the Monitoring Plugins.
700
701%files ntp_time
702%{plugindir}/check_ntp_time
703
704
705
706# check_nwstat
707%package nwstat
708Summary: Monitoring Plugins - check_nwstat
709Requires: %{name} = %{version}-%{release}
710
711%description nwstat
712Provides check_nwstat of the Monitoring Plugins.
713
714%files nwstat
715%{plugindir}/check_nwstat
716
717
718
719# check_oracle
720%package oracle
721Summary: Monitoring Plugins - check_oracle
722Requires: %{name} = %{version}-%{release}
723
724%description oracle
725Provides check_oracle of the Monitoring Plugins.
726
727%files oracle
728%{plugindir}/check_oracle
729
730
731
732# check_overcr
733%package overcr
734Summary: Monitoring Plugins - check_overcr
735Requires: %{name} = %{version}-%{release}
736
737%description overcr
738Provides check_overcr of the Monitoring Plugins.
739
740%files overcr
741%{plugindir}/check_overcr
742
743
744
745# check_pgsql
746%package pgsql
747Summary: Monitoring Plugins - check_pgsql
748Requires: %{name} = %{version}-%{release}
749
750%description pgsql
751Provides check_pgsql of the Monitoring Plugins.
752
753%files pgsql
754%{plugindir}/check_pgsql
755
756
757
758# check_ping
759%package ping
760Summary: Monitoring Plugins - check_ping
761Requires: %{name} = %{version}-%{release}
762
763%description ping
764Provides check_ping of the Monitoring Plugins.
765
766%files ping
767%{plugindir}/check_ping
768
769
770
771# check_procs
772%package procs
773Summary: Monitoring Plugins - check_procs
774Requires: %{name} = %{version}-%{release}
775
776%description procs
777Provides check_procs of the Monitoring Plugins.
778
779%files procs
780%{plugindir}/check_procs
781
782
783
784# check_radius
785%package radius
786Summary: Monitoring Plugins - check_radius
787Requires: %{name} = %{version}-%{release}
788
789%description radius
790Provides check_radius of the Monitoring Plugins.
791
792%files radius
793%{plugindir}/check_radius
794
795
796
797# check_real
798%package real
799Summary: Monitoring Plugins - check_real
800Requires: %{name} = %{version}-%{release}
801
802%description real
803Provides check_real of the Monitoring Plugins.
804
805%files real
806%{plugindir}/check_real
807
808
809
810# check_rpc
811%package rpc
812Summary: Monitoring Plugins - check_rpc
813Requires: %{name} = %{version}-%{release}
814
815%description rpc
816Provides check_rpc of the Monitoring Plugins.
817
818%files rpc
819%{plugindir}/check_rpc
820
821
822
823# check_sensors
824%package sensors
825Summary: Monitoring Plugins - check_sensors
826Requires: %{name} = %{version}-%{release}
827Requires: lm_sensors
828
829%description sensors
830Provides check_sensors of the Monitoring Plugins.
831
832%files sensors
833%{plugindir}/check_sensors
834
835
836
837# check_smtp
838%package smtp
839Summary: Monitoring Plugins - check_smtp
840Requires: %{name} = %{version}-%{release}
841
842%description smtp
843Provides check_smtp of the Monitoring Plugins.
844
845%files smtp
846%{plugindir}/check_smtp
847
848
849
850# check_snmp
851%package snmp
852Summary: Monitoring Plugins - check_snmp
853Requires: %{name} = %{version}-%{release}
854Requires: net-snmp
855
856%description snmp
857Provides check_snmp of the Monitoring Plugins.
858
859%files snmp
860%{plugindir}/check_snmp
861
862
863
864# check_ssh
865%package ssh
866Summary: Monitoring Plugins - check_ssh
867Requires: %{name} = %{version}-%{release}
868
869%description ssh
870Provides check_ssh of the Monitoring Plugins.
871
872%files ssh
873%{plugindir}/check_ssh
874
875
876
877# check_swap
878%package swap
879Summary: Monitoring Plugins - check_swap
880Requires: %{name} = %{version}-%{release}
881
882%description swap
883Provides check_swap of the Monitoring Plugins.
884
885%files swap
886%{plugindir}/check_swap
887
888
889
890# check_tcp
891%package tcp
892Summary: Monitoring Plugins - check_tcp
893Requires: %{name} = %{version}-%{release}
894
895%description tcp
896Provides check_tcp of the Monitoring Plugins.
897
898%files tcp
899%{plugindir}/check_clamd
900%{plugindir}/check_ftp
901%{plugindir}/check_imap
902%{plugindir}/check_jabber
903%{plugindir}/check_nntp
904%{plugindir}/check_nntps
905%{plugindir}/check_pop
906%{plugindir}/check_simap
907%{plugindir}/check_spop
908%{plugindir}/check_ssmtp
909%{plugindir}/check_tcp
910%{plugindir}/check_udp
911
912
913
914# check_time
915%package time
916Summary: Monitoring Plugins - check_time
917Requires: %{name} = %{version}-%{release}
918
919%description time
920Provides check_time of the Monitoring Plugins.
921
922%files time
923%{plugindir}/check_time
924
925
926
927# check_ups
928%package ups
929Summary: Monitoring Plugins - check_ups
930Requires: %{name} = %{version}-%{release}
931
932%description ups
933Provides check_ups of the Monitoring Plugins.
934
935%files ups
936%{plugindir}/check_ups
937
938
939
940# check_uptime
941%package uptime
942Summary: Monitoring Plugins - check_uptime
943Requires: %{name} = %{version}-%{release}
944
945%description uptime
946Provides check_uptime of the Monitoring Plugins.
947
948%files uptime
949%{plugindir}/check_uptime
950
951
952
953# check_users
954%package users
955Summary: Monitoring Plugins - check_users
956Requires: %{name} = %{version}-%{release}
957
958%description users
959Provides check_users of the Monitoring Plugins.
960
961%files users
962%{plugindir}/check_users
963
964
965
966# check_wave
967%package wave
968Summary: Monitoring Plugins - check_wave
969Requires: %{name} = %{version}-%{release}
970
971%description wave
972Provides check_wave of the Monitoring Plugins.
973
974%files wave
975%{plugindir}/check_wave
diff --git a/.github/os_detect.sh b/.github/os_detect.sh
new file mode 100644
index 0000000..ee9c145
--- /dev/null
+++ b/.github/os_detect.sh
@@ -0,0 +1,18 @@
1#!/bin/sh -e
2# workaround for really bare-bones Archlinux containers:
3if [ -x "$(command -v pacman)" ]; then
4 pacman --noconfirm -Sy
5 pacman --noconfirm -S grep gawk sed
6fi
7
8os_release_file=
9if [ -s "/etc/os-release" ]; then
10 os_release_file="/etc/os-release"
11elif [ -s "/usr/lib/os-release" ]; then
12 os_release_file="/usr/lib/os-release"
13else
14 echo >&2 "Cannot find an os-release file ..."
15 return 1
16fi
17export distro_id=$(grep '^ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g')
18export platform_id=$(grep '^PLATFORM_ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g'| cut -d":" -f2)
diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh
index dcf778b..3f4674a 100755
--- a/.github/prepare_debian.sh
+++ b/.github/prepare_debian.sh
@@ -64,13 +64,9 @@ apt-get -y install perl \
64 iproute2 64 iproute2
65 65
66# remove ipv6 interface from hosts 66# remove ipv6 interface from hosts
67if [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ]; then 67sed '/^::1/d' /etc/hosts > /tmp/hosts
68 sed '/^::1/d' /etc/hosts > /tmp/hosts 68cp -f /tmp/hosts /etc/hosts
69 cp -f /tmp/hosts /etc/hosts
70fi
71
72ip addr show 69ip addr show
73
74cat /etc/hosts 70cat /etc/hosts
75 71
76# apache 72# apache
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 0317c8c..c402e0c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -44,7 +44,7 @@ jobs:
44 44
45 # Initializes the CodeQL tools for scanning. 45 # Initializes the CodeQL tools for scanning.
46 - name: Initialize CodeQL 46 - name: Initialize CodeQL
47 uses: github/codeql-action/init@v2 47 uses: github/codeql-action/init@v3
48 with: 48 with:
49 languages: ${{ matrix.language }} 49 languages: ${{ matrix.language }}
50 # If you wish to specify custom queries, you can do so here or in a config file. 50 # If you wish to specify custom queries, you can do so here or in a config file.
@@ -70,4 +70,4 @@ jobs:
70 make 70 make
71 71
72 - name: Perform CodeQL Analysis 72 - name: Perform CodeQL Analysis
73 uses: github/codeql-action/analyze@v2 73 uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml
new file mode 100644
index 0000000..72f7c7e
--- /dev/null
+++ b/.github/workflows/spellcheck.yml
@@ -0,0 +1,27 @@
1---
2name: Spellcheck
3
4on:
5 # Run for pushes on any branch
6 push:
7 branches:
8 - '*'
9 # Run for any PRs
10 pull_request:
11
12jobs:
13 codespell:
14 name: codespell
15 strategy:
16 fail-fast: false
17 runs-on: ubuntu-latest
18 steps:
19 - name: Checkout
20 uses: actions/checkout@v4
21 - name: Codespell
22 uses: codespell-project/actions-codespell@v2
23 with:
24 skip: "./.git,./.gitignore,./ABOUT-NLS,./gl,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in"
25 ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse,slac
26 check_filenames: true
27 check_hidden: true
diff --git a/.github/workflows/test-next.yml b/.github/workflows/test-next.yml
new file mode 100644
index 0000000..8124075
--- /dev/null
+++ b/.github/workflows/test-next.yml
@@ -0,0 +1,78 @@
1---
2name: Tests Debian:Testing and Fedora:Rawhide
3
4on:
5 workflow_dispatch: {}
6 push:
7 branches-ignore:
8 - '*'
9 schedule:
10 # Run every week on Monday at 9:00 AM (UTC)
11 - cron: '0 9 * * 1'
12
13jobs:
14 full-test:
15 name: Running unit and integrationt tests
16 runs-on: ubuntu-latest
17 strategy:
18 fail-fast: false
19 matrix:
20 distro:
21 - 'debian:testing'
22 include:
23 - distro: 'debian:testing'
24 prepare: .github/prepare_debian.sh
25 steps:
26 - name: Git clone repository
27 uses: actions/checkout@v4
28 - name: Run the tests on ${{ matrix.distro }}
29 run: |
30 docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol
31 docker run \
32 -e NPTEST_ACCEPTDEFAULT=1 \
33 -e NPTEST_CACHE="/src/.github/NPTest.cache" \
34 -w /src -v ${PWD}:/src \
35 --tmpfs /media/ramdisk1 \
36 -v /var/run/utmp:/var/run/utmp \
37 --mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \
38 ${{ matrix.distro }} \
39 /bin/sh -c '${{ matrix.prepare }} && \
40 tools/setup && \
41 ./configure --enable-libtap --with-ipv6=no && \
42 make && \
43 make test && \
44 make dist && \
45 tar zxf monitoring-plugins-*.tar.gz && \
46 cd monitoring-plugins-*/ && \
47 ./configure && \
48 make'
49 docker container prune -f
50 docker volume prune -f
51
52 build-test:
53 name: Running rpm build test on ${{ matrix.distro }}
54 runs-on: ubuntu-latest
55 strategy:
56 fail-fast: false
57 matrix:
58 include:
59 - {"distro": "fedora:rawhide", "build": ".github/mock.sh"}
60 steps:
61 - name: Git clone repository
62 uses: actions/checkout@v4
63 - name: Run the tests on ${{ matrix.distro }}
64 run: |
65 docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol
66 docker run \
67 --privileged=true \
68 -e NPTEST_ACCEPTDEFAULT=1 \
69 -e NPTEST_CACHE="/src/.github/NPTest.cache" \
70 -w /src -v ${PWD}:/src \
71 --tmpfs /media/ramdisk1 \
72 -v /var/run/utmp:/var/run/utmp \
73 --mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \
74 ${{ matrix.distro }} \
75 /bin/sh -c '${{ matrix.build }} && \
76 ls -la'
77 docker container prune -f
78 docker volume prune -f
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 77b09f4..77ca658 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,65 +1,27 @@
1--- 1---
2name: Test 2name: Tests
3 3
4on: 4on:
5 push: 5 push:
6 branches: 6 branches:
7 - '*' 7 - '*'
8 # Run test for any PRs
9 pull_request: 8 pull_request:
10 9
11jobs: 10jobs:
12 codespell: 11 full-test:
13 name: codespell 12 name: Running unit and integrationt tests
14 strategy:
15 fail-fast: false
16 runs-on: ubuntu-latest 13 runs-on: ubuntu-latest
17 steps:
18 - name: Checkout
19 uses: actions/checkout@v4
20 - name: Codespell
21 uses: codespell-project/actions-codespell@v2
22 with:
23 skip: "./.git,./.gitignore,./ABOUT-NLS,*.po,./gl,./po,./tools/squid.conf,./build-aux/ltmain.sh"
24 ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners
25 check_filenames: true
26 check_hidden: true
27# super-linter:
28# name: super-linter
29# strategy:
30# fail-fast: false
31# runs-on: ubuntu-latest
32# steps:
33# - name: Checkout
34# uses: actions/checkout@v4
35# - name: Lint Code Base
36# uses: github/super-linter@v5.0.0
37# env:
38# DEFAULT_BRANCH: master
39# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40# macos:
41# ...
42 linux:
43 needs:
44 - codespell
45# - super-linter
46 runs-on: ubuntu-latest
47 name: Running tests on ${{ matrix.distro }}
48 strategy: 14 strategy:
49 fail-fast: false 15 fail-fast: false
50 matrix: 16 matrix:
51 distro: 17 distro:
52 - 'debian:testing' 18 - 'debian:stable'
53 #...
54 include: 19 include:
55 - distro: 'debian:testing' 20 - distro: 'debian:stable'
56 prepare: .github/prepare_debian.sh 21 prepare: .github/prepare_debian.sh
57 #...
58 steps: 22 steps:
59 - name: Git clone repository 23 - name: Git clone repository
60 uses: actions/checkout@v4 24 uses: actions/checkout@v4
61 #- name: Setup tmate session, see https://github.com/marketplace/actions/debugging-with-tmate
62 # uses: mxschmitt/action-tmate@v3
63 - name: Run the tests on ${{ matrix.distro }} 25 - name: Run the tests on ${{ matrix.distro }}
64 run: | 26 run: |
65 docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol 27 docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol
@@ -74,11 +36,43 @@ jobs:
74 /bin/sh -c '${{ matrix.prepare }} && \ 36 /bin/sh -c '${{ matrix.prepare }} && \
75 tools/setup && \ 37 tools/setup && \
76 ./configure --enable-libtap --with-ipv6=no && \ 38 ./configure --enable-libtap --with-ipv6=no && \
77 set -x && \
78 tmp_dir=$(mktemp -d -t test-XXXX) && cp -a po/ $tmp_dir/ && \
79 cd po && make update-po && cd .. && \
80 diff -Nur $tmp_dir/po/*.po po/*.po | tee -a /tmp/po.diff && diff -Nur $tmp_dir/po/*.pot po/*.pot | tee -a /tmp/po.diff && if [ $(wc -l /tmp/po.diff | cut -f 1 -d" ") -gt 0 ]; then echo "Error: Translations needs to be updated with make update-po!" && exit 1; fi && \
81 make && \ 39 make && \
82 make test' 40 make test && \
41 make dist && \
42 tar zxf monitoring-plugins-*.tar.gz && \
43 cd monitoring-plugins-*/ && \
44 ./configure && \
45 make'
46 docker container prune -f
47 docker volume prune -f
48
49 build-test:
50 name: Running rpm build test on ${{ matrix.distro }}
51 runs-on: ubuntu-latest
52 strategy:
53 fail-fast: false
54 matrix:
55 include:
56 - {"distro": "fedora:latest", "build": ".github/mock.sh"}
57 - {"distro": "rockylinux:8", "build": ".github/mock.sh"}
58 - {"distro": "almalinux:9", "build": ".github/mock.sh"}
59# - {"distro": "oraclelinux:9", "build": ".github/mock.sh"}
60 steps:
61 - name: Git clone repository
62 uses: actions/checkout@v4
63 - name: Run the tests on ${{ matrix.distro }}
64 run: |
65 docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol
66 docker run \
67 --privileged=true \
68 -e NPTEST_ACCEPTDEFAULT=1 \
69 -e NPTEST_CACHE="/src/.github/NPTest.cache" \
70 -w /src -v ${PWD}:/src \
71 --tmpfs /media/ramdisk1 \
72 -v /var/run/utmp:/var/run/utmp \
73 --mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \
74 ${{ matrix.distro }} \
75 /bin/sh -c '${{ matrix.build }} && \
76 ls -la'
83 docker container prune -f 77 docker container prune -f
84 docker volume prune -f 78 docker volume prune -f