diff options
author | waja <waja@users.noreply.github.com> | 2024-02-23 14:25:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 14:25:44 +0100 |
commit | 0c01f2946ed21f5e7977b5503f9c9f00e72fd708 (patch) | |
tree | 12970968285d666e22d7d06644804edd2bf7d7e7 /.github | |
parent | f6d7bf86563e53aeca1f764a4c61e6025049406a (diff) | |
download | monitoring-plugins-0c01f2946ed21f5e7977b5503f9c9f00e72fd708.tar.gz |
CI specfile (#1894)
* Adding spec file and github pipeline for testing
* Restructure github pipelines for more clarity
* Add build tests for several RPM based distributions
---------
Co-authored-by: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>
Diffstat (limited to '.github')
-rwxr-xr-x | .github/mock.sh | 50 | ||||
-rw-r--r-- | .github/monitoring-plugins.spec | 975 | ||||
-rw-r--r-- | .github/os_detect.sh | 18 | ||||
-rw-r--r-- | .github/workflows/spellcheck.yml | 27 | ||||
-rw-r--r-- | .github/workflows/test.yml | 76 |
5 files changed, 1105 insertions, 41 deletions
diff --git a/.github/mock.sh b/.github/mock.sh new file mode 100755 index 00000000..7fbe6903 --- /dev/null +++ b/.github/mock.sh | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -x | ||
4 | |||
5 | export DEBIAN_FRONTEND=noninteractive | ||
6 | |||
7 | BASE_PATH="/src" | ||
8 | |||
9 | ls -la ${BASE_PATH}/.github/os_detect.sh | ||
10 | . ${BASE_PATH}/.github/os_detect.sh | ||
11 | |||
12 | SRCRPM_DIR="/tmp/result-srcrpm" | ||
13 | RPM_DIR="/tmp/result-rpm" | ||
14 | SPEC_DIR="${BASE_PATH}/.github/" | ||
15 | SOURCE_DIR="." | ||
16 | SPEC_FILE="${SPEC_DIR}monitoring-plugins.spec" | ||
17 | |||
18 | cd ${BASE_PATH} | ||
19 | |||
20 | dnf -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) | ||
36 | SRC_RPM="monitoring-plugins-*-1.${platform_id}.src.rpm" | ||
37 | if 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" | ||
44 | fi | ||
45 | mkdir -p "${SRCRPM_DIR}" "${RPM_DIR}" | ||
46 | #rpmbuild --undefine=_disable_source_fetch --define "_sourcedir ${SOURCE_DIR}" -ba ${SPEC_FILE} | ||
47 | dnf -y --setopt="tsflags=nodocs" install rpmdevtools && spectool -g -C ${SOURCE_DIR} ${SPEC_FILE} && \ | ||
48 | mock --dnf --clean --spec ${SPEC_FILE} --sources=${SOURCE_DIR} --result=${SRCRPM_DIR} --build || { cat ${SRCRPM_DIR}/{root,build}.log; exit 1; } | ||
49 | mock --dnf --clean --sources=${SOURCE_DIR} --result=${RPM_DIR} --rebuild ${SRCRPM_DIR}/${SRC_RPM} || { cat ${RPM_DIR}/{root,build}.log; exit 1; } | ||
50 | ls -la ${SOURCE_DIR} ${SRCRPM_DIR} ${RPM_DIR} | ||
diff --git a/.github/monitoring-plugins.spec b/.github/monitoring-plugins.spec new file mode 100644 index 00000000..5cae3e59 --- /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 | |||
10 | Name: %{upstream_name} | ||
11 | Version: %{version} | ||
12 | Summary: Monitoring Plugins from the Monitoring Plugins Team | ||
13 | |||
14 | License: GPLv3 | ||
15 | URL: https://www.monitoring-plugins.org | ||
16 | ## When using checkouts from git, use the following | ||
17 | %if 0%{?fromgit} | ||
18 | Release: git.%{?shortcommit}.1%{?dist} | ||
19 | Source0: https://github.com/monitoring-plugins/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz | ||
20 | %else | ||
21 | Release: 1%{?dist} | ||
22 | Source0: https://www.monitoring-plugins.org/download/monitoring-plugins-%{version}.tar.gz | ||
23 | %endif | ||
24 | Conflicts: nagios-plugins | ||
25 | |||
26 | |||
27 | |||
28 | |||
29 | ##### BUILD REQUIREMENTS ##### | ||
30 | # Needed for the git code | ||
31 | %if 0%{?fromgit} | ||
32 | BuildRequires: automake | ||
33 | BuildRequires: autoconf | ||
34 | BuildRequires: gettext-devel | ||
35 | %endif | ||
36 | ### General build requirements | ||
37 | BuildRequires: gcc | ||
38 | BuildRequires: make | ||
39 | BuildRequires: automake | ||
40 | |||
41 | ### Check Plugin specific build requirements | ||
42 | # check_by_ssh | ||
43 | BuildRequires: openssh-clients | ||
44 | |||
45 | # check_curl | ||
46 | BuildRequires: libcurl-devel >= 7.15.2 | ||
47 | BuildRequires: openssl-devel | ||
48 | BuildRequires: uriparser-devel >= 0.7.5 | ||
49 | |||
50 | # check_dbi | ||
51 | %if 0%{?rhel} != 9 | ||
52 | BuildRequires: libdbi-devel | ||
53 | %endif | ||
54 | |||
55 | # check_dig check_dns | ||
56 | BuildRequires: bind-utils | ||
57 | |||
58 | # check_disk_smb | ||
59 | %if 0%{?rhel} == 7 | ||
60 | BuildRequires: samba-client | ||
61 | %endif | ||
62 | |||
63 | # check_fping | ||
64 | BuildRequires: fping | ||
65 | |||
66 | # check_game | ||
67 | %if 0%{?rhel} != 8 | ||
68 | BuildRequires: qstat | ||
69 | %endif | ||
70 | |||
71 | # check_hpjd | ||
72 | BuildRequires: net-snmp-utils | ||
73 | |||
74 | # check_ldap check_ldaps | ||
75 | BuildRequires: openldap-devel | ||
76 | |||
77 | # check_load | ||
78 | BuildRequires: procps-ng | ||
79 | |||
80 | # check_mysql check_mysql_query | ||
81 | %if 0%{?rhel} == 7 | ||
82 | BuildRequires: mariadb-devel | ||
83 | %endif | ||
84 | |||
85 | # check_pgsql | ||
86 | BuildRequires: postgresql-devel | ||
87 | |||
88 | # check_radius | ||
89 | BuildRequires: radcli-devel | ||
90 | |||
91 | %description | ||
92 | Common 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} | ||
135 | make 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 | ||
148 | Summary: Monitoring Plugins - All Check Plugins | ||
149 | Requires: %{name} | ||
150 | Requires: %{name}-apt | ||
151 | Requires: %{name}-breeze | ||
152 | Requires: %{name}-by_ssh | ||
153 | Requires: %{name}-cluster | ||
154 | Requires: %{name}-curl | ||
155 | %if 0%{?rhel} != 9 | ||
156 | Requires: %{name}-dbi | ||
157 | %endif | ||
158 | Requires: %{name}-dhcp | ||
159 | Requires: %{name}-dig | ||
160 | Requires: %{name}-disk | ||
161 | %if 0%{?rhel} == 7 | ||
162 | Requires: %{name}-disk_smb | ||
163 | %endif | ||
164 | Requires: %{name}-dns | ||
165 | Requires: %{name}-dummy | ||
166 | Requires: %{name}-file_age | ||
167 | Requires: %{name}-flexlm | ||
168 | Requires: %{name}-fping | ||
169 | %if 0%{?rhel} != 8 | ||
170 | Requires: %{name}-game | ||
171 | %endif | ||
172 | Requires: %{name}-hpjd | ||
173 | Requires: %{name}-http | ||
174 | Requires: %{name}-icmp | ||
175 | Requires: %{name}-ide_smart | ||
176 | Requires: %{name}-ifoperstatus | ||
177 | Requires: %{name}-ifstatus | ||
178 | Requires: %{name}-ircd | ||
179 | Requires: %{name}-ldap | ||
180 | Requires: %{name}-load | ||
181 | Requires: %{name}-log | ||
182 | Requires: %{name}-mailq | ||
183 | Requires: %{name}-mrtg | ||
184 | Requires: %{name}-mrtgtraf | ||
185 | %if 0%{?rhel} == 7 | ||
186 | Requires: %{name}-mysql | ||
187 | Requires: %{name}-mysql_query | ||
188 | %endif | ||
189 | Requires: %{name}-nagios | ||
190 | Requires: %{name}-nt | ||
191 | Requires: %{name}-ntp | ||
192 | Requires: %{name}-ntp_peer | ||
193 | Requires: %{name}-ntp_time | ||
194 | Requires: %{name}-nwstat | ||
195 | Requires: %{name}-oracle | ||
196 | Requires: %{name}-overcr | ||
197 | Requires: %{name}-pgsql | ||
198 | Requires: %{name}-ping | ||
199 | Requires: %{name}-procs | ||
200 | Requires: %{name}-radius | ||
201 | Requires: %{name}-real | ||
202 | Requires: %{name}-rpc | ||
203 | Requires: %{name}-sensors | ||
204 | Requires: %{name}-smtp | ||
205 | Requires: %{name}-snmp | ||
206 | Requires: %{name}-ssh | ||
207 | Requires: %{name}-swap | ||
208 | Requires: %{name}-tcp | ||
209 | Requires: %{name}-time | ||
210 | Requires: %{name}-ups | ||
211 | Requires: %{name}-uptime | ||
212 | Requires: %{name}-users | ||
213 | Requires: %{name}-wave | ||
214 | |||
215 | %description all | ||
216 | Meta package that requires all the check plugins of the Monitoring Plugins | ||
217 | |||
218 | %files all | ||
219 | |||
220 | |||
221 | |||
222 | # check_apt | ||
223 | %package apt | ||
224 | Summary: Monitoring Plugins - check_apt | ||
225 | Requires: %{name} = %{version}-%{release} | ||
226 | |||
227 | %description apt | ||
228 | Provides check_apt of the Monitoring Plugins. | ||
229 | |||
230 | %files apt | ||
231 | %{plugindir}/check_apt | ||
232 | |||
233 | |||
234 | |||
235 | # check_breeze | ||
236 | %package breeze | ||
237 | Summary: Monitoring Plugins - check_breeze | ||
238 | Requires: %{name} = %{version}-%{release} | ||
239 | |||
240 | %description breeze | ||
241 | Provides 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 | ||
250 | Summary: Monitoring Plugins - check_by_ssh | ||
251 | Requires: %{name} = %{version}-%{release} | ||
252 | |||
253 | %description by_ssh | ||
254 | Provides 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 | ||
263 | Summary: Monitoring Plugins - check_cluster | ||
264 | Requires: %{name} = %{version}-%{release} | ||
265 | |||
266 | %description cluster | ||
267 | Provides check_cluster of the Monitoring Plugins. | ||
268 | |||
269 | %files cluster | ||
270 | %{plugindir}/check_cluster | ||
271 | |||
272 | |||
273 | |||
274 | # check_curl | ||
275 | %package curl | ||
276 | Summary: Monitoring Plugins - check_curl | ||
277 | Requires: %{name} = %{version}-%{release} | ||
278 | |||
279 | %description curl | ||
280 | Provides 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 | ||
290 | Summary: Monitoring Plugins - check_dbi | ||
291 | Requires: %{name} = %{version}-%{release} | ||
292 | |||
293 | %description dbi | ||
294 | Provides 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 | ||
304 | Summary: Monitoring Plugins - check_dhcp | ||
305 | Requires: %{name} = %{version}-%{release} | ||
306 | |||
307 | %description dhcp | ||
308 | Provides check_dhcp of the Monitoring Plugins. | ||
309 | |||
310 | %files dhcp | ||
311 | %{plugindir}/check_dhcp | ||
312 | |||
313 | |||
314 | |||
315 | # check_dig | ||
316 | %package dig | ||
317 | Summary: Monitoring Plugins - check_dig | ||
318 | Requires: %{name} = %{version}-%{release} | ||
319 | Requires: bind-utils | ||
320 | |||
321 | %description dig | ||
322 | Provides check_dig of the Monitoring Plugins. | ||
323 | |||
324 | %files dig | ||
325 | %{plugindir}/check_dig | ||
326 | |||
327 | |||
328 | |||
329 | # check_disk | ||
330 | %package disk | ||
331 | Summary: Monitoring Plugins - check_disk | ||
332 | Requires: %{name} = %{version}-%{release} | ||
333 | |||
334 | %description disk | ||
335 | Provides 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 | ||
345 | Summary: Monitoring Plugins - check_disk_smb | ||
346 | Requires: %{name} = %{version}-%{release} | ||
347 | Requires: samba-client | ||
348 | |||
349 | %description disk_smb | ||
350 | Provides 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 | ||
360 | Summary: Monitoring Plugins - check_dns | ||
361 | Requires: %{name} = %{version}-%{release} | ||
362 | Requires: bind-utils | ||
363 | |||
364 | %description dns | ||
365 | Provides check_dns of the Monitoring Plugins. | ||
366 | |||
367 | %files dns | ||
368 | %{plugindir}/check_dns | ||
369 | |||
370 | |||
371 | |||
372 | # check_dummy | ||
373 | %package dummy | ||
374 | Summary: Monitoring Plugins - check_dummy | ||
375 | Requires: %{name} = %{version}-%{release} | ||
376 | |||
377 | %description dummy | ||
378 | Provides 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 | ||
387 | Summary: Monitoring Plugins - check_file_age | ||
388 | Requires: %{name} = %{version}-%{release} | ||
389 | |||
390 | %description file_age | ||
391 | Provides 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 | ||
400 | Summary: Monitoring Plugins - check_flexlm | ||
401 | Requires: %{name} = %{version}-%{release} | ||
402 | |||
403 | %description flexlm | ||
404 | Provides check_flexlm of the Monitoring Plugins. | ||
405 | |||
406 | %files flexlm | ||
407 | %{plugindir}/check_flexlm | ||
408 | |||
409 | |||
410 | |||
411 | # check_fping | ||
412 | %package fping | ||
413 | Summary: Monitoring Plugins - check_fping | ||
414 | Requires: %{name} = %{version}-%{release} | ||
415 | Requires: fping | ||
416 | |||
417 | %description fping | ||
418 | Provides 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 | ||
428 | Summary: Monitoring Plugins - check_fping | ||
429 | Requires: %{name} = %{version}-%{release} | ||
430 | Requires: qstat | ||
431 | |||
432 | %description game | ||
433 | Provides 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 | ||
443 | Summary: Monitoring Plugins - check_hpjd | ||
444 | Requires: %{name} = %{version}-%{release} | ||
445 | |||
446 | %description hpjd | ||
447 | Provides check_hpjd of the Monitoring Plugins. | ||
448 | |||
449 | %files hpjd | ||
450 | %{plugindir}/check_hpjd | ||
451 | |||
452 | |||
453 | |||
454 | # check_http | ||
455 | %package http | ||
456 | Summary: Monitoring Plugins - check_http | ||
457 | Requires: %{name} = %{version}-%{release} | ||
458 | |||
459 | %description http | ||
460 | Provides check_http of the Monitoring Plugins. | ||
461 | |||
462 | %files http | ||
463 | %{plugindir}/check_http | ||
464 | |||
465 | |||
466 | |||
467 | # check_icmp | ||
468 | %package icmp | ||
469 | Summary: Monitoring Plugins - check_icmp | ||
470 | Requires: %{name} = %{version}-%{release} | ||
471 | |||
472 | %description icmp | ||
473 | Provides 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 | ||
482 | Summary: Monitoring Plugins - check_ide_smart | ||
483 | Requires: %{name} = %{version}-%{release} | ||
484 | |||
485 | %description ide_smart | ||
486 | Provides 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 | ||
495 | Summary: Monitoring Plugins - check_ifoperstatus | ||
496 | Requires: %{name} = %{version}-%{release} | ||
497 | Requires: perl(Net::SNMP) | ||
498 | |||
499 | %description ifoperstatus | ||
500 | Provides check_ifoperstatus of the Monitoring Plugins. | ||
501 | |||
502 | %files ifoperstatus | ||
503 | %{plugindir}/check_ifoperstatus | ||
504 | |||
505 | |||
506 | |||
507 | # check_ifstatus | ||
508 | %package ifstatus | ||
509 | Summary: Monitoring Plugins - check_ifstatus | ||
510 | Requires: %{name} = %{version}-%{release} | ||
511 | |||
512 | %description ifstatus | ||
513 | Provides check_ifstatus of the Monitoring Plugins. | ||
514 | |||
515 | %files ifstatus | ||
516 | %{plugindir}/check_ifstatus | ||
517 | |||
518 | |||
519 | |||
520 | # check_ircd | ||
521 | %package ircd | ||
522 | Summary: Monitoring Plugins - check_ircd | ||
523 | Requires: %{name} = %{version}-%{release} | ||
524 | |||
525 | %description ircd | ||
526 | Provides check_ircd of the Monitoring Plugins. | ||
527 | |||
528 | %files ircd | ||
529 | %{plugindir}/check_ircd | ||
530 | |||
531 | |||
532 | |||
533 | # check_ldap | ||
534 | %package ldap | ||
535 | Summary: Monitoring Plugins - check_ldap | ||
536 | Requires: %{name} = %{version}-%{release} | ||
537 | |||
538 | %description ldap | ||
539 | Provides 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 | ||
549 | Summary: Monitoring Plugins - check_load | ||
550 | Requires: %{name} = %{version}-%{release} | ||
551 | Requires: procps-ng | ||
552 | |||
553 | %description load | ||
554 | Provides check_load of the Monitoring Plugins. | ||
555 | |||
556 | %files load | ||
557 | %{plugindir}/check_load | ||
558 | |||
559 | |||
560 | |||
561 | # check_log | ||
562 | %package log | ||
563 | Summary: Monitoring Plugins - check_log | ||
564 | Requires: %{name} = %{version}-%{release} | ||
565 | |||
566 | %description log | ||
567 | Provides check_log of the Monitoring Plugins. | ||
568 | |||
569 | %files log | ||
570 | %{plugindir}/check_log | ||
571 | |||
572 | |||
573 | |||
574 | # check_mailq | ||
575 | %package mailq | ||
576 | Summary: Monitoring Plugins - check_mailq | ||
577 | Requires: %{name} = %{version}-%{release} | ||
578 | |||
579 | %description mailq | ||
580 | Provides check_mailq of the Monitoring Plugins. | ||
581 | |||
582 | %files mailq | ||
583 | %{plugindir}/check_mailq | ||
584 | |||
585 | |||
586 | |||
587 | # check_mrtg | ||
588 | %package mrtg | ||
589 | Summary: Monitoring Plugins - check_mrtg | ||
590 | Requires: %{name} = %{version}-%{release} | ||
591 | |||
592 | %description mrtg | ||
593 | Provides check_mrtg of the Monitoring Plugins. | ||
594 | |||
595 | %files mrtg | ||
596 | %{plugindir}/check_mrtg | ||
597 | |||
598 | |||
599 | |||
600 | # check_mrtgtraf | ||
601 | %package mrtgtraf | ||
602 | Summary: Monitoring Plugins - check_mrtgtraf | ||
603 | Requires: %{name} = %{version}-%{release} | ||
604 | |||
605 | %description mrtgtraf | ||
606 | Provides 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 | ||
616 | Summary: Monitoring Plugins - check_mysql | ||
617 | Requires: %{name} = %{version}-%{release} | ||
618 | |||
619 | %description mysql | ||
620 | Provides 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 | ||
629 | Summary: Monitoring Plugins - check_mysql_query | ||
630 | Requires: %{name} = %{version}-%{release} | ||
631 | |||
632 | %description mysql_query | ||
633 | Provides 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 | ||
643 | Summary: Monitoring Plugins - check_nagios | ||
644 | Requires: %{name} = %{version}-%{release} | ||
645 | |||
646 | %description nagios | ||
647 | Provides check_nagios of the Monitoring Plugins. | ||
648 | |||
649 | %files nagios | ||
650 | %{plugindir}/check_nagios | ||
651 | |||
652 | |||
653 | |||
654 | # check_nt | ||
655 | %package nt | ||
656 | Summary: Monitoring Plugins - check_nt | ||
657 | Requires: %{name} = %{version}-%{release} | ||
658 | |||
659 | %description nt | ||
660 | Provides check_nt of the Monitoring Plugins. | ||
661 | |||
662 | %files nt | ||
663 | %{plugindir}/check_nt | ||
664 | |||
665 | |||
666 | |||
667 | # check_ntp | ||
668 | %package ntp | ||
669 | Summary: Monitoring Plugins - check_ntp | ||
670 | Requires: %{name} = %{version}-%{release} | ||
671 | |||
672 | %description ntp | ||
673 | Provides 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 | ||
682 | Summary: Monitoring Plugins - check_ntp_peer | ||
683 | Requires: %{name} = %{version}-%{release} | ||
684 | |||
685 | %description ntp_peer | ||
686 | Provides 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 | ||
695 | Summary: Monitoring Plugins - check_ntp_time | ||
696 | Requires: %{name} = %{version}-%{release} | ||
697 | |||
698 | %description ntp_time | ||
699 | Provides 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 | ||
708 | Summary: Monitoring Plugins - check_nwstat | ||
709 | Requires: %{name} = %{version}-%{release} | ||
710 | |||
711 | %description nwstat | ||
712 | Provides check_nwstat of the Monitoring Plugins. | ||
713 | |||
714 | %files nwstat | ||
715 | %{plugindir}/check_nwstat | ||
716 | |||
717 | |||
718 | |||
719 | # check_oracle | ||
720 | %package oracle | ||
721 | Summary: Monitoring Plugins - check_oracle | ||
722 | Requires: %{name} = %{version}-%{release} | ||
723 | |||
724 | %description oracle | ||
725 | Provides check_oracle of the Monitoring Plugins. | ||
726 | |||
727 | %files oracle | ||
728 | %{plugindir}/check_oracle | ||
729 | |||
730 | |||
731 | |||
732 | # check_overcr | ||
733 | %package overcr | ||
734 | Summary: Monitoring Plugins - check_overcr | ||
735 | Requires: %{name} = %{version}-%{release} | ||
736 | |||
737 | %description overcr | ||
738 | Provides check_overcr of the Monitoring Plugins. | ||
739 | |||
740 | %files overcr | ||
741 | %{plugindir}/check_overcr | ||
742 | |||
743 | |||
744 | |||
745 | # check_pgsql | ||
746 | %package pgsql | ||
747 | Summary: Monitoring Plugins - check_pgsql | ||
748 | Requires: %{name} = %{version}-%{release} | ||
749 | |||
750 | %description pgsql | ||
751 | Provides check_pgsql of the Monitoring Plugins. | ||
752 | |||
753 | %files pgsql | ||
754 | %{plugindir}/check_pgsql | ||
755 | |||
756 | |||
757 | |||
758 | # check_ping | ||
759 | %package ping | ||
760 | Summary: Monitoring Plugins - check_ping | ||
761 | Requires: %{name} = %{version}-%{release} | ||
762 | |||
763 | %description ping | ||
764 | Provides check_ping of the Monitoring Plugins. | ||
765 | |||
766 | %files ping | ||
767 | %{plugindir}/check_ping | ||
768 | |||
769 | |||
770 | |||
771 | # check_procs | ||
772 | %package procs | ||
773 | Summary: Monitoring Plugins - check_procs | ||
774 | Requires: %{name} = %{version}-%{release} | ||
775 | |||
776 | %description procs | ||
777 | Provides check_procs of the Monitoring Plugins. | ||
778 | |||
779 | %files procs | ||
780 | %{plugindir}/check_procs | ||
781 | |||
782 | |||
783 | |||
784 | # check_radius | ||
785 | %package radius | ||
786 | Summary: Monitoring Plugins - check_radius | ||
787 | Requires: %{name} = %{version}-%{release} | ||
788 | |||
789 | %description radius | ||
790 | Provides check_radius of the Monitoring Plugins. | ||
791 | |||
792 | %files radius | ||
793 | %{plugindir}/check_radius | ||
794 | |||
795 | |||
796 | |||
797 | # check_real | ||
798 | %package real | ||
799 | Summary: Monitoring Plugins - check_real | ||
800 | Requires: %{name} = %{version}-%{release} | ||
801 | |||
802 | %description real | ||
803 | Provides check_real of the Monitoring Plugins. | ||
804 | |||
805 | %files real | ||
806 | %{plugindir}/check_real | ||
807 | |||
808 | |||
809 | |||
810 | # check_rpc | ||
811 | %package rpc | ||
812 | Summary: Monitoring Plugins - check_rpc | ||
813 | Requires: %{name} = %{version}-%{release} | ||
814 | |||
815 | %description rpc | ||
816 | Provides check_rpc of the Monitoring Plugins. | ||
817 | |||
818 | %files rpc | ||
819 | %{plugindir}/check_rpc | ||
820 | |||
821 | |||
822 | |||
823 | # check_sensors | ||
824 | %package sensors | ||
825 | Summary: Monitoring Plugins - check_sensors | ||
826 | Requires: %{name} = %{version}-%{release} | ||
827 | Requires: lm_sensors | ||
828 | |||
829 | %description sensors | ||
830 | Provides check_sensors of the Monitoring Plugins. | ||
831 | |||
832 | %files sensors | ||
833 | %{plugindir}/check_sensors | ||
834 | |||
835 | |||
836 | |||
837 | # check_smtp | ||
838 | %package smtp | ||
839 | Summary: Monitoring Plugins - check_smtp | ||
840 | Requires: %{name} = %{version}-%{release} | ||
841 | |||
842 | %description smtp | ||
843 | Provides check_smtp of the Monitoring Plugins. | ||
844 | |||
845 | %files smtp | ||
846 | %{plugindir}/check_smtp | ||
847 | |||
848 | |||
849 | |||
850 | # check_snmp | ||
851 | %package snmp | ||
852 | Summary: Monitoring Plugins - check_snmp | ||
853 | Requires: %{name} = %{version}-%{release} | ||
854 | Requires: net-snmp | ||
855 | |||
856 | %description snmp | ||
857 | Provides check_snmp of the Monitoring Plugins. | ||
858 | |||
859 | %files snmp | ||
860 | %{plugindir}/check_snmp | ||
861 | |||
862 | |||
863 | |||
864 | # check_ssh | ||
865 | %package ssh | ||
866 | Summary: Monitoring Plugins - check_ssh | ||
867 | Requires: %{name} = %{version}-%{release} | ||
868 | |||
869 | %description ssh | ||
870 | Provides check_ssh of the Monitoring Plugins. | ||
871 | |||
872 | %files ssh | ||
873 | %{plugindir}/check_ssh | ||
874 | |||
875 | |||
876 | |||
877 | # check_swap | ||
878 | %package swap | ||
879 | Summary: Monitoring Plugins - check_swap | ||
880 | Requires: %{name} = %{version}-%{release} | ||
881 | |||
882 | %description swap | ||
883 | Provides check_swap of the Monitoring Plugins. | ||
884 | |||
885 | %files swap | ||
886 | %{plugindir}/check_swap | ||
887 | |||
888 | |||
889 | |||
890 | # check_tcp | ||
891 | %package tcp | ||
892 | Summary: Monitoring Plugins - check_tcp | ||
893 | Requires: %{name} = %{version}-%{release} | ||
894 | |||
895 | %description tcp | ||
896 | Provides 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 | ||
916 | Summary: Monitoring Plugins - check_time | ||
917 | Requires: %{name} = %{version}-%{release} | ||
918 | |||
919 | %description time | ||
920 | Provides check_time of the Monitoring Plugins. | ||
921 | |||
922 | %files time | ||
923 | %{plugindir}/check_time | ||
924 | |||
925 | |||
926 | |||
927 | # check_ups | ||
928 | %package ups | ||
929 | Summary: Monitoring Plugins - check_ups | ||
930 | Requires: %{name} = %{version}-%{release} | ||
931 | |||
932 | %description ups | ||
933 | Provides check_ups of the Monitoring Plugins. | ||
934 | |||
935 | %files ups | ||
936 | %{plugindir}/check_ups | ||
937 | |||
938 | |||
939 | |||
940 | # check_uptime | ||
941 | %package uptime | ||
942 | Summary: Monitoring Plugins - check_uptime | ||
943 | Requires: %{name} = %{version}-%{release} | ||
944 | |||
945 | %description uptime | ||
946 | Provides check_uptime of the Monitoring Plugins. | ||
947 | |||
948 | %files uptime | ||
949 | %{plugindir}/check_uptime | ||
950 | |||
951 | |||
952 | |||
953 | # check_users | ||
954 | %package users | ||
955 | Summary: Monitoring Plugins - check_users | ||
956 | Requires: %{name} = %{version}-%{release} | ||
957 | |||
958 | %description users | ||
959 | Provides check_users of the Monitoring Plugins. | ||
960 | |||
961 | %files users | ||
962 | %{plugindir}/check_users | ||
963 | |||
964 | |||
965 | |||
966 | # check_wave | ||
967 | %package wave | ||
968 | Summary: Monitoring Plugins - check_wave | ||
969 | Requires: %{name} = %{version}-%{release} | ||
970 | |||
971 | %description wave | ||
972 | Provides 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 00000000..ee9c145d --- /dev/null +++ b/.github/os_detect.sh | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/bin/sh -e | ||
2 | # workaround for really bare-bones Archlinux containers: | ||
3 | if [ -x "$(command -v pacman)" ]; then | ||
4 | pacman --noconfirm -Sy | ||
5 | pacman --noconfirm -S grep gawk sed | ||
6 | fi | ||
7 | |||
8 | os_release_file= | ||
9 | if [ -s "/etc/os-release" ]; then | ||
10 | os_release_file="/etc/os-release" | ||
11 | elif [ -s "/usr/lib/os-release" ]; then | ||
12 | os_release_file="/usr/lib/os-release" | ||
13 | else | ||
14 | echo >&2 "Cannot find an os-release file ..." | ||
15 | return 1 | ||
16 | fi | ||
17 | export distro_id=$(grep '^ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g') | ||
18 | export platform_id=$(grep '^PLATFORM_ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g'| cut -d":" -f2) | ||
diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 00000000..72f7c7eb --- /dev/null +++ b/.github/workflows/spellcheck.yml | |||
@@ -0,0 +1,27 @@ | |||
1 | --- | ||
2 | name: Spellcheck | ||
3 | |||
4 | on: | ||
5 | # Run for pushes on any branch | ||
6 | push: | ||
7 | branches: | ||
8 | - '*' | ||
9 | # Run for any PRs | ||
10 | pull_request: | ||
11 | |||
12 | jobs: | ||
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.yml b/.github/workflows/test.yml index c4975f1d..33220d6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml | |||
@@ -1,65 +1,27 @@ | |||
1 | --- | 1 | --- |
2 | name: Test | 2 | name: Tests |
3 | 3 | ||
4 | on: | 4 | on: |
5 | push: | 5 | push: |
6 | branches: | 6 | branches: |
7 | - '*' | 7 | - '*' |
8 | # Run test for any PRs | ||
9 | pull_request: | 8 | pull_request: |
10 | 9 | ||
11 | jobs: | 10 | jobs: |
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,./gl,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in" | ||
24 | ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse,slac | ||
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:stable' | 18 | - 'debian:stable' |
53 | #... | ||
54 | include: | 19 | include: |
55 | - distro: 'debian:stable' | 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 |
@@ -83,3 +45,35 @@ jobs: | |||
83 | make' | 45 | make' |
84 | docker container prune -f | 46 | docker container prune -f |
85 | docker volume 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": "fedora:rawhide", "build": ".github/mock.sh"} | ||
58 | - {"distro": "rockylinux:8", "build": ".github/mock.sh"} | ||
59 | - {"distro": "almalinux:9", "build": ".github/mock.sh"} | ||
60 | # - {"distro": "oraclelinux:9", "build": ".github/mock.sh"} | ||
61 | steps: | ||
62 | - name: Git clone repository | ||
63 | uses: actions/checkout@v4 | ||
64 | - name: Run the tests on ${{ matrix.distro }} | ||
65 | run: | | ||
66 | docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol | ||
67 | docker run \ | ||
68 | --privileged=true \ | ||
69 | -e NPTEST_ACCEPTDEFAULT=1 \ | ||
70 | -e NPTEST_CACHE="/src/.github/NPTest.cache" \ | ||
71 | -w /src -v ${PWD}:/src \ | ||
72 | --tmpfs /media/ramdisk1 \ | ||
73 | -v /var/run/utmp:/var/run/utmp \ | ||
74 | --mount source=tmp-vol,destination=/src,target=/media/ramdisk2 \ | ||
75 | ${{ matrix.distro }} \ | ||
76 | /bin/sh -c '${{ matrix.build }} && \ | ||
77 | ls -la' | ||
78 | docker container prune -f | ||
79 | docker volume prune -f | ||