summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-format10
-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
-rw-r--r--.gitignore2
-rw-r--r--CODING35
-rw-r--r--Makefile.am2
-rw-r--r--NEWS93
-rwxr-xr-xNP-VERSION-GEN2
-rw-r--r--THANKS.in20
-rw-r--r--configure.ac20
-rw-r--r--doc/RELEASING.md30
-rw-r--r--doc/developer-guidelines.sgml53
-rw-r--r--lib/Makefile.am4
-rw-r--r--lib/extra_opts.c25
-rw-r--r--lib/maxfd.c26
-rw-r--r--lib/maxfd.h9
-rw-r--r--lib/parse_ini.c53
-rw-r--r--lib/tests/test_base64.c10
-rw-r--r--lib/tests/test_cmd.c10
-rw-r--r--lib/tests/test_disk.c38
-rw-r--r--lib/tests/test_ini1.c10
-rw-r--r--lib/tests/test_ini3.c10
-rw-r--r--lib/tests/test_opts2.c2
-rw-r--r--lib/tests/test_tcp.c14
-rw-r--r--lib/tests/test_utils.c97
-rw-r--r--lib/utils_base.c114
-rw-r--r--lib/utils_base.h14
-rw-r--r--lib/utils_cmd.c40
-rw-r--r--lib/utils_cmd.h17
-rw-r--r--lib/utils_disk.c119
-rw-r--r--lib/utils_disk.h18
-rw-r--r--lib/utils_tcp.c20
-rw-r--r--m4/np_mysqlclient.m42
-rw-r--r--plugins-root/Makefile.am6
-rw-r--r--plugins-root/check_dhcp.c740
-rw-r--r--plugins-root/check_icmp.c712
-rw-r--r--plugins-root/t/check_icmp.t61
-rw-r--r--plugins-scripts/check_disk_smb.pl3
-rwxr-xr-xplugins-scripts/check_ircd.pl63
-rwxr-xr-xplugins-scripts/check_mailq.pl1042
-rwxr-xr-xplugins-scripts/check_oracle.sh23
-rw-r--r--plugins/check_apt.c19
-rw-r--r--plugins/check_by_ssh.c27
-rw-r--r--plugins/check_curl.c155
-rw-r--r--plugins/check_dbi.c2
-rw-r--r--plugins/check_dig.c10
-rw-r--r--plugins/check_disk.c226
-rw-r--r--plugins/check_dns.c72
-rw-r--r--plugins/check_fping.c50
-rw-r--r--plugins/check_game.c14
-rw-r--r--plugins/check_http.c30
-rw-r--r--plugins/check_ide_smart.c18
-rw-r--r--plugins/check_ldap.c25
-rw-r--r--plugins/check_load.c26
-rw-r--r--plugins/check_mrtg.c14
-rw-r--r--plugins/check_mrtgtraf.c20
-rw-r--r--plugins/check_mysql.c22
-rw-r--r--plugins/check_mysql_query.c8
-rw-r--r--plugins/check_nt.c60
-rw-r--r--plugins/check_ntp.c29
-rw-r--r--plugins/check_ntp_peer.c67
-rw-r--r--plugins/check_ntp_time.c17
-rw-r--r--plugins/check_nwstat.c203
-rw-r--r--plugins/check_overcr.c36
-rw-r--r--plugins/check_pgsql.c16
-rw-r--r--plugins/check_ping.c30
-rw-r--r--plugins/check_procs.c52
-rw-r--r--plugins/check_radius.c6
-rw-r--r--plugins/check_real.c16
-rw-r--r--plugins/check_smtp.c63
-rw-r--r--plugins/check_snmp.c211
-rw-r--r--plugins/check_ssh.c197
-rw-r--r--plugins/check_swap.c87
-rw-r--r--plugins/check_tcp.c71
-rw-r--r--plugins/check_time.c60
-rw-r--r--plugins/check_ups.c1023
-rw-r--r--plugins/check_users.c25
-rw-r--r--plugins/common.h22
-rw-r--r--plugins/negate.c25
-rw-r--r--plugins/netutils.c32
-rw-r--r--plugins/netutils.h8
-rw-r--r--plugins/popen.c18
-rw-r--r--plugins/popen.h2
-rw-r--r--plugins/runcmd.c13
-rw-r--r--plugins/sslutils.c77
-rw-r--r--plugins/t/check_curl.t4
-rw-r--r--plugins/t/check_disk.t57
-rw-r--r--plugins/t/check_http.t4
-rw-r--r--plugins/t/check_imap.t2
-rw-r--r--plugins/t/check_ssh.t122
-rw-r--r--plugins/t/check_swap.t14
-rw-r--r--plugins/t/check_users.t7
-rwxr-xr-xplugins/tests/check_curl.t16
-rwxr-xr-xplugins/tests/check_http.t12
-rw-r--r--plugins/utils.c180
-rw-r--r--plugins/utils.h31
-rw-r--r--po/ChangeLog11
-rw-r--r--po/LINGUAS2
-rw-r--r--po/Makefile.in.in395
-rw-r--r--po/Makevars29
-rw-r--r--po/POTFILES.in44
-rw-r--r--po/de.po5393
-rw-r--r--po/fr.po5384
-rw-r--r--po/monitoring-plugins.pot4929
-rw-r--r--po/remove-potcdate.sin19
111 files changed, 5359 insertions, 19319 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..c7f0b5e
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,10 @@
1BasedOnStyle: LLVM
2UseTab: ForContinuationAndIndentation
3IndentWidth: 4
4TabWidth: 4
5AllowShortIfStatementsOnASingleLine: false
6BreakBeforeBraces: Attach
7AlignConsecutiveMacros: true
8ColumnLimit: 180
9IndentPPDirectives: AfterHash
10SortIncludes: Never
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
diff --git a/.gitignore b/.gitignore
index 02ca61e..6f903d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -94,7 +94,7 @@ NP-VERSION-FILE
94/gl/limits.h 94/gl/limits.h
95/gl/malloc/dynarray-skeleton.gl.h 95/gl/malloc/dynarray-skeleton.gl.h
96/gl/malloc/dynarray.gl.h 96/gl/malloc/dynarray.gl.h
97/gl/stdckdint. 97/gl/stdckdint.h
98 98
99# /lib/ 99# /lib/
100/lib/.deps 100/lib/.deps
diff --git a/CODING b/CODING
index 74438e7..d0673e7 100644
--- a/CODING
+++ b/CODING
@@ -7,33 +7,20 @@ readability in a wide range of environments.
7 7
81. C Language Programming 81. C Language Programming
9 9
10All code should comply with the requirements of the Free Software 10All code should comply with most of the requirements of the Free Software
11Foundation Coding standards (which are currently available at 11Foundation Coding standards (which are currently available at
12http://www.gnu.org/prep/standards_toc.html). We also follow most of 12https://www.gnu.org/prep/standards/standards.html ).
13the FSF guidelines. Developers may suggest deviations from the FSF 13We also follow most of the FSF guidelines, with the huge and explicit
14exception of the style guidelines.
15Developers may suggest deviations from the FSF
14style recommendations, which will be considered by open discussion on 16style recommendations, which will be considered by open discussion on
15the Monitoring Plugins devel mailing list. Any such deviations will 17the Monitoring Plugins devel mailing list or the Github Pull Request.
16apply to the entire code base to ensure consistency. 18Any such deviations should be
17 19applied to the entire code base to ensure consistency.
18Currently, the exceptions to FSF recommendations are roughly equivalent
19to GNU indent with invoked as 'indent -ts 2 -br'. Specifically, the
20exceptions are as follows:
21
22a) leading white space for a statement should be formatted as tabs,
23with one tab for each code indentation level.
24
25b) in statement continuation lines, format whitespace up to the column
26starting the statement as tabs, format the rest as spaces (this
27results in code that is legible regardless of tab-width setting).
28
29c) with the exception of the above, tabs should generally be avoided
30
31d) when tab width is 2 spaces, line-length should not exceed 80
32characters
33
34e) The opening brace of an if or while block is on the same line as
35the end of the conditional expression (the '-br' option).
36 20
21The style guideline is the following:
22Whatever clang-format does with the configuration file available (.clang-format)
23Apart from that, code should naturally be readable and easy to understand.
37 24
382. Perl Language Programming 252. Perl Language Programming
39 26
diff --git a/Makefile.am b/Makefile.am
index df1bcbb..5959f70 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
1## Process this file with automake to produce Makefile.in 1## Process this file with automake to produce Makefile.in
2 2
3SUBDIRS = gl tap lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@ 3SUBDIRS = gl tap lib plugins plugins-scripts plugins-root @PERLMODS_DIR@
4 4
5EXTRA_DIST = config.rpath \ 5EXTRA_DIST = config.rpath \
6 ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ NEWS \ 6 ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ NEWS \
diff --git a/NEWS b/NEWS
index 9ec3c5e..fd43fd3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,98 @@
1This file documents the major additions and syntax changes between releases. 1This file documents the major additions and syntax changes between releases.
2 2
32.4.0 25th Jul 2024
4 FIXES
5 * check_dbi: Compiler warning for uninitialized variable
6 * check_curl: Initialize pointer before usage
7 * check_ntp: Initialize intermediate results in any case
8 * Fixes for -Wsign-compare
9 * check_tcp: Fixes an error with using the wrong type for a variable
10 * check_mailq: exit on empty strings and exit early
11 * check_users: Change option for sanity checking arguments to avoid segfault
12 * check_users: Update help to properly show that thresholds are ranges
13 * check_users: fix segfault
14 * check_dbi: Fix compiler warning for uninitialized variable
15 * check_curl: Initialize pointer before usage
16 * check_ntp: Initialize intermediate results in any case
17 * Fix logic in is_uint64_t to fix type-limit warning
18 * check_ntp_peer: Fixes for Wmaybe-unitialized and some restructuring
19 * check_dns: Remove unused variable
20 * check_disk: fix ignore-missing in combination with includes
21 * check_procs: ignore our own children
22 * Prevent -lcrypto from showing up in Makefile dependencies
23 * Change irritating NULL assignment
24 * check_http: Remove self assignment of a variable and add some comments
25 * check_snmp: Remove unused variable
26 * check_dhcp: Make implicit conversion explicit to dismiss warning
27 * Ini Parser: Avoid freeing symbols from text section
28 * check_icmp: keep performance data order in case of none-reachable hosts
29 * check_swap: Change another fake boolean to a real one
30 * check_swap: Rename type since *_t is reserved for C standard types
31 * check_ssh: Fix a typo in "remote-protocol parameter
32 * check_ssh: Handle non-alpha software versions
33 * check_ssh: properly parse a delayed version control string
34 * check_disk: Fail on missing arguments for --warning and --critical and fix a test case
35 * check_disk: Use new test function for percentage expressions
36 * check_load: remove unused code
37 * check_curl/check_http: clarified format of POST data
38
39 ENHANCEMENTS
40 * Use C99 booleans
41 * check_mailq: remove trailing whitespaces
42 * check_mailq: unify tabs/spaces
43 * check_oracle: Shellcheck fixes
44 * check_ups: output ups.realpower if supported
45 * check_disk: add -n short option for --ignore-missing
46 * check_procs: Improve help text, mentioning excluded processes
47 * check_procs: Generalise wording, remove mentioning of nrpe
48 * check_curl: add haproxy protocol option
49 * Improve negate plugin helptext
50 * check_disk: increase alert precision
51 * check_ircd: IPv6 support
52 * check_nwstat: adds percentage used space
53 * Add new test function for percentage expressions
54 * check_swap: Possibility to run check_swap without thresholds
55 * check_ups: additional alarm conditions
56 * check_http/check_curl: added a --regex-state option to change the state of a regex check
57
582.3.5 18th Oct 2023
59 FIXES
60 * Include maxfd.h in lib Makefile
61
622.3.4 18th Oct 2023
63 ENHANCEMENTS
64 * check_curl: added --cookie-jar and doing proper cleanup of libcurl
65 * check_curl: Include all IPs from getaddrinfo() in curl DNS cache
66 * check_dhcp: Add dhcp rogue detection
67 * check_disk: add ignore-missing option to return OK for missing fs
68 * check_disk_smb: allow checking 0-sized resource (ex. IPC$)
69 * check_disk: The options to include or exclude specific file systems now allow the usage of regex(7)
70 * check_icmp: Add support to Jitter, MOS and Score
71 * check_mysql: Detect running mysqldump and handle it more gracefully
72 * check_procs: Implement --exclude-process to exclude specific processes
73 * check_smtp: add new longoption --tls
74 * check_smtp: Add option to prefix PROXY header
75 * check_smtp: Add support for SMTP over TLS
76 * check_smtp: Add support for SNI
77 * check_snmp: Implement option to ignore mib file parsing errors
78 * check_users: prefer systemd-logind over utmp
79
80 FIXES
81 * check_disk: Display SI units correctly
82 * check_ircd: use pack_sockaddr_in rather than hand-rolled
83 * check_log/check_oracle/check_sensors: fixed the outputs of the help functionality
84 * check_mysql: Add mysql_close to avoid spamming the server logs
85 * check_smtp: add missing -r option in usage
86 * check_snmp: disable multiplier when unused
87 * check_wave: Use compile time determined path to snmpget
88
89 GENERAL
90 * Sync with the Gnulib code 668c0b8ffa
91 * Set autoconf prerequisite version to 2.64
92 * Remove sha1 and use sha256 in some parts of the plugin structure
93 * A lot of compiler warnings were fixed
94 * Some code was refactored a little bit
95
32.3.3 2nd Feb 2023 962.3.3 2nd Feb 2023
4 ENHANCEMENTS 97 ENHANCEMENTS
5 using PRId64 and PRIu64 instead of %ld directly 98 using PRId64 and PRIu64 instead of %ld directly
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN
index c353b1d..e16f37d 100755
--- a/NP-VERSION-GEN
+++ b/NP-VERSION-GEN
@@ -6,7 +6,7 @@
6SRC_ROOT=`dirname $0` 6SRC_ROOT=`dirname $0`
7 7
8NPVF=NP-VERSION-FILE 8NPVF=NP-VERSION-FILE
9DEF_VER=2.3git 9DEF_VER=2.4git
10 10
11LF=' 11LF='
12' 12'
diff --git a/THANKS.in b/THANKS.in
index b132744..66397ad 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -406,3 +406,23 @@ Wolfgang Nieder
406andrew bezella 406andrew bezella
407Lorenz Gruenwald 407Lorenz Gruenwald
408John Morrissey 408John Morrissey
409Ralph Gottschalkson
410Arkadiusz Miśkiewicz
411Björn Berg
412Franz Schwartau
413Gerardo Malazdrewicz
414Kristian Schuster
415Patrick Cervicek
416Patrick Uiterwijk
417Platon Pronko
418Stefan Taferner
419Stuart Henderson
420Thoralf Rickert-Wendt
421Thorsten Kukuk
422Matthias Döhler
423Emmanuel Riviere
424Eric Knibbe
425Eunice Remoquillo
426Louis Sautier
427Sven Hartge
428Alvar Penning
diff --git a/configure.ac b/configure.ac
index a294b00..8594238 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.64) 2AC_PREREQ(2.64)
3AC_INIT(monitoring-plugins,2.3git) 3AC_INIT(monitoring-plugins,2.4git)
4AC_CONFIG_SRCDIR(NPTest.pm) 4AC_CONFIG_SRCDIR(NPTest.pm)
5AC_CONFIG_FILES([gl/Makefile]) 5AC_CONFIG_FILES([gl/Makefile])
6AC_CONFIG_AUX_DIR(build-aux) 6AC_CONFIG_AUX_DIR(build-aux)
@@ -621,7 +621,6 @@ AC_C_CONST
621AC_STRUCT_TM 621AC_STRUCT_TM
622AC_TYPE_PID_T 622AC_TYPE_PID_T
623AC_TYPE_SIZE_T 623AC_TYPE_SIZE_T
624AC_TYPE_SIGNAL
625 624
626AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[ 625AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
627AC_TRY_LINK([#include <stdarg.h> 626AC_TRY_LINK([#include <stdarg.h>
@@ -645,12 +644,16 @@ AC_TRY_COMPILE([#include <sys/time.h>],
645 [struct timeval *tv; 644 [struct timeval *tv;
646 struct timezone *tz;], 645 struct timezone *tz;],
647 AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure]) 646 AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
648 AC_TRY_COMPILE([#include <sys/time.h>], 647 FOUND_STRUCT_TIMEVAL="yes")
649 [struct timeval *tv; 648
650 struct timezone *tz; 649if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then
651 gettimeofday(tv, tz);], 650 AC_TRY_COMPILE([#include <sys/time.h>],
652 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]), 651 [struct timeval *tv;
653 AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed]))) 652 struct timezone *tz;
653 gettimeofday(tv, tz);],
654 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
655 AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed]))
656fi
654 657
655dnl Checks for library functions. 658dnl Checks for library functions.
656AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor) 659AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
@@ -1921,7 +1924,6 @@ AC_OUTPUT(
1921 perlmods/Makefile 1924 perlmods/Makefile
1922 test.pl 1925 test.pl
1923 pkg/solaris/pkginfo 1926 pkg/solaris/pkginfo
1924 po/Makefile.in
1925) 1927)
1926 1928
1927 1929
diff --git a/doc/RELEASING.md b/doc/RELEASING.md
index 432b1da..e1f3bf7 100644
--- a/doc/RELEASING.md
+++ b/doc/RELEASING.md
@@ -2,7 +2,7 @@ Releasing a New Monitoring Plugins Version
2========================================== 2==========================================
3 3
4Throughout this document, it is assumed that the current Monitoring 4Throughout this document, it is assumed that the current Monitoring
5Plugins version is 2.3.3, and that we're about to publish version 2.4. 5Plugins version is 2.4.0, and that we're about to publish version 2.5.
6It is also assumed that the official repository on GitHub is tracked 6It is also assumed that the official repository on GitHub is tracked
7using the remote name `monitoring-plugins` (rather than `origin`). 7using the remote name `monitoring-plugins` (rather than `origin`).
8 8
@@ -11,14 +11,14 @@ Before you start
11 11
12- Check Github Actions status. 12- Check Github Actions status.
13- Update local Git repository to the current `master` tip. For a 13- Update local Git repository to the current `master` tip. For a
14 maintenance release (e.g., version 2.3.4), update to the current 14 maintenance release (e.g., version 2.4.1), update to the current
15 `maint-2.3` tip, instead. 15 `maint-2.4` tip, instead.
16 16
17Prepare and commit files 17Prepare and commit files
18------------------------ 18------------------------
19 19
20- Update `configure.ac` and `NP-VERSION-GEN` with new version. 20- Update `configure.ac` and `NP-VERSION-GEN` with new version.
21- Update `NEWS` from `git log --reverse v2.3.3..` output, and specify 21- Update `NEWS` from `git log --reverse v2.4.0..` output, and specify
22 the release version/date. 22 the release version/date.
23- Update `AUTHORS` if there are new team members. 23- Update `AUTHORS` if there are new team members.
24- Update `THANKS.in` using `tools/update-thanks`. 24- Update `THANKS.in` using `tools/update-thanks`.
@@ -29,27 +29,27 @@ Prepare and commit files
29Create annotated tag 29Create annotated tag
30-------------------- 30--------------------
31 31
32 git tag -a -m 'Monitoring Plugins 2.4' v2.4 32 git tag -a -m 'Monitoring Plugins 2.5' v2.5
33 33
34Push the code and tag to GitHub 34Push the code and tag to GitHub
35------------------------------- 35-------------------------------
36 36
37 git push monitoring-plugins master 37 git push monitoring-plugins master
38 git push monitoring-plugins v2.4 38 git push monitoring-plugins v2.5
39 39
40Create new maintenance branch 40Create new maintenance branch
41----------------------------- 41-----------------------------
42 42
43_Only necessary when creating a feature release._ 43_Only necessary when creating a feature release._
44 44
45 git checkout -b maint-2.4 v2.4 45 git checkout -b maint-2.5 v2.5
46 git push -u monitoring-plugins maint-2.4 46 git push -u monitoring-plugins maint-2.5
47 47
48Checkout new version 48Checkout new version
49-------------------- 49--------------------
50 50
51 rm -rf /tmp/plugins 51 rm -rf /tmp/plugins
52 git archive --prefix=tmp/plugins/ v2.4 | (cd /; tar -xf -) 52 git archive --prefix=tmp/plugins/ v2.5 | (cd /; tar -xf -)
53 53
54Build the tarball 54Build the tarball
55----------------- 55-----------------
@@ -62,26 +62,26 @@ Build the tarball
62Upload tarball to web site 62Upload tarball to web site
63-------------------------- 63--------------------------
64 64
65 scp monitoring-plugins-2.4.tar.gz \ 65 scp monitoring-plugins-2.5.tar.gz \
66 plugins@orwell.monitoring-plugins.org:web/download/ 66 plugins@orwell.monitoring-plugins.org:web/download/
67 67
68Generate SHA1 checksum file on web site 68Generate SHA1 checksum file on web site
69--------------------------------------- 69---------------------------------------
70 70
71 ssh plugins@orwell.monitoring-plugins.org \ 71 ssh plugins@orwell.monitoring-plugins.org \
72 '(cd web/download; $HOME/bin/create-checksum monitoring-plugins-2.4.tar.gz)' 72 '(cd web/download; $HOME/bin/create-checksum monitoring-plugins-2.5.tar.gz)'
73 73
74Announce new release 74Announce new release
75-------------------- 75--------------------
76 76
77- In the site.git repository: 77- In the site.git repository:
78 78
79 - Create `web/input/news/release-2-4.md`. 79 - Create `web/input/news/release-2.5.md`.
80 - Update the `plugins_release` version in `web/macros.py`. 80 - Update the `plugins_release` version in `web/macros.py`.
81 - Commit and push the result: 81 - Commit and push the result:
82 82
83 git add web/input/news/release-2-4.md 83 git add web/input/news/release-2.5.md
84 git commit web/input/news/release-2-4.md web/macros.py 84 git commit web/input/news/release-2.5.md web/macros.py
85 git push origin master 85 git push origin master
86 86
87- Post an announcement on (at least) the following mailing lists: 87- Post an announcement on (at least) the following mailing lists:
@@ -93,6 +93,6 @@ Announce new release
93 93
94If you want to mention the number of contributors in the announcement: 94If you want to mention the number of contributors in the announcement:
95 95
96 git shortlog -s v2.3.3..v2.4 | wc -l 96 git shortlog -s v2.4.0..v2.5 | wc -l
97 97
98<!-- vim:set filetype=markdown textwidth=72: --> 98<!-- vim:set filetype=markdown textwidth=72: -->
diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml
index 37c963e..0afa733 100644
--- a/doc/developer-guidelines.sgml
+++ b/doc/developer-guidelines.sgml
@@ -14,15 +14,8 @@
14 <pubdate>2013</pubdate> 14 <pubdate>2013</pubdate>
15 <title>Monitoring Plugins Development Guidelines</title> 15 <title>Monitoring Plugins Development Guidelines</title>
16 16
17 <revhistory>
18 <revision>
19 <revnumber>1796</revnumber>
20 <date>2007-09-24 14:51:07 -0400 (Mon, 24 Sep 2007)</date>
21 </revision>
22 </revhistory>
23
24 <copyright> 17 <copyright>
25 <year>2000 - 2013</year> 18 <year>2000 - 2024</year>
26 <holder>Monitoring Plugins Development Team</holder> 19 <holder>Monitoring Plugins Development Team</holder>
27 </copyright> 20 </copyright>
28 21
@@ -34,7 +27,7 @@
34 the plugin developers and encourage the standardization of the 27 the plugin developers and encourage the standardization of the
35 different kind of plugins: C, shell, perl, python, etc.</para> 28 different kind of plugins: C, shell, perl, python, etc.</para>
36 29
37 <para>Monitoring Plugins Development Guidelines Copyright (C) 2000-2013 30 <para>Monitoring Plugins Development Guidelines Copyright (C) 2000-2024
38 (Monitoring Plugins Team)</para> 31 (Monitoring Plugins Team)</para>
39 32
40 <para>Permission is granted to make and distribute verbatim 33 <para>Permission is granted to make and distribute verbatim
@@ -383,13 +376,6 @@
383 <para>It is up to third party programs to convert the Monitoring Plugins 376 <para>It is up to third party programs to convert the Monitoring Plugins
384 performance data into graphs.</para> 377 performance data into graphs.</para>
385 </section> 378 </section>
386
387 <section><title>Translations</title>
388 <para>If possible, use translation tools for all output to respect the user's language
389 settings. See <xref linkend="translationsdevelopers"> for guidelines
390 for the core plugins.
391 </para>
392 </section>
393</section> 379</section>
394 380
395<section id="SysCmdAuxFiles"><title>System Commands and Auxiliary Files</title> 381<section id="SysCmdAuxFiles"><title>System Commands and Auxiliary Files</title>
@@ -727,19 +713,18 @@ setup the tests. Run "make test" to run all the tests.
727</section> 713</section>
728<section id="CodingGuidelines"><title>Coding guidelines</title> 714<section id="CodingGuidelines"><title>Coding guidelines</title>
729 <para>See <ulink url="http://www.gnu.org/prep/standards_toc.html">GNU 715 <para>See <ulink url="http://www.gnu.org/prep/standards_toc.html">GNU
730 Coding standards</ulink> for general guidelines.</para> 716 Coding standards</ulink> for general guidelines.
717 Some parts of the guidelines (namely and explicitly the coding style)
718 are not seen as best practice by us.</para>
731 <section><title>C coding</title> 719 <section><title>C coding</title>
732 720
733 <para>Variables should be declared at the beginning of code blocks and
734 not inline because of portability with older compilers.</para>
735
736 <para>You should use the type "bool" and its values 721 <para>You should use the type "bool" and its values
737 "true" and "false" instead of the "int" type for booleans. 722 "true" and "false" instead of the "int" type for booleans.
738 </para> 723 </para>
739 </section> 724 </section>
740 725
741 <section><title>Crediting sources</title> 726 <section><title>Crediting sources</title>
742 <para>If you have copied a routine from another source, make sure the licence 727 <para>If you have copied a routine from another source, make sure the license
743 from your source allows this. Add a comment referencing the ACKNOWLEDGEMENTS 728 from your source allows this. Add a comment referencing the ACKNOWLEDGEMENTS
744 file, where you can put more detail about the source.</para> 729 file, where you can put more detail about the source.</para>
745 <para>For contributed code, do not add any named credits in the source code 730 <para>For contributed code, do not add any named credits in the source code
@@ -756,32 +741,6 @@ setup the tests. Run "make test" to run all the tests.
756 <para>All commits will be written to a ChangeLog at release time. 741 <para>All commits will be written to a ChangeLog at release time.
757 </para> 742 </para>
758 </section> 743 </section>
759
760 <section id="translationsdevelopers"><title>Translations for developers</title>
761 <para>To make the job easier for translators, please follow these guidelines:</para>
762 <orderedlist>
763 <listitem><para>
764 Before creating new strings, check the po/monitoring-plugins.pot file to
765 see if a similar string
766 already exists
767 </para></listitem>
768 <listitem><para>
769 For help texts, break into individual options so that these can be reused
770 between plugins
771 </para></listitem>
772 <listitem><para>Try to avoid linefeeds unless you are working on a block of text</para></listitem>
773 <listitem><para>Short help is not translated</para></listitem>
774 <listitem><para>Long help has options in English language, but text translated</para></listitem>
775 <listitem><para>"Copyright" kept in English</para></listitem>
776 <listitem><para>Copyright holder names kept in original text</para></listitem>
777 <listitem><para>Debugging output does not need to be translated</para></listitem>
778 </orderedlist>
779 </section>
780
781 <section><title>Translations for translators</title>
782 <para>To create an up to date list of translatable strings, run: tools/gen_locale.sh</para>
783 </section>
784
785</section> 744</section>
786 745
787<section id="SubmittingChanges"><title>Submission of new plugins and patches</title> 746<section id="SubmittingChanges"><title>Submission of new plugins and patches</title>
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 01d73a6..dc3ee89 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -7,8 +7,8 @@ noinst_LIBRARIES = libmonitoringplug.a
7AM_CPPFLAGS = -DNP_STATE_DIR_PREFIX=\"$(localstatedir)\" \ 7AM_CPPFLAGS = -DNP_STATE_DIR_PREFIX=\"$(localstatedir)\" \
8 -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins 8 -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
9 9
10libmonitoringplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c utils_cmd.c 10libmonitoringplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c utils_cmd.c maxfd.c
11EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h parse_ini.h extra_opts.h 11EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h parse_ini.h extra_opts.h maxfd.h
12 12
13if USE_PARSE_INI 13if USE_PARSE_INI
14libmonitoringplug_a_SOURCES += parse_ini.c extra_opts.c 14libmonitoringplug_a_SOURCES += parse_ini.c extra_opts.c
diff --git a/lib/extra_opts.c b/lib/extra_opts.c
index f4d5e66..771621d 100644
--- a/lib/extra_opts.c
+++ b/lib/extra_opts.c
@@ -1,23 +1,23 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* Monitoring Plugins extra_opts library 3* Monitoring Plugins extra_opts library
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 2007 Monitoring Plugins Development Team 6* Copyright (c) 2007 Monitoring Plugins Development Team
7* 7*
8* This program is free software: you can redistribute it and/or modify 8* This program is free software: you can redistribute it and/or modify
9* it under the terms of the GNU General Public License as published by 9* it under the terms of the GNU General Public License as published by
10* the Free Software Foundation, either version 3 of the License, or 10* the Free Software Foundation, either version 3 of the License, or
11* (at your option) any later version. 11* (at your option) any later version.
12* 12*
13* This program is distributed in the hope that it will be useful, 13* This program is distributed in the hope that it will be useful,
14* but WITHOUT ANY WARRANTY; without even the implied warranty of 14* but WITHOUT ANY WARRANTY; without even the implied warranty of
15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16* GNU General Public License for more details. 16* GNU General Public License for more details.
17* 17*
18* You should have received a copy of the GNU General Public License 18* You should have received a copy of the GNU General Public License
19* along with this program. If not, see <http://www.gnu.org/licenses/>. 19* along with this program. If not, see <http://www.gnu.org/licenses/>.
20* 20*
21*****************************************************************************/ 21*****************************************************************************/
22 22
23#include "common.h" 23#include "common.h"
@@ -26,15 +26,14 @@
26#include "extra_opts.h" 26#include "extra_opts.h"
27 27
28/* FIXME: copied from utils.h; we should move a bunch of libs! */ 28/* FIXME: copied from utils.h; we should move a bunch of libs! */
29int 29bool is_option2 (char *str)
30is_option2 (char *str)
31{ 30{
32 if (!str) 31 if (!str)
33 return FALSE; 32 return false;
34 else if (strspn (str, "-") == 1 || strspn (str, "-") == 2) 33 else if (strspn (str, "-") == 1 || strspn (str, "-") == 2)
35 return TRUE; 34 return true;
36 else 35 else
37 return FALSE; 36 return false;
38} 37}
39 38
40/* this is the externally visible function used by plugins */ 39/* this is the externally visible function used by plugins */
@@ -93,14 +92,14 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
93 /* append the list to extra_args */ 92 /* append the list to extra_args */
94 if(extra_args==NULL){ 93 if(extra_args==NULL){
95 extra_args=ea1; 94 extra_args=ea1;
96 while(ea1=ea1->next) ea_num++; 95 while((ea1 = ea1->next)) ea_num++;
97 }else{ 96 }else{
98 ea_tmp=extra_args; 97 ea_tmp=extra_args;
99 while(ea_tmp->next) { 98 while(ea_tmp->next) {
100 ea_tmp=ea_tmp->next; 99 ea_tmp=ea_tmp->next;
101 } 100 }
102 ea_tmp->next=ea1; 101 ea_tmp->next=ea1;
103 while(ea1=ea1->next) ea_num++; 102 while((ea1 = ea1->next)) ea_num++;
104 } 103 }
105 ea1=ea_tmp=NULL; 104 ea1=ea_tmp=NULL;
106 } 105 }
diff --git a/lib/maxfd.c b/lib/maxfd.c
new file mode 100644
index 0000000..529b356
--- /dev/null
+++ b/lib/maxfd.c
@@ -0,0 +1,26 @@
1#include "./maxfd.h"
2#include <errno.h>
3
4long mp_open_max (void) {
5 long maxfd = 0L;
6 /* Try sysconf(_SC_OPEN_MAX) first, as it can be higher than OPEN_MAX.
7 * If that fails and the macro isn't defined, we fall back to an educated
8 * guess. There's no guarantee that our guess is adequate and the program
9 * will die with SIGSEGV if it isn't and the upper boundary is breached. */
10
11#ifdef _SC_OPEN_MAX
12 errno = 0;
13 if ((maxfd = sysconf (_SC_OPEN_MAX)) < 0) {
14 if (errno == 0)
15 maxfd = DEFAULT_MAXFD; /* it's indeterminate */
16 else
17 die (STATE_UNKNOWN, _("sysconf error for _SC_OPEN_MAX\n"));
18 }
19#elif defined(OPEN_MAX)
20 return OPEN_MAX
21#else /* sysconf macro unavailable, so guess (may be wildly inaccurate) */
22 return DEFAULT_MAXFD;
23#endif
24
25 return(maxfd);
26}
diff --git a/lib/maxfd.h b/lib/maxfd.h
new file mode 100644
index 0000000..45218d0
--- /dev/null
+++ b/lib/maxfd.h
@@ -0,0 +1,9 @@
1#ifndef _MAXFD_
2#define _MAXFD_
3
4#define DEFAULT_MAXFD 256 /* fallback value if no max open files value is set */
5#define MAXFD_LIMIT 8192 /* upper limit of open files */
6
7long mp_open_max (void);
8
9#endif // _MAXFD_
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 547af43..09c0dc4 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -1,24 +1,24 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* Monitoring Plugins parse_ini library 3* Monitoring Plugins parse_ini library
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 2007 Monitoring Plugins Development Team 6* Copyright (c) 2007 Monitoring Plugins Development Team
7* 7*
8* This program is free software: you can redistribute it and/or modify 8* This program is free software: you can redistribute it and/or modify
9* it under the terms of the GNU General Public License as published by 9* it under the terms of the GNU General Public License as published by
10* the Free Software Foundation, either version 3 of the License, or 10* the Free Software Foundation, either version 3 of the License, or
11* (at your option) any later version. 11* (at your option) any later version.
12* 12*
13* This program is distributed in the hope that it will be useful, 13* This program is distributed in the hope that it will be useful,
14* but WITHOUT ANY WARRANTY; without even the implied warranty of 14* but WITHOUT ANY WARRANTY; without even the implied warranty of
15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16* GNU General Public License for more details. 16* GNU General Public License for more details.
17* 17*
18* You should have received a copy of the GNU General Public License 18* You should have received a copy of the GNU General Public License
19* along with this program. If not, see <http://www.gnu.org/licenses/>. 19* along with this program. If not, see <http://www.gnu.org/licenses/>.
20* 20*
21* 21*
22*****************************************************************************/ 22*****************************************************************************/
23 23
24#include "common.h" 24#include "common.h"
@@ -36,6 +36,7 @@
36 */ 36 */
37typedef struct { 37typedef struct {
38 char *file; 38 char *file;
39 bool file_string_on_heap;
39 char *stanza; 40 char *stanza;
40} np_ini_info; 41} np_ini_info;
41 42
@@ -95,16 +96,22 @@ parse_locator(const char *locator, const char *def_stanza, np_ini_info *i)
95 i->stanza = malloc(sizeof(char) * (stanza_len + 1)); 96 i->stanza = malloc(sizeof(char) * (stanza_len + 1));
96 strncpy(i->stanza, locator, stanza_len); 97 strncpy(i->stanza, locator, stanza_len);
97 i->stanza[stanza_len] = '\0'; 98 i->stanza[stanza_len] = '\0';
98 } else /* otherwise we use the default stanza */ 99 } else {/* otherwise we use the default stanza */
99 i->stanza = strdup(def_stanza); 100 i->stanza = strdup(def_stanza);
101 }
100 102
101 if (i->stanza == NULL) 103 if (i->stanza == NULL)
102 die(STATE_UNKNOWN, _("malloc() failed!\n")); 104 die(STATE_UNKNOWN, _("malloc() failed!\n"));
103 105
104 /* check whether there's an @file part */ 106 /* check whether there's an @file part */
105 i->file = stanza_len == locator_len 107 if (stanza_len == locator_len) {
106 ? default_file() 108 i->file = default_file();
107 : strdup(&(locator[stanza_len + 1])); 109 i->file_string_on_heap = false;
110 } else {
111 i->file = strdup(&(locator[stanza_len + 1]));
112 i->file_string_on_heap = true;
113 }
114
108 if (i->file == NULL || i->file[0] == '\0') 115 if (i->file == NULL || i->file[0] == '\0')
109 die(STATE_UNKNOWN, 116 die(STATE_UNKNOWN,
110 _("Cannot find config file in any standard location.\n")); 117 _("Cannot find config file in any standard location.\n"));
@@ -131,12 +138,15 @@ np_get_defaults(const char *locator, const char *default_section)
131 if (inifile == NULL) 138 if (inifile == NULL)
132 die(STATE_UNKNOWN, _("Can't read config file: %s\n"), 139 die(STATE_UNKNOWN, _("Can't read config file: %s\n"),
133 strerror(errno)); 140 strerror(errno));
134 if (read_defaults(inifile, i.stanza, &defaults) == FALSE) 141 if (!read_defaults(inifile, i.stanza, &defaults))
135 die(STATE_UNKNOWN, 142 die(STATE_UNKNOWN,
136 _("Invalid section '%s' in config file '%s'\n"), i.stanza, 143 _("Invalid section '%s' in config file '%s'\n"), i.stanza,
137 i.file); 144 i.file);
138 145
139 free(i.file); 146 if (i.file_string_on_heap) {
147 free(i.file);
148 }
149
140 if (inifile != stdin) 150 if (inifile != stdin)
141 fclose(inifile); 151 fclose(inifile);
142 free(i.stanza); 152 free(i.stanza);
@@ -157,7 +167,8 @@ np_get_defaults(const char *locator, const char *default_section)
157static int 167static int
158read_defaults(FILE *f, const char *stanza, np_arg_list **opts) 168read_defaults(FILE *f, const char *stanza, np_arg_list **opts)
159{ 169{
160 int c, status = FALSE; 170 int c = 0;
171 bool status = false;
161 size_t i, stanza_len; 172 size_t i, stanza_len;
162 enum { NOSTANZA, WRONGSTANZA, RIGHTSTANZA } stanzastate = NOSTANZA; 173 enum { NOSTANZA, WRONGSTANZA, RIGHTSTANZA } stanzastate = NOSTANZA;
163 174
@@ -219,7 +230,7 @@ read_defaults(FILE *f, const char *stanza, np_arg_list **opts)
219 die(STATE_UNKNOWN, "%s\n", 230 die(STATE_UNKNOWN, "%s\n",
220 _("Config file error")); 231 _("Config file error"));
221 } 232 }
222 status = TRUE; 233 status = true;
223 break; 234 break;
224 } 235 }
225 break; 236 break;
@@ -357,14 +368,18 @@ add_option(FILE *f, np_arg_list **optlst)
357static char * 368static char *
358default_file(void) 369default_file(void)
359{ 370{
360 char **p, *ini_file; 371 char *ini_file;
361 372
362 if ((ini_file = getenv("MP_CONFIG_FILE")) != NULL || 373 if ((ini_file = getenv("MP_CONFIG_FILE")) != NULL ||
363 (ini_file = default_file_in_path()) != NULL) 374 (ini_file = default_file_in_path()) != NULL) {
364 return ini_file; 375 return ini_file;
365 for (p = default_ini_path_names; *p != NULL; p++) 376 }
366 if (access(*p, F_OK) == 0) 377
378 for (char **p = default_ini_path_names; *p != NULL; p++) {
379 if (access(*p, F_OK) == 0) {
367 return *p; 380 return *p;
381 }
382 }
368 return NULL; 383 return NULL;
369} 384}
370 385
diff --git a/lib/tests/test_base64.c b/lib/tests/test_base64.c
index 5103d10..05dd794 100644
--- a/lib/tests/test_base64.c
+++ b/lib/tests/test_base64.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "common.h" 19#include "common.h"
diff --git a/lib/tests/test_cmd.c b/lib/tests/test_cmd.c
index 4bb60aa..02ae11f 100644
--- a/lib/tests/test_cmd.c
+++ b/lib/tests/test_cmd.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "common.h" 19#include "common.h"
diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c
index 9bd68c7..e283fe2 100644
--- a/lib/tests/test_disk.c
+++ b/lib/tests/test_disk.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "common.h" 19#include "common.h"
@@ -44,19 +44,19 @@ main (int argc, char **argv)
44 44
45 plan_tests(33); 45 plan_tests(33);
46 46
47 ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list"); 47 ok( np_find_name(exclude_filesystem, "/var/log") == false, "/var/log not in list");
48 np_add_name(&exclude_filesystem, "/var/log"); 48 np_add_name(&exclude_filesystem, "/var/log");
49 ok( np_find_name(exclude_filesystem, "/var/log") == TRUE, "is in list now"); 49 ok( np_find_name(exclude_filesystem, "/var/log") == true, "is in list now");
50 ok( np_find_name(exclude_filesystem, "/home") == FALSE, "/home not in list"); 50 ok( np_find_name(exclude_filesystem, "/home") == false, "/home not in list");
51 np_add_name(&exclude_filesystem, "/home"); 51 np_add_name(&exclude_filesystem, "/home");
52 ok( np_find_name(exclude_filesystem, "/home") == TRUE, "is in list now"); 52 ok( np_find_name(exclude_filesystem, "/home") == true, "is in list now");
53 ok( np_find_name(exclude_filesystem, "/var/log") == TRUE, "/var/log still in list"); 53 ok( np_find_name(exclude_filesystem, "/var/log") == true, "/var/log still in list");
54 54
55 ok( np_find_name(exclude_fstype, "iso9660") == FALSE, "iso9660 not in list"); 55 ok( np_find_name(exclude_fstype, "iso9660") == false, "iso9660 not in list");
56 np_add_name(&exclude_fstype, "iso9660"); 56 np_add_name(&exclude_fstype, "iso9660");
57 ok( np_find_name(exclude_fstype, "iso9660") == TRUE, "is in list now"); 57 ok( np_find_name(exclude_fstype, "iso9660") == true, "is in list now");
58 58
59 ok( np_find_name(exclude_filesystem, "iso9660") == FALSE, "Make sure no clashing in variables"); 59 ok( np_find_name(exclude_filesystem, "iso9660") == false, "Make sure no clashing in variables");
60 60
61 /* 61 /*
62 for (temp_name = exclude_filesystem; temp_name; temp_name = temp_name->next) { 62 for (temp_name = exclude_filesystem; temp_name; temp_name = temp_name->next) {
@@ -120,7 +120,7 @@ main (int argc, char **argv)
120 np_add_parameter(&paths, "/home/tonvoon"); 120 np_add_parameter(&paths, "/home/tonvoon");
121 np_add_parameter(&paths, "/dev/c2t0d0s0"); 121 np_add_parameter(&paths, "/dev/c2t0d0s0");
122 122
123 np_set_best_match(paths, dummy_mount_list, FALSE); 123 np_set_best_match(paths, dummy_mount_list, false);
124 for (p = paths; p; p = p->name_next) { 124 for (p = paths; p; p = p->name_next) {
125 struct mount_entry *temp_me; 125 struct mount_entry *temp_me;
126 temp_me = p->best_match; 126 temp_me = p->best_match;
@@ -144,7 +144,7 @@ main (int argc, char **argv)
144 np_add_parameter(&paths, "/home/tonvoon"); 144 np_add_parameter(&paths, "/home/tonvoon");
145 np_add_parameter(&paths, "/home"); 145 np_add_parameter(&paths, "/home");
146 146
147 np_set_best_match(paths, dummy_mount_list, TRUE); 147 np_set_best_match(paths, dummy_mount_list, true);
148 for (p = paths; p; p = p->name_next) { 148 for (p = paths; p; p = p->name_next) {
149 if (! strcmp(p->name, "/home/groups")) { 149 if (! strcmp(p->name, "/home/groups")) {
150 ok( ! p->best_match , "/home/groups correctly not found"); 150 ok( ! p->best_match , "/home/groups correctly not found");
@@ -167,7 +167,7 @@ main (int argc, char **argv)
167 } 167 }
168 ok(found == 0, "first element successfully deleted"); 168 ok(found == 0, "first element successfully deleted");
169 found = 0; 169 found = 0;
170 170
171 p=paths; 171 p=paths;
172 while (p) { 172 while (p) {
173 if (! strcmp(p->name, "/tmp")) 173 if (! strcmp(p->name, "/tmp"))
@@ -203,9 +203,9 @@ main (int argc, char **argv)
203} 203}
204 204
205 205
206void 206void
207np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, int cflags, int expect, char *desc) 207np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, int cflags, int expect, char *desc)
208{ 208{
209 int matches = 0; 209 int matches = 0;
210 regex_t re; 210 regex_t re;
211 struct mount_entry *me; 211 struct mount_entry *me;
@@ -214,7 +214,7 @@ np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, i
214 if(np_regex_match_mount_entry(me,&re)) 214 if(np_regex_match_mount_entry(me,&re))
215 matches++; 215 matches++;
216 } 216 }
217 ok( matches == expect, 217 ok( matches == expect,
218 "%s '%s' matched %i/3 entries. ok: %i/3", 218 "%s '%s' matched %i/3 entries. ok: %i/3",
219 desc, regstr, expect, matches); 219 desc, regstr, expect, matches);
220 220
diff --git a/lib/tests/test_ini1.c b/lib/tests/test_ini1.c
index 77f8854..6843bac 100644
--- a/lib/tests/test_ini1.c
+++ b/lib/tests/test_ini1.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "common.h" 19#include "common.h"
diff --git a/lib/tests/test_ini3.c b/lib/tests/test_ini3.c
index 814b3ec..8a2a041 100644
--- a/lib/tests/test_ini3.c
+++ b/lib/tests/test_ini3.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "parse_ini.h" 19#include "parse_ini.h"
diff --git a/lib/tests/test_opts2.c b/lib/tests/test_opts2.c
index c3d2067..780220e 100644
--- a/lib/tests/test_opts2.c
+++ b/lib/tests/test_opts2.c
@@ -12,7 +12,7 @@
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16*****************************************************************************/ 16*****************************************************************************/
17 17
18#include "common.h" 18#include "common.h"
diff --git a/lib/tests/test_tcp.c b/lib/tests/test_tcp.c
index 114252b..1954b0f 100644
--- a/lib/tests/test_tcp.c
+++ b/lib/tests/test_tcp.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "common.h" 19#include "common.h"
@@ -33,7 +33,7 @@ main(void)
33 server_expect[0] = strdup("AA"); 33 server_expect[0] = strdup("AA");
34 server_expect[1] = strdup("bb"); 34 server_expect[1] = strdup("bb");
35 server_expect[2] = strdup("CC"); 35 server_expect[2] = strdup("CC");
36 36
37 ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, 37 ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS,
38 "Test matching any string at the beginning (first expect string)"); 38 "Test matching any string at the beginning (first expect string)");
39 ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS, 39 ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS,
@@ -52,7 +52,7 @@ main(void)
52 "Test not matching all strings"); 52 "Test not matching all strings");
53 ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY, 53 ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY,
54 "Test not matching any string (testing all)"); 54 "Test not matching any string (testing all)");
55 55
56 56
57 return exit_status(); 57 return exit_status();
58} 58}
diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c
index 7b10494..01afacd 100644
--- a/lib/tests/test_utils.c
+++ b/lib/tests/test_utils.c
@@ -1,19 +1,19 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* This program is free software: you can redistribute it and/or modify 3* This program is free software: you can redistribute it and/or modify
4* it under the terms of the GNU General Public License as published by 4* it under the terms of the GNU General Public License as published by
5* the Free Software Foundation, either version 3 of the License, or 5* the Free Software Foundation, either version 3 of the License, or
6* (at your option) any later version. 6* (at your option) any later version.
7* 7*
8* This program is distributed in the hope that it will be useful, 8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11* GNU General Public License for more details.
12* 12*
13* You should have received a copy of the GNU General Public License 13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>. 14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15* 15*
16* 16*
17*****************************************************************************/ 17*****************************************************************************/
18 18
19#include "common.h" 19#include "common.h"
@@ -62,99 +62,99 @@ main (int argc, char **argv)
62 range = parse_range_string("6"); 62 range = parse_range_string("6");
63 ok( range != NULL, "'6' is valid range"); 63 ok( range != NULL, "'6' is valid range");
64 ok( range->start == 0, "Start correct"); 64 ok( range->start == 0, "Start correct");
65 ok( range->start_infinity == FALSE, "Not using negative infinity"); 65 ok( range->start_infinity == false, "Not using negative infinity");
66 ok( range->end == 6, "End correct"); 66 ok( range->end == 6, "End correct");
67 ok( range->end_infinity == FALSE, "Not using infinity"); 67 ok( range->end_infinity == false, "Not using infinity");
68 free(range); 68 free(range);
69 69
70 range = parse_range_string("1:12%%"); 70 range = parse_range_string("1:12%%");
71 ok( range != NULL, "'1:12%%' is valid - percentages are ignored"); 71 ok( range != NULL, "'1:12%%' is valid - percentages are ignored");
72 ok( range->start == 1, "Start correct"); 72 ok( range->start == 1, "Start correct");
73 ok( range->start_infinity == FALSE, "Not using negative infinity"); 73 ok( range->start_infinity == false, "Not using negative infinity");
74 ok( range->end == 12, "End correct"); 74 ok( range->end == 12, "End correct");
75 ok( range->end_infinity == FALSE, "Not using infinity"); 75 ok( range->end_infinity == false, "Not using infinity");
76 free(range); 76 free(range);
77 77
78 range = parse_range_string("-7:23"); 78 range = parse_range_string("-7:23");
79 ok( range != NULL, "'-7:23' is valid range"); 79 ok( range != NULL, "'-7:23' is valid range");
80 ok( range->start == -7, "Start correct"); 80 ok( range->start == -7, "Start correct");
81 ok( range->start_infinity == FALSE, "Not using negative infinity"); 81 ok( range->start_infinity == false, "Not using negative infinity");
82 ok( range->end == 23, "End correct"); 82 ok( range->end == 23, "End correct");
83 ok( range->end_infinity == FALSE, "Not using infinity"); 83 ok( range->end_infinity == false, "Not using infinity");
84 free(range); 84 free(range);
85 85
86 range = parse_range_string(":5.75"); 86 range = parse_range_string(":5.75");
87 ok( range != NULL, "':5.75' is valid range"); 87 ok( range != NULL, "':5.75' is valid range");
88 ok( range->start == 0, "Start correct"); 88 ok( range->start == 0, "Start correct");
89 ok( range->start_infinity == FALSE, "Not using negative infinity"); 89 ok( range->start_infinity == false, "Not using negative infinity");
90 ok( range->end == 5.75, "End correct"); 90 ok( range->end == 5.75, "End correct");
91 ok( range->end_infinity == FALSE, "Not using infinity"); 91 ok( range->end_infinity == false, "Not using infinity");
92 free(range); 92 free(range);
93 93
94 range = parse_range_string("~:-95.99"); 94 range = parse_range_string("~:-95.99");
95 ok( range != NULL, "~:-95.99' is valid range"); 95 ok( range != NULL, "~:-95.99' is valid range");
96 ok( range->start_infinity == TRUE, "Using negative infinity"); 96 ok( range->start_infinity == true, "Using negative infinity");
97 ok( range->end == -95.99, "End correct (with rounding errors)"); 97 ok( range->end == -95.99, "End correct (with rounding errors)");
98 ok( range->end_infinity == FALSE, "Not using infinity"); 98 ok( range->end_infinity == false, "Not using infinity");
99 free(range); 99 free(range);
100 100
101 range = parse_range_string("12345678901234567890:"); 101 range = parse_range_string("12345678901234567890:");
102 temp = atof("12345678901234567890"); /* Can't just use this because number too large */ 102 temp = atof("12345678901234567890"); /* Can't just use this because number too large */
103 ok( range != NULL, "'12345678901234567890:' is valid range"); 103 ok( range != NULL, "'12345678901234567890:' is valid range");
104 ok( range->start == temp, "Start correct"); 104 ok( range->start == temp, "Start correct");
105 ok( range->start_infinity == FALSE, "Not using negative infinity"); 105 ok( range->start_infinity == false, "Not using negative infinity");
106 ok( range->end_infinity == TRUE, "Using infinity"); 106 ok( range->end_infinity == true, "Using infinity");
107 /* Cannot do a "-1" on temp, as it appears to be same value */ 107 /* Cannot do a "-1" on temp, as it appears to be same value */
108 ok( check_range(temp/1.1, range) == TRUE, "12345678901234567890/1.1 - alert"); 108 ok( check_range(temp/1.1, range) == true, "12345678901234567890/1.1 - alert");
109 ok( check_range(temp, range) == FALSE, "12345678901234567890 - no alert"); 109 ok( check_range(temp, range) == false, "12345678901234567890 - no alert");
110 ok( check_range(temp*2, range) == FALSE, "12345678901234567890*2 - no alert"); 110 ok( check_range(temp*2, range) == false, "12345678901234567890*2 - no alert");
111 free(range); 111 free(range);
112 112
113 range = parse_range_string("~:0"); 113 range = parse_range_string("~:0");
114 ok( range != NULL, "'~:0' is valid range"); 114 ok( range != NULL, "'~:0' is valid range");
115 ok( range->start_infinity == TRUE, "Using negative infinity"); 115 ok( range->start_infinity == true, "Using negative infinity");
116 ok( range->end == 0, "End correct"); 116 ok( range->end == 0, "End correct");
117 ok( range->end_infinity == FALSE, "Not using infinity"); 117 ok( range->end_infinity == false, "Not using infinity");
118 ok( range->alert_on == OUTSIDE, "Will alert on outside of this range"); 118 ok( range->alert_on == OUTSIDE, "Will alert on outside of this range");
119 ok( check_range(0.5, range) == TRUE, "0.5 - alert"); 119 ok( check_range(0.5, range) == true, "0.5 - alert");
120 ok( check_range(-10, range) == FALSE, "-10 - no alert"); 120 ok( check_range(-10, range) == false, "-10 - no alert");
121 ok( check_range(0, range) == FALSE, "0 - no alert"); 121 ok( check_range(0, range) == false, "0 - no alert");
122 free(range); 122 free(range);
123 123
124 range = parse_range_string("@0:657.8210567"); 124 range = parse_range_string("@0:657.8210567");
125 ok( range != 0, "@0:657.8210567' is a valid range"); 125 ok( range != 0, "@0:657.8210567' is a valid range");
126 ok( range->start == 0, "Start correct"); 126 ok( range->start == 0, "Start correct");
127 ok( range->start_infinity == FALSE, "Not using negative infinity"); 127 ok( range->start_infinity == false, "Not using negative infinity");
128 ok( range->end == 657.8210567, "End correct"); 128 ok( range->end == 657.8210567, "End correct");
129 ok( range->end_infinity == FALSE, "Not using infinity"); 129 ok( range->end_infinity == false, "Not using infinity");
130 ok( range->alert_on == INSIDE, "Will alert on inside of this range" ); 130 ok( range->alert_on == INSIDE, "Will alert on inside of this range" );
131 ok( check_range(32.88, range) == TRUE, "32.88 - alert"); 131 ok( check_range(32.88, range) == true, "32.88 - alert");
132 ok( check_range(-2, range) == FALSE, "-2 - no alert"); 132 ok( check_range(-2, range) == false, "-2 - no alert");
133 ok( check_range(657.8210567, range) == TRUE, "657.8210567 - alert"); 133 ok( check_range(657.8210567, range) == true, "657.8210567 - alert");
134 ok( check_range(0, range) == TRUE, "0 - alert"); 134 ok( check_range(0, range) == true, "0 - alert");
135 free(range); 135 free(range);
136 136
137 range = parse_range_string("@1:1"); 137 range = parse_range_string("@1:1");
138 ok( range != NULL, "'@1:1' is a valid range"); 138 ok( range != NULL, "'@1:1' is a valid range");
139 ok( range->start == 1, "Start correct"); 139 ok( range->start == 1, "Start correct");
140 ok( range->start_infinity == FALSE, "Not using negative infinity"); 140 ok( range->start_infinity == false, "Not using negative infinity");
141 ok( range->end == 1, "End correct"); 141 ok( range->end == 1, "End correct");
142 ok( range->end_infinity == FALSE, "Not using infinity"); 142 ok( range->end_infinity == false, "Not using infinity");
143 ok( range->alert_on == INSIDE, "Will alert on inside of this range" ); 143 ok( range->alert_on == INSIDE, "Will alert on inside of this range" );
144 ok( check_range(0.5, range) == FALSE, "0.5 - no alert"); 144 ok( check_range(0.5, range) == false, "0.5 - no alert");
145 ok( check_range(1, range) == TRUE, "1 - alert"); 145 ok( check_range(1, range) == true, "1 - alert");
146 ok( check_range(5.2, range) == FALSE, "5.2 - no alert"); 146 ok( check_range(5.2, range) == false, "5.2 - no alert");
147 free(range); 147 free(range);
148 148
149 range = parse_range_string("1:1"); 149 range = parse_range_string("1:1");
150 ok( range != NULL, "'1:1' is a valid range"); 150 ok( range != NULL, "'1:1' is a valid range");
151 ok( range->start == 1, "Start correct"); 151 ok( range->start == 1, "Start correct");
152 ok( range->start_infinity == FALSE, "Not using negative infinity"); 152 ok( range->start_infinity == false, "Not using negative infinity");
153 ok( range->end == 1, "End correct"); 153 ok( range->end == 1, "End correct");
154 ok( range->end_infinity == FALSE, "Not using infinity"); 154 ok( range->end_infinity == false, "Not using infinity");
155 ok( check_range(0.5, range) == TRUE, "0.5 - alert"); 155 ok( check_range(0.5, range) == true, "0.5 - alert");
156 ok( check_range(1, range) == FALSE, "1 - no alert"); 156 ok( check_range(1, range) == false, "1 - no alert");
157 ok( check_range(5.2, range) == TRUE, "5.2 - alert"); 157 ok( check_range(5.2, range) == true, "5.2 - alert");
158 free(range); 158 free(range);
159 159
160 range = parse_range_string("2:1"); 160 range = parse_range_string("2:1");
@@ -377,13 +377,13 @@ main (int argc, char **argv)
377 377
378/* 378/*
379 temp_fp = fopen("var/statefile", "r"); 379 temp_fp = fopen("var/statefile", "r");
380 if (temp_fp==NULL) 380 if (temp_fp==NULL)
381 printf("Error opening. errno=%d\n", errno); 381 printf("Error opening. errno=%d\n", errno);
382 printf("temp_fp=%s\n", temp_fp); 382 printf("temp_fp=%s\n", temp_fp);
383 ok( _np_state_read_file(temp_fp) == TRUE, "Can read state file" ); 383 ok( _np_state_read_file(temp_fp) == true, "Can read state file" );
384 fclose(temp_fp); 384 fclose(temp_fp);
385*/ 385*/
386 386
387 temp_state_key->_filename="var/statefile"; 387 temp_state_key->_filename="var/statefile";
388 temp_state_data = np_state_read(); 388 temp_state_data = np_state_read();
389 ok( this_monitoring_plugin->state->state_data!=NULL, "Got state data now" ) || diag("Are you running in right directory? Will get coredump next if not"); 389 ok( this_monitoring_plugin->state->state_data!=NULL, "Got state data now" ) || diag("Are you running in right directory? Will get coredump next if not");
@@ -446,20 +446,20 @@ main (int argc, char **argv)
446 /* Check time is set to current_time */ 446 /* Check time is set to current_time */
447 ok(system("cmp var/generated var/statefile > /dev/null")!=0, "Generated file should be different this time"); 447 ok(system("cmp var/generated var/statefile > /dev/null")!=0, "Generated file should be different this time");
448 ok(this_monitoring_plugin->state->state_data->time-current_time<=1, "Has time generated from current time"); 448 ok(this_monitoring_plugin->state->state_data->time-current_time<=1, "Has time generated from current time");
449 449
450 450
451 /* Don't know how to automatically test this. Need to be able to redefine die and catch the error */ 451 /* Don't know how to automatically test this. Need to be able to redefine die and catch the error */
452 /* 452 /*
453 temp_state_key->_filename="/dev/do/not/expect/to/be/able/to/write"; 453 temp_state_key->_filename="/dev/do/not/expect/to/be/able/to/write";
454 np_state_write_string(0, "Bad file"); 454 np_state_write_string(0, "Bad file");
455 */ 455 */
456 456
457 457
458 np_cleanup(); 458 np_cleanup();
459 459
460 ok(this_monitoring_plugin==NULL, "Free'd this_monitoring_plugin"); 460 ok(this_monitoring_plugin==NULL, "Free'd this_monitoring_plugin");
461 461
462 ok(mp_suid() == FALSE, "Test aren't suid"); 462 ok(mp_suid() == false, "Test aren't suid");
463 463
464 /* base states with random case */ 464 /* base states with random case */
465 char *states[] = { 465 char *states[] = {
@@ -508,4 +508,3 @@ main (int argc, char **argv)
508 508
509 return exit_status(); 509 return exit_status();
510} 510}
511
diff --git a/lib/utils_base.c b/lib/utils_base.c
index c458cf6..f8592f4 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -6,21 +6,21 @@
6* Copyright (c) 2006 Monitoring Plugins Development Team 6* Copyright (c) 2006 Monitoring Plugins Development Team
7* 7*
8* Library of useful functions for plugins 8* Library of useful functions for plugins
9* 9*
10* 10*
11* This program is free software: you can redistribute it and/or modify 11* This program is free software: you can redistribute it and/or modify
12* it under the terms of the GNU General Public License as published by 12* it under the terms of the GNU General Public License as published by
13* the Free Software Foundation, either version 3 of the License, or 13* the Free Software Foundation, either version 3 of the License, or
14* (at your option) any later version. 14* (at your option) any later version.
15* 15*
16* This program is distributed in the hope that it will be useful, 16* This program is distributed in the hope that it will be useful,
17* but WITHOUT ANY WARRANTY; without even the implied warranty of 17* but WITHOUT ANY WARRANTY; without even the implied warranty of
18* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19* GNU General Public License for more details. 19* GNU General Public License for more details.
20* 20*
21* You should have received a copy of the GNU General Public License 21* You should have received a copy of the GNU General Public License
22* along with this program. If not, see <http://www.gnu.org/licenses/>. 22* along with this program. If not, see <http://www.gnu.org/licenses/>.
23* 23*
24* 24*
25*****************************************************************************/ 25*****************************************************************************/
26 26
@@ -37,10 +37,10 @@
37 37
38monitoring_plugin *this_monitoring_plugin=NULL; 38monitoring_plugin *this_monitoring_plugin=NULL;
39 39
40unsigned int timeout_state = STATE_CRITICAL; 40int timeout_state = STATE_CRITICAL;
41unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT; 41unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
42 42
43int _np_state_read_file(FILE *); 43bool _np_state_read_file(FILE *);
44 44
45void np_init( char *plugin_name, int argc, char **argv ) { 45void np_init( char *plugin_name, int argc, char **argv ) {
46 if (this_monitoring_plugin==NULL) { 46 if (this_monitoring_plugin==NULL) {
@@ -105,12 +105,12 @@ die (int result, const char *fmt, ...)
105 105
106void set_range_start (range *this, double value) { 106void set_range_start (range *this, double value) {
107 this->start = value; 107 this->start = value;
108 this->start_infinity = FALSE; 108 this->start_infinity = false;
109} 109}
110 110
111void set_range_end (range *this, double value) { 111void set_range_end (range *this, double value) {
112 this->end = value; 112 this->end = value;
113 this->end_infinity = FALSE; 113 this->end_infinity = false;
114} 114}
115 115
116range 116range
@@ -124,9 +124,9 @@ range
124 124
125 /* Set defaults */ 125 /* Set defaults */
126 temp_range->start = 0; 126 temp_range->start = 0;
127 temp_range->start_infinity = FALSE; 127 temp_range->start_infinity = false;
128 temp_range->end = 0; 128 temp_range->end = 0;
129 temp_range->end_infinity = TRUE; 129 temp_range->end_infinity = true;
130 temp_range->alert_on = OUTSIDE; 130 temp_range->alert_on = OUTSIDE;
131 temp_range->text = strdup(str); 131 temp_range->text = strdup(str);
132 132
@@ -138,7 +138,7 @@ range
138 end_str = index(str, ':'); 138 end_str = index(str, ':');
139 if (end_str != NULL) { 139 if (end_str != NULL) {
140 if (str[0] == '~') { 140 if (str[0] == '~') {
141 temp_range->start_infinity = TRUE; 141 temp_range->start_infinity = true;
142 } else { 142 } else {
143 start = strtod(str, NULL); /* Will stop at the ':' */ 143 start = strtod(str, NULL); /* Will stop at the ':' */
144 set_range_start(temp_range, start); 144 set_range_start(temp_range, start);
@@ -152,8 +152,8 @@ range
152 set_range_end(temp_range, end); 152 set_range_end(temp_range, end);
153 } 153 }
154 154
155 if (temp_range->start_infinity == TRUE || 155 if (temp_range->start_infinity == true ||
156 temp_range->end_infinity == TRUE || 156 temp_range->end_infinity == true ||
157 temp_range->start <= temp_range->end) { 157 temp_range->start <= temp_range->end) {
158 return temp_range; 158 return temp_range;
159 } 159 }
@@ -223,31 +223,30 @@ void print_thresholds(const char *threshold_name, thresholds *my_threshold) {
223 printf("\n"); 223 printf("\n");
224} 224}
225 225
226/* Returns TRUE if alert should be raised based on the range */ 226/* Returns true if alert should be raised based on the range */
227int 227bool check_range(double value, range *my_range)
228check_range(double value, range *my_range)
229{ 228{
230 int no = FALSE; 229 bool no = false;
231 int yes = TRUE; 230 bool yes = true;
232 231
233 if (my_range->alert_on == INSIDE) { 232 if (my_range->alert_on == INSIDE) {
234 no = TRUE; 233 no = true;
235 yes = FALSE; 234 yes = false;
236 } 235 }
237 236
238 if (my_range->end_infinity == FALSE && my_range->start_infinity == FALSE) { 237 if (my_range->end_infinity == false && my_range->start_infinity == false) {
239 if ((my_range->start <= value) && (value <= my_range->end)) { 238 if ((my_range->start <= value) && (value <= my_range->end)) {
240 return no; 239 return no;
241 } else { 240 } else {
242 return yes; 241 return yes;
243 } 242 }
244 } else if (my_range->start_infinity == FALSE && my_range->end_infinity == TRUE) { 243 } else if (my_range->start_infinity == false && my_range->end_infinity == true) {
245 if (my_range->start <= value) { 244 if (my_range->start <= value) {
246 return no; 245 return no;
247 } else { 246 } else {
248 return yes; 247 return yes;
249 } 248 }
250 } else if (my_range->start_infinity == TRUE && my_range->end_infinity == FALSE) { 249 } else if (my_range->start_infinity == true && my_range->end_infinity == false) {
251 if (value <= my_range->end) { 250 if (value <= my_range->end) {
252 return no; 251 return no;
253 } else { 252 } else {
@@ -263,12 +262,12 @@ int
263get_status(double value, thresholds *my_thresholds) 262get_status(double value, thresholds *my_thresholds)
264{ 263{
265 if (my_thresholds->critical != NULL) { 264 if (my_thresholds->critical != NULL) {
266 if (check_range(value, my_thresholds->critical) == TRUE) { 265 if (check_range(value, my_thresholds->critical) == true) {
267 return STATE_CRITICAL; 266 return STATE_CRITICAL;
268 } 267 }
269 } 268 }
270 if (my_thresholds->warning != NULL) { 269 if (my_thresholds->warning != NULL) {
271 if (check_range(value, my_thresholds->warning) == TRUE) { 270 if (check_range(value, my_thresholds->warning) == true) {
272 return STATE_WARNING; 271 return STATE_WARNING;
273 } 272 }
274 } 273 }
@@ -332,7 +331,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
332 /* strip leading spaces */ 331 /* strip leading spaces */
333 for (; isspace(varlist[0]); varlist++); 332 for (; isspace(varlist[0]); varlist++);
334 333
335 if (tmp = index(varlist, sep)) { 334 if ((tmp = index(varlist, sep))) {
336 /* Value is delimited by a comma */ 335 /* Value is delimited by a comma */
337 if (tmp-varlist == 0) continue; 336 if (tmp-varlist == 0) continue;
338 value = (char *)calloc(1, tmp-varlist+1); 337 value = (char *)calloc(1, tmp-varlist+1);
@@ -348,7 +347,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
348 break; 347 break;
349 } 348 }
350 } 349 }
351 if (tmp = index(varlist, sep)) { 350 if ((tmp = index(varlist, sep))) {
352 /* More keys, keep going... */ 351 /* More keys, keep going... */
353 varlist = tmp + 1; 352 varlist = tmp + 1;
354 } else { 353 } else {
@@ -402,26 +401,45 @@ int mp_translate_state (char *state_text) {
402 * parse of argv, so that uniqueness in parameters are reflected there. 401 * parse of argv, so that uniqueness in parameters are reflected there.
403 */ 402 */
404char *_np_state_generate_key() { 403char *_np_state_generate_key() {
405 struct sha256_ctx ctx;
406 int i; 404 int i;
407 char **argv = this_monitoring_plugin->argv; 405 char **argv = this_monitoring_plugin->argv;
408 unsigned char result[20];
409 char keyname[41]; 406 char keyname[41];
410 char *p=NULL; 407 char *p=NULL;
411 408
412 sha256_init_ctx(&ctx); 409 unsigned char result[256];
413 410
411#ifdef USE_OPENSSL
412 /*
413 * This code path is chosen if openssl is available (which should be the most common
414 * scenario). Alternatively, the gnulib implementation/
415 *
416 */
417 EVP_MD_CTX *ctx = EVP_MD_CTX_new();
418
419 EVP_DigestInit(ctx, EVP_sha256());
420
421 for(i=0; i<this_monitoring_plugin->argc; i++) {
422 EVP_DigestUpdate(ctx, argv[i], strlen(argv[i]));
423 }
424
425 EVP_DigestFinal(ctx, result, NULL);
426#else
427
428 struct sha256_ctx ctx;
429
414 for(i=0; i<this_monitoring_plugin->argc; i++) { 430 for(i=0; i<this_monitoring_plugin->argc; i++) {
415 sha256_process_bytes(argv[i], strlen(argv[i]), &ctx); 431 sha256_process_bytes(argv[i], strlen(argv[i]), &ctx);
416 } 432 }
417 433
418 sha256_finish_ctx(&ctx, &result); 434 sha256_finish_ctx(&ctx, result);
419 435#endif // FOUNDOPENSSL
436
420 for (i=0; i<20; ++i) { 437 for (i=0; i<20; ++i) {
421 sprintf(&keyname[2*i], "%02x", result[i]); 438 sprintf(&keyname[2*i], "%02x", result[i]);
422 } 439 }
440
423 keyname[40]='\0'; 441 keyname[40]='\0';
424 442
425 p = strdup(keyname); 443 p = strdup(keyname);
426 if(p==NULL) { 444 if(p==NULL) {
427 die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno)); 445 die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
@@ -446,7 +464,7 @@ char* _np_state_calculate_location_prefix(){
446 464
447 /* Do not allow passing MP_STATE_PATH in setuid plugins 465 /* Do not allow passing MP_STATE_PATH in setuid plugins
448 * for security reasons */ 466 * for security reasons */
449 if (mp_suid() == FALSE) { 467 if (!mp_suid()) {
450 env_dir = getenv("MP_STATE_PATH"); 468 env_dir = getenv("MP_STATE_PATH");
451 if(env_dir && env_dir[0] != '\0') 469 if(env_dir && env_dir[0] != '\0')
452 return env_dir; 470 return env_dir;
@@ -522,7 +540,7 @@ void np_enable_state(char *keyname, int expected_data_version) {
522state_data *np_state_read() { 540state_data *np_state_read() {
523 state_data *this_state_data=NULL; 541 state_data *this_state_data=NULL;
524 FILE *statefile; 542 FILE *statefile;
525 int rc = FALSE; 543 bool rc = false;
526 544
527 if(this_monitoring_plugin==NULL) 545 if(this_monitoring_plugin==NULL)
528 die(STATE_UNKNOWN, _("This requires np_init to be called")); 546 die(STATE_UNKNOWN, _("This requires np_init to be called"));
@@ -544,7 +562,7 @@ state_data *np_state_read() {
544 fclose(statefile); 562 fclose(statefile);
545 } 563 }
546 564
547 if(rc==FALSE) { 565 if(!rc) {
548 _cleanup_state_data(); 566 _cleanup_state_data();
549 } 567 }
550 568
@@ -554,8 +572,8 @@ state_data *np_state_read() {
554/* 572/*
555 * Read the state file 573 * Read the state file
556 */ 574 */
557int _np_state_read_file(FILE *f) { 575bool _np_state_read_file(FILE *f) {
558 int status=FALSE; 576 bool status = false;
559 size_t pos; 577 size_t pos;
560 char *line; 578 char *line;
561 int i; 579 int i;
@@ -609,7 +627,7 @@ int _np_state_read_file(FILE *f) {
609 if(this_monitoring_plugin->state->state_data->data==NULL) 627 if(this_monitoring_plugin->state->state_data->data==NULL)
610 die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno)); 628 die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
611 expected=STATE_DATA_END; 629 expected=STATE_DATA_END;
612 status=TRUE; 630 status=true;
613 break; 631 break;
614 case STATE_DATA_END: 632 case STATE_DATA_END:
615 ; 633 ;
@@ -621,10 +639,10 @@ int _np_state_read_file(FILE *f) {
621} 639}
622 640
623/* 641/*
624 * If time=NULL, use current time. Create state file, with state format 642 * If time=NULL, use current time. Create state file, with state format
625 * version, default text. Writes version, time, and data. Avoid locking 643 * version, default text. Writes version, time, and data. Avoid locking
626 * problems - use mv to write and then swap. Possible loss of state data if 644 * problems - use mv to write and then swap. Possible loss of state data if
627 * two things writing to same key at same time. 645 * two things writing to same key at same time.
628 * Will die with UNKNOWN if errors 646 * Will die with UNKNOWN if errors
629 */ 647 */
630void np_state_write_string(time_t data_time, char *data_string) { 648void np_state_write_string(time_t data_time, char *data_string) {
@@ -639,7 +657,7 @@ void np_state_write_string(time_t data_time, char *data_string) {
639 time(&current_time); 657 time(&current_time);
640 else 658 else
641 current_time=data_time; 659 current_time=data_time;
642 660
643 /* If file doesn't currently exist, create directories */ 661 /* If file doesn't currently exist, create directories */
644 if(access(this_monitoring_plugin->state->_filename,F_OK)!=0) { 662 if(access(this_monitoring_plugin->state->_filename,F_OK)!=0) {
645 result = asprintf(&directories, "%s", this_monitoring_plugin->state->_filename); 663 result = asprintf(&directories, "%s", this_monitoring_plugin->state->_filename);
@@ -678,15 +696,15 @@ void np_state_write_string(time_t data_time, char *data_string) {
678 np_free(temp_file); 696 np_free(temp_file);
679 die(STATE_UNKNOWN, _("Unable to open temporary state file")); 697 die(STATE_UNKNOWN, _("Unable to open temporary state file"));
680 } 698 }
681 699
682 fprintf(fp,"# NP State file\n"); 700 fprintf(fp,"# NP State file\n");
683 fprintf(fp,"%d\n",NP_STATE_FORMAT_VERSION); 701 fprintf(fp,"%d\n",NP_STATE_FORMAT_VERSION);
684 fprintf(fp,"%d\n",this_monitoring_plugin->state->data_version); 702 fprintf(fp,"%d\n",this_monitoring_plugin->state->data_version);
685 fprintf(fp,"%lu\n",current_time); 703 fprintf(fp,"%lu\n",current_time);
686 fprintf(fp,"%s\n",data_string); 704 fprintf(fp,"%s\n",data_string);
687 705
688 fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP); 706 fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP);
689 707
690 fflush(fp); 708 fflush(fp);
691 709
692 result=fclose(fp); 710 result=fclose(fp);
diff --git a/lib/utils_base.h b/lib/utils_base.h
index 5906550..9d4dffe 100644
--- a/lib/utils_base.h
+++ b/lib/utils_base.h
@@ -2,9 +2,11 @@
2#define _UTILS_BASE_ 2#define _UTILS_BASE_
3/* Header file for Monitoring Plugins utils_base.c */ 3/* Header file for Monitoring Plugins utils_base.c */
4 4
5#include "sha256.h" 5#ifndef USE_OPENSSL
6# include "sha256.h"
7#endif
6 8
7/* This file holds header information for thresholds - use this in preference to 9/* This file holds header information for thresholds - use this in preference to
8 individual plugin logic */ 10 individual plugin logic */
9 11
10/* This has not been merged with utils.h because of problems with 12/* This has not been merged with utils.h because of problems with
@@ -19,7 +21,7 @@
19 21
20typedef struct range_struct { 22typedef struct range_struct {
21 double start; 23 double start;
22 int start_infinity; /* FALSE (default) or TRUE */ 24 bool start_infinity;
23 double end; 25 double end;
24 int end_infinity; 26 int end_infinity;
25 int alert_on; /* OUTSIDE (default) or INSIDE */ 27 int alert_on; /* OUTSIDE (default) or INSIDE */
@@ -59,11 +61,11 @@ range *parse_range_string (char *);
59int _set_thresholds(thresholds **, char *, char *); 61int _set_thresholds(thresholds **, char *, char *);
60void set_thresholds(thresholds **, char *, char *); 62void set_thresholds(thresholds **, char *, char *);
61void print_thresholds(const char *, thresholds *); 63void print_thresholds(const char *, thresholds *);
62int check_range(double, range *); 64bool check_range(double, range *);
63int get_status(double, thresholds *); 65int get_status(double, thresholds *);
64 66
65/* Handle timeouts */ 67/* Handle timeouts */
66extern unsigned int timeout_state; 68extern int timeout_state;
67extern unsigned int timeout_interval; 69extern unsigned int timeout_interval;
68 70
69/* All possible characters in a threshold range */ 71/* All possible characters in a threshold range */
@@ -77,7 +79,7 @@ void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)))
77#define NP_RANGE_UNPARSEABLE 1 79#define NP_RANGE_UNPARSEABLE 1
78#define NP_WARN_WITHIN_CRIT 2 80#define NP_WARN_WITHIN_CRIT 2
79 81
80/* a simple check to see if we're running as root. 82/* a simple check to see if we're running as root.
81 * returns zero on failure, nonzero on success */ 83 * returns zero on failure, nonzero on success */
82int np_check_if_root(void); 84int np_check_if_root(void);
83 85
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c
index 34fb390..7957ec1 100644
--- a/lib/utils_cmd.c
+++ b/lib/utils_cmd.c
@@ -18,18 +18,18 @@
18* Care has been taken to make sure the functions are async-safe. The one 18* Care has been taken to make sure the functions are async-safe. The one
19* function which isn't is cmd_init() which it doesn't make sense to 19* function which isn't is cmd_init() which it doesn't make sense to
20* call twice anyway, so the api as a whole should be considered async-safe. 20* call twice anyway, so the api as a whole should be considered async-safe.
21* 21*
22* 22*
23* This program is free software: you can redistribute it and/or modify 23* This program is free software: you can redistribute it and/or modify
24* it under the terms of the GNU General Public License as published by 24* it under the terms of the GNU General Public License as published by
25* the Free Software Foundation, either version 3 of the License, or 25* the Free Software Foundation, either version 3 of the License, or
26* (at your option) any later version. 26* (at your option) any later version.
27* 27*
28* This program is distributed in the hope that it will be useful, 28* This program is distributed in the hope that it will be useful,
29* but WITHOUT ANY WARRANTY; without even the implied warranty of 29* but WITHOUT ANY WARRANTY; without even the implied warranty of
30* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31* GNU General Public License for more details. 31* GNU General Public License for more details.
32* 32*
33* You should have received a copy of the GNU General Public License 33* You should have received a copy of the GNU General Public License
34* along with this program. If not, see <http://www.gnu.org/licenses/>. 34* along with this program. If not, see <http://www.gnu.org/licenses/>.
35* 35*
@@ -42,7 +42,20 @@
42#include "common.h" 42#include "common.h"
43#include "utils.h" 43#include "utils.h"
44#include "utils_cmd.h" 44#include "utils_cmd.h"
45/* This variable must be global, since there's no way the caller
46 * can forcibly slay a dead or ungainly running program otherwise.
47 * Multithreading apps and plugins can initialize it (via CMD_INIT)
48 * in an async safe manner PRIOR to calling cmd_run() or cmd_run_array()
49 * for the first time.
50 *
51 * The check for initialized values is atomic and can
52 * occur in any number of threads simultaneously. */
53static pid_t *_cmd_pids = NULL;
54
45#include "utils_base.h" 55#include "utils_base.h"
56
57#include "./maxfd.h"
58
46#include <fcntl.h> 59#include <fcntl.h>
47 60
48#ifdef HAVE_SYS_WAIT_H 61#ifdef HAVE_SYS_WAIT_H
@@ -86,13 +99,7 @@ extern void die (int, const char *, ...)
86void 99void
87cmd_init (void) 100cmd_init (void)
88{ 101{
89#ifndef maxfd 102 long maxfd = mp_open_max();
90 if (!maxfd && (maxfd = sysconf (_SC_OPEN_MAX)) < 0) {
91 /* possibly log or emit a warning here, since there's no
92 * guarantee that our guess at maxfd will be adequate */
93 maxfd = DEFAULT_MAXFD;
94 }
95#endif
96 103
97 /* if maxfd is unnaturally high, we force it to a lower value 104 /* if maxfd is unnaturally high, we force it to a lower value
98 * ( e.g. on SunOS, when ulimit is set to unlimited: 2147483647 this would cause 105 * ( e.g. on SunOS, when ulimit is set to unlimited: 2147483647 this would cause
@@ -148,6 +155,7 @@ _cmd_open (char *const *argv, int *pfd, int *pfderr)
148 /* close all descriptors in _cmd_pids[] 155 /* close all descriptors in _cmd_pids[]
149 * This is executed in a separate address space (pure child), 156 * This is executed in a separate address space (pure child),
150 * so we don't have to worry about async safety */ 157 * so we don't have to worry about async safety */
158 long maxfd = mp_open_max();
151 for (i = 0; i < maxfd; i++) 159 for (i = 0; i < maxfd; i++)
152 if (_cmd_pids[i] > 0) 160 if (_cmd_pids[i] > 0)
153 close (i); 161 close (i);
@@ -174,6 +182,7 @@ _cmd_close (int fd)
174 pid_t pid; 182 pid_t pid;
175 183
176 /* make sure the provided fd was opened */ 184 /* make sure the provided fd was opened */
185 long maxfd = mp_open_max();
177 if (fd < 0 || fd > maxfd || !_cmd_pids || (pid = _cmd_pids[fd]) == 0) 186 if (fd < 0 || fd > maxfd || !_cmd_pids || (pid = _cmd_pids[fd]) == 0)
178 return -1; 187 return -1;
179 188
@@ -265,7 +274,6 @@ _cmd_fetch_output (int fd, output * op, int flags)
265int 274int
266cmd_run (const char *cmdstring, output * out, output * err, int flags) 275cmd_run (const char *cmdstring, output * out, output * err, int flags)
267{ 276{
268 int fd, pfd_out[2], pfd_err[2];
269 int i = 0, argc; 277 int i = 0, argc;
270 size_t cmdlen; 278 size_t cmdlen;
271 char **argv = NULL; 279 char **argv = NULL;
@@ -369,10 +377,10 @@ cmd_file_read ( char *filename, output *out, int flags)
369 if ((fd = open(filename, O_RDONLY)) == -1) { 377 if ((fd = open(filename, O_RDONLY)) == -1) {
370 die( STATE_UNKNOWN, _("Error opening %s: %s"), filename, strerror(errno) ); 378 die( STATE_UNKNOWN, _("Error opening %s: %s"), filename, strerror(errno) );
371 } 379 }
372 380
373 if(out) 381 if(out)
374 out->lines = _cmd_fetch_output (fd, out, flags); 382 out->lines = _cmd_fetch_output (fd, out, flags);
375 383
376 if (close(fd) == -1) 384 if (close(fd) == -1)
377 die( STATE_UNKNOWN, _("Error closing %s: %s"), filename, strerror(errno) ); 385 die( STATE_UNKNOWN, _("Error closing %s: %s"), filename, strerror(errno) );
378 386
@@ -382,12 +390,12 @@ cmd_file_read ( char *filename, output *out, int flags)
382void 390void
383timeout_alarm_handler (int signo) 391timeout_alarm_handler (int signo)
384{ 392{
385 size_t i;
386 if (signo == SIGALRM) { 393 if (signo == SIGALRM) {
387 printf (_("%s - Plugin timed out after %d seconds\n"), 394 printf (_("%s - Plugin timed out after %d seconds\n"),
388 state_text(timeout_state), timeout_interval); 395 state_text(timeout_state), timeout_interval);
389 396
390 if(_cmd_pids) for(i = 0; i < maxfd; i++) { 397 long maxfd = mp_open_max();
398 if(_cmd_pids) for(long int i = 0; i < maxfd; i++) {
391 if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL); 399 if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL);
392 } 400 }
393 401
diff --git a/lib/utils_cmd.h b/lib/utils_cmd.h
index 6f3aeb8..061f5d4 100644
--- a/lib/utils_cmd.h
+++ b/lib/utils_cmd.h
@@ -1,10 +1,10 @@
1#ifndef _UTILS_CMD_ 1#ifndef _UTILS_CMD_
2#define _UTILS_CMD_ 2#define _UTILS_CMD_
3 3
4/* 4/*
5 * Header file for Monitoring Plugins utils_cmd.c 5 * Header file for Monitoring Plugins utils_cmd.c
6 * 6 *
7 * 7 *
8 */ 8 */
9 9
10/** types **/ 10/** types **/
@@ -32,17 +32,8 @@ void cmd_init (void);
32#define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */ 32#define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */
33#define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */ 33#define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */
34 34
35/* This variable must be global, since there's no way the caller
36 * can forcibly slay a dead or ungainly running program otherwise.
37 * Multithreading apps and plugins can initialize it (via CMD_INIT)
38 * in an async safe manner PRIOR to calling cmd_run() or cmd_run_array()
39 * for the first time.
40 *
41 * The check for initialized values is atomic and can
42 * occur in any number of threads simultaneously. */
43static pid_t *_cmd_pids = NULL;
44 35
45RETSIGTYPE timeout_alarm_handler (int); 36void timeout_alarm_handler (int);
46 37
47 38
48#endif /* _UTILS_CMD_ */ 39#endif /* _UTILS_CMD_ */
diff --git a/lib/utils_disk.c b/lib/utils_disk.c
index 582d3ea..483be06 100644
--- a/lib/utils_disk.c
+++ b/lib/utils_disk.c
@@ -1,34 +1,35 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* Library for check_disk 3* Library for check_disk
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 1999-2007 Monitoring Plugins Development Team 6* Copyright (c) 1999-2007 Monitoring Plugins Development Team
7* 7*
8* Description: 8* Description:
9* 9*
10* This file contains utilities for check_disk. These are tested by libtap 10* This file contains utilities for check_disk. These are tested by libtap
11* 11*
12* 12*
13* This program is free software: you can redistribute it and/or modify 13* This program is free software: you can redistribute it and/or modify
14* it under the terms of the GNU General Public License as published by 14* it under the terms of the GNU General Public License as published by
15* the Free Software Foundation, either version 3 of the License, or 15* the Free Software Foundation, either version 3 of the License, or
16* (at your option) any later version. 16* (at your option) any later version.
17* 17*
18* This program is distributed in the hope that it will be useful, 18* This program is distributed in the hope that it will be useful,
19* but WITHOUT ANY WARRANTY; without even the implied warranty of 19* but WITHOUT ANY WARRANTY; without even the implied warranty of
20* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21* GNU General Public License for more details. 21* GNU General Public License for more details.
22* 22*
23* You should have received a copy of the GNU General Public License 23* You should have received a copy of the GNU General Public License
24* along with this program. If not, see <http://www.gnu.org/licenses/>. 24* along with this program. If not, see <http://www.gnu.org/licenses/>.
25* 25*
26* 26*
27*****************************************************************************/ 27*****************************************************************************/
28 28
29#include "common.h" 29#include "common.h"
30#include "utils_disk.h" 30#include "utils_disk.h"
31#include "gl/fsusage.h" 31#include "gl/fsusage.h"
32#include <string.h>
32 33
33void 34void
34np_add_name (struct name_list **list, const char *name) 35np_add_name (struct name_list **list, const char *name)
@@ -40,6 +41,42 @@ np_add_name (struct name_list **list, const char *name)
40 *list = new_entry; 41 *list = new_entry;
41} 42}
42 43
44/* @brief Initialises a new regex at the begin of list via regcomp(3)
45 *
46 * @details if the regex fails to compile the error code of regcomp(3) is returned
47 * and list is not modified, otherwise list is modified to point to the new
48 * element
49 * @param list Pointer to a linked list of regex_list elements
50 * @param regex the string containing the regex which should be inserted into the list
51 * @param clags the cflags parameter for regcomp(3)
52 */
53int
54np_add_regex (struct regex_list **list, const char *regex, int cflags)
55{
56 struct regex_list *new_entry = (struct regex_list *) malloc (sizeof *new_entry);
57
58 if (new_entry == NULL) {
59 die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
60 strerror(errno));
61 }
62
63 int regcomp_result = regcomp(&new_entry->regex, regex, cflags);
64
65 if (!regcomp_result) {
66 // regcomp succeeded
67 new_entry->next = *list;
68 *list = new_entry;
69
70 return 0;
71 } else {
72 // regcomp failed
73 free(new_entry);
74
75 return regcomp_result;
76 }
77
78}
79
43/* Initialises a new parameter at the end of list */ 80/* Initialises a new parameter at the end of list */
44struct parameter_list * 81struct parameter_list *
45np_add_parameter(struct parameter_list **list, const char *name) 82np_add_parameter(struct parameter_list **list, const char *name)
@@ -61,7 +98,7 @@ np_add_parameter(struct parameter_list **list, const char *name)
61 new_path->freeinodes_percent = NULL; 98 new_path->freeinodes_percent = NULL;
62 new_path->group = NULL; 99 new_path->group = NULL;
63 new_path->dfree_pct = -1; 100 new_path->dfree_pct = -1;
64 new_path->dused_pct = -1; 101 new_path->dused_pct = -1;
65 new_path->total = 0; 102 new_path->total = 0;
66 new_path->available = 0; 103 new_path->available = 0;
67 new_path->available_to_root = 0; 104 new_path->available_to_root = 0;
@@ -133,9 +170,7 @@ np_find_parameter(struct parameter_list *list, const char *name)
133 return NULL; 170 return NULL;
134} 171}
135 172
136void 173void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact) {
137np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, int exact)
138{
139 struct parameter_list *d; 174 struct parameter_list *d;
140 for (d = desired; d; d= d->name_next) { 175 for (d = desired; d; d= d->name_next) {
141 if (! d->best_match) { 176 if (! d->best_match) {
@@ -158,9 +193,9 @@ np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list
158 if (! best_match) { 193 if (! best_match) {
159 for (me = mount_list; me; me = me->me_next) { 194 for (me = mount_list; me; me = me->me_next) {
160 size_t len = strlen (me->me_mountdir); 195 size_t len = strlen (me->me_mountdir);
161 if ((exact == FALSE && (best_match_len <= len && len <= name_len && 196 if ((!exact && (best_match_len <= len && len <= name_len &&
162 (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0))) 197 (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0)))
163 || (exact == TRUE && strcmp(me->me_mountdir, d->name)==0)) 198 || (exact && strcmp(me->me_mountdir, d->name)==0))
164 { 199 {
165 if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) >= 0) { 200 if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) >= 0) {
166 best_match = me; 201 best_match = me;
@@ -179,43 +214,57 @@ np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list
179 } 214 }
180} 215}
181 216
182/* Returns TRUE if name is in list */ 217/* Returns true if name is in list */
183int 218bool np_find_name (struct name_list *list, const char *name) {
184np_find_name (struct name_list *list, const char *name)
185{
186 const struct name_list *n; 219 const struct name_list *n;
187 220
188 if (list == NULL || name == NULL) { 221 if (list == NULL || name == NULL) {
189 return FALSE; 222 return false;
190 } 223 }
191 for (n = list; n; n = n->next) { 224 for (n = list; n; n = n->next) {
192 if (!strcmp(name, n->name)) { 225 if (!strcmp(name, n->name)) {
193 return TRUE; 226 return true;
194 } 227 }
195 } 228 }
196 return FALSE; 229 return false;
197} 230}
198 231
199int 232/* Returns true if name is in list */
200np_seen_name(struct name_list *list, const char *name) 233bool np_find_regmatch (struct regex_list *list, const char *name) {
201{ 234 int len;
235 regmatch_t m;
236
237 if (name == NULL) {
238 return false;
239 }
240
241 len = strlen(name);
242
243 for (; list; list = list->next) {
244 /* Emulate a full match as if surrounded with ^( )$
245 by checking whether the match spans the whole name */
246 if (!regexec(&list->regex, name, 1, &m, 0) && m.rm_so == 0 && m.rm_eo == len) {
247 return true;
248 }
249 }
250
251 return false;
252}
253
254bool np_seen_name(struct name_list *list, const char *name) {
202 const struct name_list *s; 255 const struct name_list *s;
203 for (s = list; s; s=s->next) { 256 for (s = list; s; s=s->next) {
204 if (!strcmp(s->name, name)) { 257 if (!strcmp(s->name, name)) {
205 return TRUE; 258 return true;
206 } 259 }
207 } 260 }
208 return FALSE; 261 return false;
209} 262}
210 263
211int 264bool np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) {
212np_regex_match_mount_entry (struct mount_entry* me, regex_t* re)
213{
214 if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 || 265 if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 ||
215 regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) { 266 regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) {
216 return TRUE; 267 return true;
217 } else {
218 return FALSE;
219 } 268 }
269 return false;
220} 270}
221
diff --git a/lib/utils_disk.h b/lib/utils_disk.h
index 3b5a45f..5b2caf2 100644
--- a/lib/utils_disk.h
+++ b/lib/utils_disk.h
@@ -10,6 +10,12 @@ struct name_list
10 struct name_list *next; 10 struct name_list *next;
11}; 11};
12 12
13struct regex_list
14{
15 regex_t regex;
16 struct regex_list *next;
17};
18
13struct parameter_list 19struct parameter_list
14{ 20{
15 char *name; 21 char *name;
@@ -33,12 +39,14 @@ struct parameter_list
33}; 39};
34 40
35void np_add_name (struct name_list **list, const char *name); 41void np_add_name (struct name_list **list, const char *name);
36int np_find_name (struct name_list *list, const char *name); 42bool np_find_name (struct name_list *list, const char *name);
37int np_seen_name (struct name_list *list, const char *name); 43bool np_seen_name (struct name_list *list, const char *name);
44int np_add_regex (struct regex_list **list, const char *regex, int cflags);
45bool np_find_regmatch (struct regex_list *list, const char *name);
38struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name); 46struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name);
39struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name); 47struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name);
40struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev); 48struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev);
41 49
42int search_parameter_list (struct parameter_list *list, const char *name); 50int search_parameter_list (struct parameter_list *list, const char *name);
43void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, int exact); 51void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact);
44int np_regex_match_mount_entry (struct mount_entry* me, regex_t* re); 52bool np_regex_match_mount_entry (struct mount_entry* me, regex_t* re);
diff --git a/lib/utils_tcp.c b/lib/utils_tcp.c
index b37c446..23ee4a9 100644
--- a/lib/utils_tcp.c
+++ b/lib/utils_tcp.c
@@ -1,29 +1,29 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* Library for check_tcp 3* Library for check_tcp
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 1999-2013 Monitoring Plugins Development Team 6* Copyright (c) 1999-2013 Monitoring Plugins Development Team
7* 7*
8* Description: 8* Description:
9* 9*
10* This file contains utilities for check_tcp. These are tested by libtap 10* This file contains utilities for check_tcp. These are tested by libtap
11* 11*
12* 12*
13* This program is free software: you can redistribute it and/or modify 13* This program is free software: you can redistribute it and/or modify
14* it under the terms of the GNU General Public License as published by 14* it under the terms of the GNU General Public License as published by
15* the Free Software Foundation, either version 3 of the License, or 15* the Free Software Foundation, either version 3 of the License, or
16* (at your option) any later version. 16* (at your option) any later version.
17* 17*
18* This program is distributed in the hope that it will be useful, 18* This program is distributed in the hope that it will be useful,
19* but WITHOUT ANY WARRANTY; without even the implied warranty of 19* but WITHOUT ANY WARRANTY; without even the implied warranty of
20* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21* GNU General Public License for more details. 21* GNU General Public License for more details.
22* 22*
23* You should have received a copy of the GNU General Public License 23* You should have received a copy of the GNU General Public License
24* along with this program. If not, see <http://www.gnu.org/licenses/>. 24* along with this program. If not, see <http://www.gnu.org/licenses/>.
25* 25*
26* 26*
27*****************************************************************************/ 27*****************************************************************************/
28 28
29#include "common.h" 29#include "common.h"
diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4
index 9f533ea..9fe38ac 100644
--- a/m4/np_mysqlclient.m4
+++ b/m4/np_mysqlclient.m4
@@ -13,7 +13,7 @@ dnl np_mysql_libs = flags for libs, from mysql_config --libs
13dnl np_mysql_cflags = flags for cflags, from mysql_config --cflags 13dnl np_mysql_cflags = flags for cflags, from mysql_config --cflags
14dnl Also sets in config.h: 14dnl Also sets in config.h:
15dnl HAVE_MYSQLCLIENT 15dnl HAVE_MYSQLCLIENT
16dnl Copile your code with: 16dnl Compile your code with:
17dnl $(CC) $(np_mysql_include) code.c $(np_mysql_libs) 17dnl $(CC) $(np_mysql_include) code.c $(np_mysql_libs)
18 18
19AC_DEFUN([np_mysqlclient], 19AC_DEFUN([np_mysqlclient],
diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am
index 40aa020..a80229e 100644
--- a/plugins-root/Makefile.am
+++ b/plugins-root/Makefile.am
@@ -26,7 +26,7 @@ EXTRA_PROGRAMS = pst3
26 26
27EXTRA_DIST = t pst3.c 27EXTRA_DIST = t pst3.c
28 28
29BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) 29BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a
30NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS) 30NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
31NETLIBS = $(NETOBJS) $(SOCKETLIBS) 31NETLIBS = $(NETOBJS) $(SOCKETLIBS)
32 32
@@ -80,8 +80,8 @@ install-exec-local: $(noinst_PROGRAMS)
80 80
81############################################################################## 81##############################################################################
82# the actual targets 82# the actual targets
83check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS) 83check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS) $(LIB_CRYPTO)
84check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) 84check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) $(LIB_CRYPTO)
85 85
86# -m64 needed at compiler and linker phase 86# -m64 needed at compiler and linker phase
87pst3_CFLAGS = @PST3CFLAGS@ 87pst3_CFLAGS = @PST3CFLAGS@
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
index 2d22619..4b8f5e2 100644
--- a/plugins-root/check_dhcp.c
+++ b/plugins-root/check_dhcp.c
@@ -1,40 +1,40 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2 *
3* Monitoring check_dhcp plugin 3 * Monitoring check_dhcp plugin
4* 4 *
5* License: GPL 5 * License: GPL
6* Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org) 6 * Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)
7* Copyright (c) 2001-2007 Monitoring Plugins Development Team 7 * Copyright (c) 2001-2007 Monitoring Plugins Development Team
8* 8 *
9* Description: 9 * Description:
10* 10 *
11* This file contains the check_dhcp plugin 11 * This file contains the check_dhcp plugin
12* 12 *
13* This plugin tests the availability of DHCP servers on a network. 13 * This plugin tests the availability of DHCP servers on a network.
14* 14 *
15* Unicast mode was originally implemented by Heiti of Boras Kommun with 15 * Unicast mode was originally implemented by Heiti of Boras Kommun with
16* general improvements as well as usability fixes and "forward"-porting by 16 * general improvements as well as usability fixes and "forward"-porting by
17* Andreas Ericsson of OP5 AB. 17 * Andreas Ericsson of OP5 AB.
18* 18 *
19* 19 *
20* This program is free software: you can redistribute it and/or modify 20 * This program is free software: you can redistribute it and/or modify
21* it under the terms of the GNU General Public License as published by 21 * it under the terms of the GNU General Public License as published by
22* the Free Software Foundation, either version 3 of the License, or 22 * the Free Software Foundation, either version 3 of the License, or
23* (at your option) any later version. 23 * (at your option) any later version.
24* 24 *
25* This program is distributed in the hope that it will be useful, 25 * This program is distributed in the hope that it will be useful,
26* but WITHOUT ANY WARRANTY; without even the implied warranty of 26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28* GNU General Public License for more details. 28 * GNU General Public License for more details.
29* 29 *
30* You should have received a copy of the GNU General Public License 30 * You should have received a copy of the GNU General Public License
31* along with this program. If not, see <http://www.gnu.org/licenses/>. 31 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32* 32 *
33* 33 *
34*****************************************************************************/ 34 *****************************************************************************/
35 35
36const char *progname = "check_dhcp"; 36const char *progname = "check_dhcp";
37const char *copyright = "2001-2007"; 37const char *copyright = "2001-2023";
38const char *email = "devel@monitoring-plugins.org"; 38const char *email = "devel@monitoring-plugins.org";
39 39
40#include "common.h" 40#include "common.h"
@@ -57,9 +57,10 @@ const char *email = "devel@monitoring-plugins.org";
57#include <netinet/in.h> 57#include <netinet/in.h>
58#include <net/if.h> 58#include <net/if.h>
59#include <arpa/inet.h> 59#include <arpa/inet.h>
60
60#if HAVE_SYS_SOCKIO_H 61#if HAVE_SYS_SOCKIO_H
61#include <sys/sockio.h> 62#include <sys/sockio.h>
62#endif 63#endif // HAVE_SYS_SOCKIO_H
63 64
64#if defined( __linux__ ) 65#if defined( __linux__ )
65 66
@@ -98,10 +99,6 @@ static struct strbuf dat = {AREA_SZ, 0, (char *)dat_area};
98#define GOT_INTR 4 99#define GOT_INTR 4
99#define GOT_ERR 128 100#define GOT_ERR 128
100 101
101#define u_int8_t uint8_t
102#define u_int16_t uint16_t
103#define u_int32_t uint32_t
104
105static int get_msg(int); 102static int get_msg(int);
106static int check_ctrl(int); 103static int check_ctrl(int);
107static int put_ctrl(int, int, int); 104static int put_ctrl(int, int, int);
@@ -110,7 +107,7 @@ static int dl_open(const char *, int, int *);
110static int dl_bind(int, int, u_char *); 107static int dl_bind(int, int, u_char *);
111long mac_addr_dlpi( const char *, int, u_char *); 108long mac_addr_dlpi( const char *, int, u_char *);
112 109
113#endif 110#endif // __sun__ || __solaris__ || __hpux
114 111
115 112
116 113
@@ -119,9 +116,6 @@ long mac_addr_dlpi( const char *, int, u_char *);
119#define OK 0 116#define OK 0
120#define ERROR -1 117#define ERROR -1
121 118
122#define FALSE 0
123#define TRUE 1
124
125 119
126/**** DHCP definitions ****/ 120/**** DHCP definitions ****/
127 121
@@ -132,39 +126,40 @@ long mac_addr_dlpi( const char *, int, u_char *);
132 126
133 127
134typedef struct dhcp_packet_struct{ 128typedef struct dhcp_packet_struct{
135 u_int8_t op; /* packet type */ 129 uint8_t op; /* packet type */
136 u_int8_t htype; /* type of hardware address for this machine (Ethernet, etc) */ 130 uint8_t htype; /* type of hardware address for this machine (Ethernet, etc) */
137 u_int8_t hlen; /* length of hardware address (of this machine) */ 131 uint8_t hlen; /* length of hardware address (of this machine) */
138 u_int8_t hops; /* hops */ 132 uint8_t hops; /* hops */
139 u_int32_t xid; /* random transaction id number - chosen by this machine */ 133 uint32_t xid; /* random transaction id number - chosen by this machine */
140 u_int16_t secs; /* seconds used in timing */ 134 uint16_t secs; /* seconds used in timing */
141 u_int16_t flags; /* flags */ 135 uint16_t flags; /* flags */
142 struct in_addr ciaddr; /* IP address of this machine (if we already have one) */ 136 struct in_addr ciaddr; /* IP address of this machine (if we already have one) */
143 struct in_addr yiaddr; /* IP address of this machine (offered by the DHCP server) */ 137 struct in_addr yiaddr; /* IP address of this machine (offered by the DHCP server) */
144 struct in_addr siaddr; /* IP address of next server */ 138 struct in_addr siaddr; /* IP address of next server */
145 struct in_addr giaddr; /* IP address of DHCP relay */ 139 struct in_addr giaddr; /* IP address of DHCP relay */
146 unsigned char chaddr [MAX_DHCP_CHADDR_LENGTH]; /* hardware address of this machine */ 140 unsigned char chaddr [MAX_DHCP_CHADDR_LENGTH]; /* hardware address of this machine */
147 char sname [MAX_DHCP_SNAME_LENGTH]; /* name of DHCP server */ 141 char sname [MAX_DHCP_SNAME_LENGTH]; /* name of DHCP server */
148 char file [MAX_DHCP_FILE_LENGTH]; /* boot file name (used for diskless booting?) */ 142 char file [MAX_DHCP_FILE_LENGTH]; /* boot file name (used for diskless booting?) */
149 char options[MAX_DHCP_OPTIONS_LENGTH]; /* options */ 143 char options[MAX_DHCP_OPTIONS_LENGTH]; /* options */
150 }dhcp_packet; 144}dhcp_packet;
151 145
152 146
153typedef struct dhcp_offer_struct{ 147typedef struct dhcp_offer_struct{
154 struct in_addr server_address; /* address of DHCP server that sent this offer */ 148 struct in_addr server_address; /* address of DHCP server that sent this offer */
155 struct in_addr offered_address; /* the IP address that was offered to us */ 149 struct in_addr offered_address; /* the IP address that was offered to us */
156 u_int32_t lease_time; /* lease time in seconds */ 150 uint32_t lease_time; /* lease time in seconds */
157 u_int32_t renewal_time; /* renewal time in seconds */ 151 uint32_t renewal_time; /* renewal time in seconds */
158 u_int32_t rebinding_time; /* rebinding time in seconds */ 152 uint32_t rebinding_time; /* rebinding time in seconds */
153 bool desired; /* is this offer desired (necessary in exclusive mode) */
159 struct dhcp_offer_struct *next; 154 struct dhcp_offer_struct *next;
160 }dhcp_offer; 155}dhcp_offer;
161 156
162 157
163typedef struct requested_server_struct{ 158typedef struct requested_server_struct{
164 struct in_addr server_address; 159 struct in_addr server_address;
165 int answered; 160 bool answered;
166 struct requested_server_struct *next; 161 struct requested_server_struct *next;
167 }requested_server; 162}requested_server;
168 163
169 164
170#define BOOTREQUEST 1 165#define BOOTREQUEST 1
@@ -198,7 +193,8 @@ typedef struct requested_server_struct{
198#define ETHERNET_HARDWARE_ADDRESS 1 /* used in htype field of dhcp packet */ 193#define ETHERNET_HARDWARE_ADDRESS 1 /* used in htype field of dhcp packet */
199#define ETHERNET_HARDWARE_ADDRESS_LENGTH 6 /* length of Ethernet hardware addresses */ 194#define ETHERNET_HARDWARE_ADDRESS_LENGTH 6 /* length of Ethernet hardware addresses */
200 195
201u_int8_t unicast = 0; /* unicast mode: mimic a DHCP relay */ 196bool unicast = false; /* unicast mode: mimic a DHCP relay */
197bool exclusive = false; /* exclusive mode aka "rogue DHCP server detection" */
202struct in_addr my_ip; /* our address (required for relay) */ 198struct in_addr my_ip; /* our address (required for relay) */
203struct in_addr dhcp_ip; /* server to query (if in unicast mode) */ 199struct in_addr dhcp_ip; /* server to query (if in unicast mode) */
204unsigned char client_hardware_address[MAX_DHCP_CHADDR_LENGTH]=""; 200unsigned char client_hardware_address[MAX_DHCP_CHADDR_LENGTH]="";
@@ -206,11 +202,11 @@ unsigned char *user_specified_mac=NULL;
206 202
207char network_interface_name[IFNAMSIZ]="eth0"; 203char network_interface_name[IFNAMSIZ]="eth0";
208 204
209u_int32_t packet_xid=0; 205uint32_t packet_xid=0;
210 206
211u_int32_t dhcp_lease_time=0; 207uint32_t dhcp_lease_time=0;
212u_int32_t dhcp_renewal_time=0; 208uint32_t dhcp_renewal_time=0;
213u_int32_t dhcp_rebinding_time=0; 209uint32_t dhcp_rebinding_time=0;
214 210
215int dhcpoffer_timeout=2; 211int dhcpoffer_timeout=2;
216 212
@@ -221,8 +217,8 @@ int valid_responses=0; /* number of valid DHCPOFFERs we received */
221int requested_servers=0; 217int requested_servers=0;
222int requested_responses=0; 218int requested_responses=0;
223 219
224int request_specific_address=FALSE; 220bool request_specific_address=false;
225int received_requested_address=FALSE; 221bool received_requested_address=false;
226int verbose=0; 222int verbose=0;
227struct in_addr requested_address; 223struct in_addr requested_address;
228 224
@@ -268,7 +264,7 @@ int main(int argc, char **argv){
268 264
269 if(process_arguments(argc,argv)!=OK){ 265 if(process_arguments(argc,argv)!=OK){
270 usage4 (_("Could not parse arguments")); 266 usage4 (_("Could not parse arguments"));
271 } 267 }
272 268
273 /* create socket for DHCP communications */ 269 /* create socket for DHCP communications */
274 dhcp_socket=create_dhcp_socket(); 270 dhcp_socket=create_dhcp_socket();
@@ -299,7 +295,7 @@ int main(int argc, char **argv){
299 free_requested_server_list(); 295 free_requested_server_list();
300 296
301 return result; 297 return result;
302 } 298}
303 299
304 300
305 301
@@ -314,83 +310,83 @@ int get_hardware_address(int sock,char *interface_name){
314 310
315 /* try and grab hardware address of requested interface */ 311 /* try and grab hardware address of requested interface */
316 if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0){ 312 if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0){
317 printf(_("Error: Could not get hardware address of interface '%s'\n"),interface_name); 313 printf(_("Error: Could not get hardware address of interface '%s'\n"),interface_name);
318 exit(STATE_UNKNOWN); 314 exit(STATE_UNKNOWN);
319 } 315 }
320 316
321 memcpy(&client_hardware_address[0],&ifr.ifr_hwaddr.sa_data,6); 317 memcpy(&client_hardware_address[0],&ifr.ifr_hwaddr.sa_data,6);
322 318
323#elif defined(__bsd__) 319#elif defined(__bsd__)
324 /* King 2004 see ACKNOWLEDGEMENTS */ 320 /* King 2004 see ACKNOWLEDGEMENTS */
325 321
326 size_t len; 322 size_t len;
327 int mib[6]; 323 int mib[6];
328 char *buf; 324 char *buf;
329 unsigned char *ptr; 325 unsigned char *ptr;
330 struct if_msghdr *ifm; 326 struct if_msghdr *ifm;
331 struct sockaddr_dl *sdl; 327 struct sockaddr_dl *sdl;
332 328
333 mib[0] = CTL_NET; 329 mib[0] = CTL_NET;
334 mib[1] = AF_ROUTE; 330 mib[1] = AF_ROUTE;
335 mib[2] = 0; 331 mib[2] = 0;
336 mib[3] = AF_LINK; 332 mib[3] = AF_LINK;
337 mib[4] = NET_RT_IFLIST; 333 mib[4] = NET_RT_IFLIST;
338 334
339 if((mib[5] = if_nametoindex(interface_name)) == 0){ 335 if((mib[5] = if_nametoindex(interface_name)) == 0){
340 printf(_("Error: if_nametoindex error - %s.\n"), strerror(errno)); 336 printf(_("Error: if_nametoindex error - %s.\n"), strerror(errno));
341 exit(STATE_UNKNOWN); 337 exit(STATE_UNKNOWN);
342 } 338 }
343 339
344 if(sysctl(mib, 6, NULL, &len, NULL, 0) < 0){ 340 if(sysctl(mib, 6, NULL, &len, NULL, 0) < 0){
345 printf(_("Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"), interface_name, strerror(errno)); 341 printf(_("Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"), interface_name, strerror(errno));
346 exit(STATE_UNKNOWN); 342 exit(STATE_UNKNOWN);
347 } 343 }
348 344
349 if((buf = malloc(len)) == NULL){ 345 if((buf = malloc(len)) == NULL){
350 printf(_("Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"), interface_name, strerror(errno)); 346 printf(_("Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"), interface_name, strerror(errno));
351 exit(4); 347 exit(4);
352 } 348 }
353 349
354 if(sysctl(mib, 6, buf, &len, NULL, 0) < 0){ 350 if(sysctl(mib, 6, buf, &len, NULL, 0) < 0){
355 printf(_("Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"), interface_name, strerror(errno)); 351 printf(_("Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"), interface_name, strerror(errno));
356 exit(STATE_UNKNOWN); 352 exit(STATE_UNKNOWN);
357 } 353 }
358 354
359 ifm = (struct if_msghdr *)buf; 355 ifm = (struct if_msghdr *)buf;
360 sdl = (struct sockaddr_dl *)(ifm + 1); 356 sdl = (struct sockaddr_dl *)(ifm + 1);
361 ptr = (unsigned char *)LLADDR(sdl); 357 ptr = (unsigned char *)LLADDR(sdl);
362 memcpy(&client_hardware_address[0], ptr, 6) ; 358 memcpy(&client_hardware_address[0], ptr, 6) ;
363 /* King 2004 */ 359 /* King 2004 */
364 360
365#elif defined(__sun__) || defined(__solaris__) 361#elif defined(__sun__) || defined(__solaris__)
366 362
367 /* Kompf 2000-2003 see ACKNOWLEDGEMENTS */ 363 /* Kompf 2000-2003 see ACKNOWLEDGEMENTS */
368 long stat; 364 long stat;
369 char dev[20] = "/dev/"; 365 char dev[20] = "/dev/";
370 char *p; 366 char *p;
371 int unit; 367 int unit;
372 368
373 /* get last number from interfacename, eg lnc0, e1000g0*/ 369 /* get last number from interfacename, eg lnc0, e1000g0*/
374 int i; 370 int i;
375 p = interface_name + strlen(interface_name) -1; 371 p = interface_name + strlen(interface_name) -1;
376 for(i = strlen(interface_name) -1; i > 0; p--) { 372 for(i = strlen(interface_name) -1; i > 0; p--) {
377 if(isalpha(*p)) 373 if(isalpha(*p))
378 break; 374 break;
379 } 375 }
380 p++; 376 p++;
381 if( p != interface_name ){ 377 if( p != interface_name ){
382 unit = atoi(p) ; 378 unit = atoi(p) ;
383 strncat(dev, interface_name, 6) ; 379 strncat(dev, interface_name, 6) ;
384 } 380 }
385 else{ 381 else{
386 printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name); 382 printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name);
387 exit(STATE_UNKNOWN); 383 exit(STATE_UNKNOWN);
388 } 384 }
389 stat = mac_addr_dlpi(dev, unit, client_hardware_address); 385 stat = mac_addr_dlpi(dev, unit, client_hardware_address);
390 if(stat != 0){ 386 if(stat != 0){
391 printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit); 387 printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit);
392 exit(STATE_UNKNOWN); 388 exit(STATE_UNKNOWN);
393 } 389 }
394 390
395#elif defined(__hpux__) 391#elif defined(__hpux__)
396 392
@@ -402,8 +398,8 @@ int get_hardware_address(int sock,char *interface_name){
402 if(stat != 0){ 398 if(stat != 0){
403 printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit); 399 printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit);
404 exit(STATE_UNKNOWN); 400 exit(STATE_UNKNOWN);
405 } 401 }
406 /* Kompf 2000-2003 */ 402 /* Kompf 2000-2003 */
407 403
408#else 404#else
409 printf(_("Error: can't get MAC address for this architecture. Use the --mac option.\n")); 405 printf(_("Error: can't get MAC address for this architecture. Use the --mac option.\n"));
@@ -414,7 +410,7 @@ int get_hardware_address(int sock,char *interface_name){
414 print_hardware_address(client_hardware_address); 410 print_hardware_address(client_hardware_address);
415 411
416 return OK; 412 return OK;
417 } 413}
418 414
419/* determines IP address of the client interface */ 415/* determines IP address of the client interface */
420int get_ip_address(int sock,char *interface_name){ 416int get_ip_address(int sock,char *interface_name){
@@ -426,9 +422,9 @@ int get_ip_address(int sock,char *interface_name){
426 422
427 if(ioctl(sock,SIOCGIFADDR,&ifr)<0){ 423 if(ioctl(sock,SIOCGIFADDR,&ifr)<0){
428 printf(_("Error: Cannot determine IP address of interface %s\n"), 424 printf(_("Error: Cannot determine IP address of interface %s\n"),
429 interface_name); 425 interface_name);
430 exit(STATE_UNKNOWN); 426 exit(STATE_UNKNOWN);
431 } 427 }
432 428
433 my_ip=((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr; 429 my_ip=((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr;
434 430
@@ -441,13 +437,13 @@ int get_ip_address(int sock,char *interface_name){
441 printf(_("Pretending to be relay client %s\n"),inet_ntoa(my_ip)); 437 printf(_("Pretending to be relay client %s\n"),inet_ntoa(my_ip));
442 438
443 return OK; 439 return OK;
444 } 440}
445 441
446/* sends a DHCPDISCOVER broadcast message in an attempt to find DHCP servers */ 442/* sends a DHCPDISCOVER broadcast message in an attempt to find DHCP servers */
447int send_dhcp_discover(int sock){ 443int send_dhcp_discover(int sock){
448 dhcp_packet discover_packet; 444 dhcp_packet discover_packet;
449 struct sockaddr_in sockaddr_broadcast; 445 struct sockaddr_in sockaddr_broadcast;
450 unsigned short opts; 446 unsigned short opts;
451 447
452 448
453 /* clear the packet data structure */ 449 /* clear the packet data structure */
@@ -488,20 +484,20 @@ int send_dhcp_discover(int sock){
488 discover_packet.options[2]='\x53'; 484 discover_packet.options[2]='\x53';
489 discover_packet.options[3]='\x63'; 485 discover_packet.options[3]='\x63';
490 486
491 opts = 4; 487 opts = 4;
492 /* DHCP message type is embedded in options field */ 488 /* DHCP message type is embedded in options field */
493 discover_packet.options[opts++]=DHCP_OPTION_MESSAGE_TYPE; /* DHCP message type option identifier */ 489 discover_packet.options[opts++]=DHCP_OPTION_MESSAGE_TYPE; /* DHCP message type option identifier */
494 discover_packet.options[opts++]='\x01'; /* DHCP message option length in bytes */ 490 discover_packet.options[opts++]='\x01'; /* DHCP message option length in bytes */
495 discover_packet.options[opts++]=DHCPDISCOVER; 491 discover_packet.options[opts++]=DHCPDISCOVER;
496 492
497 /* the IP address we're requesting */ 493 /* the IP address we're requesting */
498 if(request_specific_address==TRUE){ 494 if(request_specific_address){
499 discover_packet.options[opts++]=DHCP_OPTION_REQUESTED_ADDRESS; 495 discover_packet.options[opts++]=DHCP_OPTION_REQUESTED_ADDRESS;
500 discover_packet.options[opts++]='\x04'; 496 discover_packet.options[opts++]='\x04';
501 memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address)); 497 memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address));
502 opts += sizeof(requested_address); 498 opts += sizeof(requested_address);
503 } 499 }
504 discover_packet.options[opts++]=DHCP_OPTION_END; 500 discover_packet.options[opts++]= (char)DHCP_OPTION_END;
505 501
506 /* unicast fields */ 502 /* unicast fields */
507 if(unicast) 503 if(unicast)
@@ -511,8 +507,8 @@ int send_dhcp_discover(int sock){
511 discover_packet.hops = unicast ? 1 : 0; 507 discover_packet.hops = unicast ? 1 : 0;
512 508
513 /* send the DHCPDISCOVER packet to broadcast address */ 509 /* send the DHCPDISCOVER packet to broadcast address */
514 sockaddr_broadcast.sin_family=AF_INET; 510 sockaddr_broadcast.sin_family=AF_INET;
515 sockaddr_broadcast.sin_port=htons(DHCP_SERVER_PORT); 511 sockaddr_broadcast.sin_port=htons(DHCP_SERVER_PORT);
516 sockaddr_broadcast.sin_addr.s_addr = unicast ? dhcp_ip.s_addr : INADDR_BROADCAST; 512 sockaddr_broadcast.sin_addr.s_addr = unicast ? dhcp_ip.s_addr : INADDR_BROADCAST;
517 bzero(&sockaddr_broadcast.sin_zero,sizeof(sockaddr_broadcast.sin_zero)); 513 bzero(&sockaddr_broadcast.sin_zero,sizeof(sockaddr_broadcast.sin_zero));
518 514
@@ -524,7 +520,7 @@ int send_dhcp_discover(int sock){
524 printf("DHCDISCOVER yiaddr: %s\n",inet_ntoa(discover_packet.yiaddr)); 520 printf("DHCDISCOVER yiaddr: %s\n",inet_ntoa(discover_packet.yiaddr));
525 printf("DHCDISCOVER siaddr: %s\n",inet_ntoa(discover_packet.siaddr)); 521 printf("DHCDISCOVER siaddr: %s\n",inet_ntoa(discover_packet.siaddr));
526 printf("DHCDISCOVER giaddr: %s\n",inet_ntoa(discover_packet.giaddr)); 522 printf("DHCDISCOVER giaddr: %s\n",inet_ntoa(discover_packet.giaddr));
527 } 523 }
528 524
529 /* send the DHCPDISCOVER packet out */ 525 /* send the DHCPDISCOVER packet out */
530 send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast); 526 send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast);
@@ -533,7 +529,7 @@ int send_dhcp_discover(int sock){
533 printf("\n\n"); 529 printf("\n\n");
534 530
535 return OK; 531 return OK;
536 } 532}
537 533
538 534
539 535
@@ -573,13 +569,13 @@ int get_dhcp_offer(int sock){
573 printf(_("Result=ERROR\n")); 569 printf(_("Result=ERROR\n"));
574 570
575 continue; 571 continue;
576 } 572 }
577 else{ 573 else{
578 if(verbose) 574 if(verbose)
579 printf(_("Result=OK\n")); 575 printf(_("Result=OK\n"));
580 576
581 responses++; 577 responses++;
582 } 578 }
583 579
584 /* The "source" is either a server or a relay. */ 580 /* The "source" is either a server or a relay. */
585 /* Save a copy of "source" into "via" even if it's via itself */ 581 /* Save a copy of "source" into "via" even if it's via itself */
@@ -589,7 +585,7 @@ int get_dhcp_offer(int sock){
589 printf(_("DHCPOFFER from IP address %s"),inet_ntoa(source.sin_addr)); 585 printf(_("DHCPOFFER from IP address %s"),inet_ntoa(source.sin_addr));
590 printf(_(" via %s\n"),inet_ntoa(via.sin_addr)); 586 printf(_(" via %s\n"),inet_ntoa(via.sin_addr));
591 printf("DHCPOFFER XID: %u (0x%X)\n",ntohl(offer_packet.xid),ntohl(offer_packet.xid)); 587 printf("DHCPOFFER XID: %u (0x%X)\n",ntohl(offer_packet.xid),ntohl(offer_packet.xid));
592 } 588 }
593 589
594 /* check packet xid to see if its the same as the one we used in the discover packet */ 590 /* check packet xid to see if its the same as the one we used in the discover packet */
595 if(ntohl(offer_packet.xid)!=packet_xid){ 591 if(ntohl(offer_packet.xid)!=packet_xid){
@@ -597,7 +593,7 @@ int get_dhcp_offer(int sock){
597 printf(_("DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"),ntohl(offer_packet.xid),packet_xid); 593 printf(_("DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"),ntohl(offer_packet.xid),packet_xid);
598 594
599 continue; 595 continue;
600 } 596 }
601 597
602 /* check hardware address */ 598 /* check hardware address */
603 result=OK; 599 result=OK;
@@ -610,7 +606,7 @@ int get_dhcp_offer(int sock){
610 606
611 if(offer_packet.chaddr[x]!=client_hardware_address[x]) 607 if(offer_packet.chaddr[x]!=client_hardware_address[x])
612 result=ERROR; 608 result=ERROR;
613 } 609 }
614 if(verbose) 610 if(verbose)
615 printf("\n"); 611 printf("\n");
616 612
@@ -619,27 +615,27 @@ int get_dhcp_offer(int sock){
619 printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n")); 615 printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n"));
620 616
621 continue; 617 continue;
622 } 618 }
623 619
624 if(verbose){ 620 if(verbose){
625 printf("DHCPOFFER ciaddr: %s\n",inet_ntoa(offer_packet.ciaddr)); 621 printf("DHCPOFFER ciaddr: %s\n",inet_ntoa(offer_packet.ciaddr));
626 printf("DHCPOFFER yiaddr: %s\n",inet_ntoa(offer_packet.yiaddr)); 622 printf("DHCPOFFER yiaddr: %s\n",inet_ntoa(offer_packet.yiaddr));
627 printf("DHCPOFFER siaddr: %s\n",inet_ntoa(offer_packet.siaddr)); 623 printf("DHCPOFFER siaddr: %s\n",inet_ntoa(offer_packet.siaddr));
628 printf("DHCPOFFER giaddr: %s\n",inet_ntoa(offer_packet.giaddr)); 624 printf("DHCPOFFER giaddr: %s\n",inet_ntoa(offer_packet.giaddr));
629 } 625 }
630 626
631 add_dhcp_offer(source.sin_addr,&offer_packet); 627 add_dhcp_offer(source.sin_addr,&offer_packet);
632 628
633 valid_responses++; 629 valid_responses++;
634 } 630 }
635 631
636 if(verbose){ 632 if(verbose){
637 printf(_("Total responses seen on the wire: %d\n"),responses); 633 printf(_("Total responses seen on the wire: %d\n"),responses);
638 printf(_("Valid responses for this machine: %d\n"),valid_responses); 634 printf(_("Valid responses for this machine: %d\n"),valid_responses);
639 } 635 }
640 636
641 return OK; 637 return OK;
642 } 638}
643 639
644 640
645 641
@@ -656,14 +652,14 @@ int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in
656 return ERROR; 652 return ERROR;
657 653
658 return OK; 654 return OK;
659 } 655}
660 656
661 657
662 658
663/* receives a DHCP packet */ 659/* receives a DHCP packet */
664int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, struct sockaddr_in *address){ 660int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, struct sockaddr_in *address){
665 struct timeval tv; 661 struct timeval tv;
666 fd_set readfds; 662 fd_set readfds;
667 fd_set oobfds; 663 fd_set oobfds;
668 int recv_result; 664 int recv_result;
669 socklen_t address_size; 665 socklen_t address_size;
@@ -671,88 +667,88 @@ int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, st
671 int nfound; 667 int nfound;
672 668
673 669
674 /* wait for data to arrive (up time timeout) */ 670 /* wait for data to arrive (up time timeout) */
675 tv.tv_sec=timeout; 671 tv.tv_sec=timeout;
676 tv.tv_usec=0; 672 tv.tv_usec=0;
677 FD_ZERO(&readfds); 673 FD_ZERO(&readfds);
678 FD_ZERO(&oobfds); 674 FD_ZERO(&oobfds);
679 FD_SET(sock,&readfds); 675 FD_SET(sock,&readfds);
680 FD_SET(sock,&oobfds); 676 FD_SET(sock,&oobfds);
681 nfound = select(sock+1,&readfds,NULL,&oobfds,&tv); 677 nfound = select(sock+1,&readfds,NULL,&oobfds,&tv);
682 678
683 /* make sure some data has arrived */ 679 /* make sure some data has arrived */
684 if(!FD_ISSET(sock,&readfds)){ 680 if(!FD_ISSET(sock,&readfds)){
685 if(verbose) 681 if(verbose)
686 printf(_("No (more) data received (nfound: %d)\n"), nfound); 682 printf(_("No (more) data received (nfound: %d)\n"), nfound);
687 return ERROR; 683 return ERROR;
688 } 684 }
689 685
690 else{ 686 else{
691 bzero(&source_address,sizeof(source_address)); 687 bzero(&source_address,sizeof(source_address));
692 address_size=sizeof(source_address); 688 address_size=sizeof(source_address);
693 recv_result=recvfrom(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)&source_address,&address_size); 689 recv_result=recvfrom(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)&source_address,&address_size);
694 if(verbose) 690 if(verbose)
695 printf("recv_result: %d\n",recv_result); 691 printf("recv_result: %d\n",recv_result);
696 692
697 if(recv_result==-1){ 693 if(recv_result==-1){
698 if(verbose){ 694 if(verbose){
699 printf(_("recvfrom() failed, ")); 695 printf(_("recvfrom() failed, "));
700 printf("errno: (%d) -> %s\n",errno,strerror(errno)); 696 printf("errno: (%d) -> %s\n",errno,strerror(errno));
701 } 697 }
702 return ERROR; 698 return ERROR;
703 } 699 }
704 else{ 700 else{
705 if(verbose){ 701 if(verbose){
706 printf(_("receive_dhcp_packet() result: %d\n"),recv_result); 702 printf(_("receive_dhcp_packet() result: %d\n"),recv_result);
707 printf(_("receive_dhcp_packet() source: %s\n"),inet_ntoa(source_address.sin_addr)); 703 printf(_("receive_dhcp_packet() source: %s\n"),inet_ntoa(source_address.sin_addr));
708 } 704 }
709 705
710 memcpy(address,&source_address,sizeof(source_address)); 706 memcpy(address,&source_address,sizeof(source_address));
711 return OK; 707 return OK;
712 } 708 }
713 } 709 }
714 710
715 return OK; 711 return OK;
716 } 712}
717 713
718 714
719/* creates a socket for DHCP communication */ 715/* creates a socket for DHCP communication */
720int create_dhcp_socket(void){ 716int create_dhcp_socket(void){
721 struct sockaddr_in myname; 717 struct sockaddr_in myname;
722 struct ifreq interface; 718 struct ifreq interface;
723 int sock; 719 int sock;
724 int flag=1; 720 int flag=1;
725 721
726 /* Set up the address we're going to bind to. */ 722 /* Set up the address we're going to bind to. */
727 bzero(&myname,sizeof(myname)); 723 bzero(&myname,sizeof(myname));
728 myname.sin_family=AF_INET; 724 myname.sin_family=AF_INET;
729 /* listen to DHCP server port if we're in unicast mode */ 725 /* listen to DHCP server port if we're in unicast mode */
730 myname.sin_port = htons(unicast ? DHCP_SERVER_PORT : DHCP_CLIENT_PORT); 726 myname.sin_port = htons(unicast ? DHCP_SERVER_PORT : DHCP_CLIENT_PORT);
731 myname.sin_addr.s_addr = unicast ? my_ip.s_addr : INADDR_ANY; 727 myname.sin_addr.s_addr = unicast ? my_ip.s_addr : INADDR_ANY;
732 bzero(&myname.sin_zero,sizeof(myname.sin_zero)); 728 bzero(&myname.sin_zero,sizeof(myname.sin_zero));
733 729
734 /* create a socket for DHCP communications */ 730 /* create a socket for DHCP communications */
735 sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP); 731 sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
736 if(sock<0){ 732 if(sock<0){
737 printf(_("Error: Could not create socket!\n")); 733 printf(_("Error: Could not create socket!\n"));
738 exit(STATE_UNKNOWN); 734 exit(STATE_UNKNOWN);
739 } 735 }
740 736
741 if(verbose) 737 if(verbose)
742 printf("DHCP socket: %d\n",sock); 738 printf("DHCP socket: %d\n",sock);
743 739
744 /* set the reuse address flag so we don't get errors when restarting */ 740 /* set the reuse address flag so we don't get errors when restarting */
745 flag=1; 741 flag=1;
746 if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(char *)&flag,sizeof(flag))<0){ 742 if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(char *)&flag,sizeof(flag))<0){
747 printf(_("Error: Could not set reuse address option on DHCP socket!\n")); 743 printf(_("Error: Could not set reuse address option on DHCP socket!\n"));
748 exit(STATE_UNKNOWN); 744 exit(STATE_UNKNOWN);
749 } 745 }
750 746
751 /* set the broadcast option - we need this to listen to DHCP broadcast messages */ 747 /* set the broadcast option - we need this to listen to DHCP broadcast messages */
752 if(!unicast && setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){ 748 if(!unicast && setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){
753 printf(_("Error: Could not set broadcast option on DHCP socket!\n")); 749 printf(_("Error: Could not set broadcast option on DHCP socket!\n"));
754 exit(STATE_UNKNOWN); 750 exit(STATE_UNKNOWN);
755 } 751 }
756 752
757 /* bind socket to interface */ 753 /* bind socket to interface */
758#if defined(__linux__) 754#if defined(__linux__)
@@ -761,21 +757,21 @@ int create_dhcp_socket(void){
761 if(setsockopt(sock,SOL_SOCKET,SO_BINDTODEVICE,(char *)&interface,sizeof(interface))<0){ 757 if(setsockopt(sock,SOL_SOCKET,SO_BINDTODEVICE,(char *)&interface,sizeof(interface))<0){
762 printf(_("Error: Could not bind socket to interface %s. Check your privileges...\n"),network_interface_name); 758 printf(_("Error: Could not bind socket to interface %s. Check your privileges...\n"),network_interface_name);
763 exit(STATE_UNKNOWN); 759 exit(STATE_UNKNOWN);
764 } 760 }
765 761
766#else 762#else
767 strncpy(interface.ifr_name,network_interface_name,IFNAMSIZ-1); 763 strncpy(interface.ifr_name,network_interface_name,IFNAMSIZ-1);
768 interface.ifr_name[IFNAMSIZ-1]='\0'; 764 interface.ifr_name[IFNAMSIZ-1]='\0';
769#endif 765#endif
770 766
771 /* bind the socket */ 767 /* bind the socket */
772 if(bind(sock,(struct sockaddr *)&myname,sizeof(myname))<0){ 768 if(bind(sock,(struct sockaddr *)&myname,sizeof(myname))<0){
773 printf(_("Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"),DHCP_CLIENT_PORT); 769 printf(_("Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"),DHCP_CLIENT_PORT);
774 exit(STATE_UNKNOWN); 770 exit(STATE_UNKNOWN);
775 } 771 }
776 772
777 return sock; 773 return sock;
778 } 774}
779 775
780 776
781/* closes DHCP socket */ 777/* closes DHCP socket */
@@ -784,7 +780,7 @@ int close_dhcp_socket(int sock){
784 close(sock); 780 close(sock);
785 781
786 return OK; 782 return OK;
787 } 783}
788 784
789 785
790/* adds a requested server address to list in memory */ 786/* adds a requested server address to list in memory */
@@ -796,7 +792,7 @@ int add_requested_server(struct in_addr server_address){
796 return ERROR; 792 return ERROR;
797 793
798 new_server->server_address=server_address; 794 new_server->server_address=server_address;
799 new_server->answered=FALSE; 795 new_server->answered=false;
800 796
801 new_server->next=requested_server_list; 797 new_server->next=requested_server_list;
802 requested_server_list=new_server; 798 requested_server_list=new_server;
@@ -807,7 +803,7 @@ int add_requested_server(struct in_addr server_address){
807 printf(_("Requested server address: %s\n"),inet_ntoa(new_server->server_address)); 803 printf(_("Requested server address: %s\n"),inet_ntoa(new_server->server_address));
808 804
809 return OK; 805 return OK;
810 } 806}
811 807
812 808
813 809
@@ -840,29 +836,29 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
840 836
841 /* get option data */ 837 /* get option data */
842 switch(option_type){ 838 switch(option_type){
843 case DHCP_OPTION_LEASE_TIME: 839 case DHCP_OPTION_LEASE_TIME:
844 memcpy(&dhcp_lease_time, &offer_packet->options[x],sizeof(dhcp_lease_time)); 840 memcpy(&dhcp_lease_time, &offer_packet->options[x],sizeof(dhcp_lease_time));
845 dhcp_lease_time = ntohl(dhcp_lease_time); 841 dhcp_lease_time = ntohl(dhcp_lease_time);
846 break; 842 break;
847 case DHCP_OPTION_RENEWAL_TIME: 843 case DHCP_OPTION_RENEWAL_TIME:
848 memcpy(&dhcp_renewal_time, &offer_packet->options[x],sizeof(dhcp_renewal_time)); 844 memcpy(&dhcp_renewal_time, &offer_packet->options[x],sizeof(dhcp_renewal_time));
849 dhcp_renewal_time = ntohl(dhcp_renewal_time); 845 dhcp_renewal_time = ntohl(dhcp_renewal_time);
850 break; 846 break;
851 case DHCP_OPTION_REBINDING_TIME: 847 case DHCP_OPTION_REBINDING_TIME:
852 memcpy(&dhcp_rebinding_time, &offer_packet->options[x],sizeof(dhcp_rebinding_time)); 848 memcpy(&dhcp_rebinding_time, &offer_packet->options[x],sizeof(dhcp_rebinding_time));
853 dhcp_rebinding_time = ntohl(dhcp_rebinding_time); 849 dhcp_rebinding_time = ntohl(dhcp_rebinding_time);
854 break; 850 break;
855 case DHCP_OPTION_SERVER_IDENTIFIER: 851 case DHCP_OPTION_SERVER_IDENTIFIER:
856 memcpy(&serv_ident.s_addr, &offer_packet->options[x],sizeof(serv_ident.s_addr)); 852 memcpy(&serv_ident.s_addr, &offer_packet->options[x],sizeof(serv_ident.s_addr));
857 break; 853 break;
858 } 854 }
859 855
860 /* skip option data we're ignoring */ 856 /* skip option data we're ignoring */
861 if(option_type==0) /* "pad" option, see RFC 2132 (3.1) */ 857 if(option_type==0) /* "pad" option, see RFC 2132 (3.1) */
862 x+=1; 858 x+=1;
863 else 859 else
864 x+=option_length; 860 x+=option_length;
865 } 861 }
866 862
867 if(verbose){ 863 if(verbose){
868 if(dhcp_lease_time==DHCP_INFINITE_TIME) 864 if(dhcp_lease_time==DHCP_INFINITE_TIME)
@@ -876,7 +872,7 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
876 if(dhcp_rebinding_time==DHCP_INFINITE_TIME) 872 if(dhcp_rebinding_time==DHCP_INFINITE_TIME)
877 printf(_("Rebinding Time: Infinite\n")); 873 printf(_("Rebinding Time: Infinite\n"));
878 printf(_("Rebinding Time: %lu seconds\n"),(unsigned long)dhcp_rebinding_time); 874 printf(_("Rebinding Time: %lu seconds\n"),(unsigned long)dhcp_rebinding_time);
879 } 875 }
880 876
881 new_offer=(dhcp_offer *)malloc(sizeof(dhcp_offer)); 877 new_offer=(dhcp_offer *)malloc(sizeof(dhcp_offer));
882 878
@@ -900,19 +896,20 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
900 new_offer->lease_time=dhcp_lease_time; 896 new_offer->lease_time=dhcp_lease_time;
901 new_offer->renewal_time=dhcp_renewal_time; 897 new_offer->renewal_time=dhcp_renewal_time;
902 new_offer->rebinding_time=dhcp_rebinding_time; 898 new_offer->rebinding_time=dhcp_rebinding_time;
899 new_offer->desired=false; /* exclusive mode: we'll check that in get_results */
903 900
904 901
905 if(verbose){ 902 if(verbose){
906 printf(_("Added offer from server @ %s"),inet_ntoa(new_offer->server_address)); 903 printf(_("Added offer from server @ %s"),inet_ntoa(new_offer->server_address));
907 printf(_(" of IP address %s\n"),inet_ntoa(new_offer->offered_address)); 904 printf(_(" of IP address %s\n"),inet_ntoa(new_offer->offered_address));
908 } 905 }
909 906
910 /* add new offer to head of list */ 907 /* add new offer to head of list */
911 new_offer->next=dhcp_offer_list; 908 new_offer->next=dhcp_offer_list;
912 dhcp_offer_list=new_offer; 909 dhcp_offer_list=new_offer;
913 910
914 return OK; 911 return OK;
915 } 912}
916 913
917 914
918/* frees memory allocated to DHCP OFFER list */ 915/* frees memory allocated to DHCP OFFER list */
@@ -923,10 +920,10 @@ int free_dhcp_offer_list(void){
923 for(this_offer=dhcp_offer_list;this_offer!=NULL;this_offer=next_offer){ 920 for(this_offer=dhcp_offer_list;this_offer!=NULL;this_offer=next_offer){
924 next_offer=this_offer->next; 921 next_offer=this_offer->next;
925 free(this_offer); 922 free(this_offer);
926 } 923 }
927 924
928 return OK; 925 return OK;
929 } 926}
930 927
931 928
932/* frees memory allocated to requested server list */ 929/* frees memory allocated to requested server list */
@@ -937,20 +934,20 @@ int free_requested_server_list(void){
937 for(this_server=requested_server_list;this_server!=NULL;this_server=next_server){ 934 for(this_server=requested_server_list;this_server!=NULL;this_server=next_server){
938 next_server=this_server->next; 935 next_server=this_server->next;
939 free(this_server); 936 free(this_server);
940 } 937 }
941 938
942 return OK; 939 return OK;
943 } 940}
944 941
945 942
946/* gets state and plugin output to return */ 943/* gets state and plugin output to return */
947int get_results(void){ 944int get_results(void){
948 dhcp_offer *temp_offer; 945 dhcp_offer *temp_offer, *undesired_offer=NULL;
949 requested_server *temp_server; 946 requested_server *temp_server;
950 int result; 947 int result;
951 u_int32_t max_lease_time=0; 948 uint32_t max_lease_time=0;
952 949
953 received_requested_address=FALSE; 950 received_requested_address=false;
954 951
955 /* checks responses from requested servers */ 952 /* checks responses from requested servers */
956 requested_responses=0; 953 requested_responses=0;
@@ -966,7 +963,7 @@ int get_results(void){
966 963
967 /* see if we got the address we requested */ 964 /* see if we got the address we requested */
968 if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address))) 965 if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address)))
969 received_requested_address=TRUE; 966 received_requested_address=true;
970 967
971 /* see if the servers we wanted a response from talked to us or not */ 968 /* see if the servers we wanted a response from talked to us or not */
972 if(!memcmp(&temp_offer->server_address,&temp_server->server_address,sizeof(temp_server->server_address))){ 969 if(!memcmp(&temp_offer->server_address,&temp_server->server_address,sizeof(temp_server->server_address))){
@@ -976,16 +973,24 @@ int get_results(void){
976 if(temp_server->answered) 973 if(temp_server->answered)
977 printf(_(" (duplicate)")); 974 printf(_(" (duplicate)"));
978 printf(_("\n")); 975 printf(_("\n"));
979 } 976 }
980 if(temp_server->answered == FALSE){ 977 if(!temp_server->answered){
981 requested_responses++; 978 requested_responses++;
982 temp_server->answered=TRUE; 979 temp_server->answered=true;
983 } 980 temp_offer->desired=true;
984 } 981 }
985 } 982 }
986 } 983 }
984 }
987 985
988 } 986 /* exclusive mode: check for undesired offers */
987 for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next) {
988 if (!temp_offer->desired) {
989 undesired_offer=temp_offer; /* Checks only for the first undesired offer */
990 break; /* no further checks needed */
991 }
992 }
993 }
989 994
990 /* else check and see if we got our requested address from any server */ 995 /* else check and see if we got our requested address from any server */
991 else{ 996 else{
@@ -998,9 +1003,9 @@ int get_results(void){
998 1003
999 /* see if we got the address we requested */ 1004 /* see if we got the address we requested */
1000 if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address))) 1005 if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address)))
1001 received_requested_address=TRUE; 1006 received_requested_address=true;
1002 } 1007 }
1003 } 1008 }
1004 1009
1005 result=STATE_OK; 1010 result=STATE_OK;
1006 if(valid_responses==0) 1011 if(valid_responses==0)
@@ -1009,9 +1014,12 @@ int get_results(void){
1009 result=STATE_CRITICAL; 1014 result=STATE_CRITICAL;
1010 else if(requested_responses<requested_servers) 1015 else if(requested_responses<requested_servers)
1011 result=STATE_WARNING; 1016 result=STATE_WARNING;
1012 else if(request_specific_address==TRUE && received_requested_address==FALSE) 1017 else if(request_specific_address && !received_requested_address)
1013 result=STATE_WARNING; 1018 result=STATE_WARNING;
1014 1019
1020 if(exclusive && undesired_offer)
1021 result=STATE_CRITICAL;
1022
1015 if(result==0) /* garrett honeycutt 2005 */ 1023 if(result==0) /* garrett honeycutt 2005 */
1016 printf("OK: "); 1024 printf("OK: ");
1017 else if(result==1) 1025 else if(result==1)
@@ -1025,15 +1033,22 @@ int get_results(void){
1025 if(dhcp_offer_list==NULL){ 1033 if(dhcp_offer_list==NULL){
1026 printf(_("No DHCPOFFERs were received.\n")); 1034 printf(_("No DHCPOFFERs were received.\n"));
1027 return result; 1035 return result;
1028 } 1036 }
1029 1037
1030 printf(_("Received %d DHCPOFFER(s)"),valid_responses); 1038 printf(_("Received %d DHCPOFFER(s)"),valid_responses);
1031 1039
1040
1041 if(exclusive && undesired_offer){
1042 printf(_(", Rogue DHCP Server detected! Server %s"),inet_ntoa(undesired_offer->server_address));
1043 printf(_(" offered %s \n"),inet_ntoa(undesired_offer->offered_address));
1044 return result;
1045 }
1046
1032 if(requested_servers>0) 1047 if(requested_servers>0)
1033 printf(_(", %s%d of %d requested servers responded"),((requested_responses<requested_servers) && requested_responses>0)?"only ":"",requested_responses,requested_servers); 1048 printf(_(", %s%d of %d requested servers responded"),((requested_responses<requested_servers) && requested_responses>0)?"only ":"",requested_responses,requested_servers);
1034 1049
1035 if(request_specific_address==TRUE) 1050 if(request_specific_address)
1036 printf(_(", requested address (%s) was %soffered"),inet_ntoa(requested_address),(received_requested_address==TRUE)?"":_("not ")); 1051 printf(_(", requested address (%s) was %soffered"),inet_ntoa(requested_address),(received_requested_address)?"":_("not "));
1037 1052
1038 printf(_(", max lease time = ")); 1053 printf(_(", max lease time = "));
1039 if(max_lease_time==DHCP_INFINITE_TIME) 1054 if(max_lease_time==DHCP_INFINITE_TIME)
@@ -1044,17 +1059,15 @@ int get_results(void){
1044 printf(".\n"); 1059 printf(".\n");
1045 1060
1046 return result; 1061 return result;
1047 } 1062}
1048 1063
1049 1064
1050/* process command-line arguments */ 1065/* process command-line arguments */
1051int process_arguments(int argc, char **argv){ 1066int process_arguments(int argc, char **argv){
1052 int arg_index;
1053
1054 if(argc<1) 1067 if(argc<1)
1055 return ERROR; 1068 return ERROR;
1056 1069
1057 arg_index = call_getopt(argc,argv); 1070 call_getopt(argc,argv);
1058 return validate_arguments(argc); 1071 return validate_arguments(argc);
1059} 1072}
1060 1073
@@ -1071,87 +1084,89 @@ int call_getopt(int argc, char **argv){
1071 {"interface", required_argument,0,'i'}, 1084 {"interface", required_argument,0,'i'},
1072 {"mac", required_argument,0,'m'}, 1085 {"mac", required_argument,0,'m'},
1073 {"unicast", no_argument, 0,'u'}, 1086 {"unicast", no_argument, 0,'u'},
1087 {"exclusive", no_argument, 0,'x'},
1074 {"verbose", no_argument, 0,'v'}, 1088 {"verbose", no_argument, 0,'v'},
1075 {"version", no_argument, 0,'V'}, 1089 {"version", no_argument, 0,'V'},
1076 {"help", no_argument, 0,'h'}, 1090 {"help", no_argument, 0,'h'},
1077 {0,0,0,0} 1091 {0,0,0,0}
1078 }; 1092 };
1079 1093
1080 while(1){ 1094 int c=0;
1081 int c=0; 1095 while(true){
1082 1096 c=getopt_long(argc,argv,"+hVvxt:s:r:t:i:m:u",long_options,&option_index);
1083 c=getopt_long(argc,argv,"+hVvt:s:r:t:i:m:u",long_options,&option_index);
1084 1097
1085 if(c==-1||c==EOF||c==1) 1098 if(c==-1||c==EOF||c==1)
1086 break; 1099 break;
1087 1100
1088 switch(c){ 1101 switch(c){
1089 1102
1090 case 's': /* DHCP server address */ 1103 case 's': /* DHCP server address */
1091 resolve_host(optarg,&dhcp_ip); 1104 resolve_host(optarg,&dhcp_ip);
1092 add_requested_server(dhcp_ip); 1105 add_requested_server(dhcp_ip);
1093 break; 1106 break;
1094 1107
1095 case 'r': /* address we are requested from DHCP servers */ 1108 case 'r': /* address we are requested from DHCP servers */
1096 resolve_host(optarg,&requested_address); 1109 resolve_host(optarg,&requested_address);
1097 request_specific_address=TRUE; 1110 request_specific_address=true;
1098 break; 1111 break;
1099 1112
1100 case 't': /* timeout */ 1113 case 't': /* timeout */
1101 1114
1102 /* 1115 /*
1103 if(is_intnonneg(optarg)) 1116 if(is_intnonneg(optarg))
1104 */ 1117 */
1105 if(atoi(optarg)>0) 1118 if(atoi(optarg)>0)
1106 dhcpoffer_timeout=atoi(optarg); 1119 dhcpoffer_timeout=atoi(optarg);
1107 /* 1120 /*
1108 else 1121 else
1109 usage("Time interval must be a nonnegative integer\n"); 1122 usage("Time interval must be a nonnegative integer\n");
1110 */ 1123 */
1111 break; 1124 break;
1112 1125
1113 case 'm': /* MAC address */ 1126 case 'm': /* MAC address */
1114 1127
1115 if((user_specified_mac=mac_aton(optarg)) == NULL) 1128 if((user_specified_mac=mac_aton(optarg)) == NULL)
1116 usage("Cannot parse MAC address.\n"); 1129 usage("Cannot parse MAC address.\n");
1117 if(verbose) 1130 if(verbose)
1118 print_hardware_address(user_specified_mac); 1131 print_hardware_address(user_specified_mac);
1119 1132
1120 break; 1133 break;
1121 1134
1122 case 'i': /* interface name */ 1135 case 'i': /* interface name */
1123 1136
1124 strncpy(network_interface_name,optarg,sizeof(network_interface_name)-1); 1137 strncpy(network_interface_name,optarg,sizeof(network_interface_name)-1);
1125 network_interface_name[sizeof(network_interface_name)-1]='\x0'; 1138 network_interface_name[sizeof(network_interface_name)-1]='\x0';
1126 1139
1127 break; 1140 break;
1128 1141
1129 case 'u': /* unicast testing */ 1142 case 'u': /* unicast testing */
1130 unicast=1; 1143 unicast=true;
1131 break; 1144 break;
1132 1145 case 'x': /* exclusive testing aka "rogue DHCP server detection" */
1133 case 'V': /* version */ 1146 exclusive=true;
1134 print_revision(progname, NP_VERSION); 1147 break;
1135 exit(STATE_UNKNOWN); 1148
1136 1149 case 'V': /* version */
1137 case 'h': /* help */ 1150 print_revision(progname, NP_VERSION);
1138 print_help(); 1151 exit(STATE_UNKNOWN);
1139 exit(STATE_UNKNOWN); 1152
1140 1153 case 'h': /* help */
1141 case 'v': /* verbose */ 1154 print_help();
1142 verbose=1; 1155 exit(STATE_UNKNOWN);
1143 break; 1156
1144 1157 case 'v': /* verbose */
1145 case '?': /* help */ 1158 verbose=1;
1146 usage5 (); 1159 break;
1147 break; 1160 case '?': /* help */
1148 1161 usage5 ();
1149 default: 1162 break;
1150 break; 1163
1151 } 1164 default:
1152 } 1165 break;
1166 }
1167 }
1153 return optind; 1168 return optind;
1154 } 1169}
1155 1170
1156 1171
1157int validate_arguments(int argc){ 1172int validate_arguments(int argc){
@@ -1178,21 +1193,21 @@ static int get_msg(int fd){
1178 if(res < 0){ 1193 if(res < 0){
1179 if(errno == EINTR){ 1194 if(errno == EINTR){
1180 return(GOT_INTR); 1195 return(GOT_INTR);
1181 } 1196 }
1182 else{ 1197 else{
1183 printf("%s\n", "get_msg FAILED."); 1198 printf("%s\n", "get_msg FAILED.");
1184 return(GOT_ERR); 1199 return(GOT_ERR);
1185 }
1186 } 1200 }
1201 }
1187 if(ctl.len > 0){ 1202 if(ctl.len > 0){
1188 ret |= GOT_CTRL; 1203 ret |= GOT_CTRL;
1189 } 1204 }
1190 if(dat.len > 0){ 1205 if(dat.len > 0){
1191 ret |= GOT_DATA; 1206 ret |= GOT_DATA;
1192 } 1207 }
1193 1208
1194 return(ret); 1209 return(ret);
1195 } 1210}
1196 1211
1197/* verify that dl_primitive in ctl_area = prim */ 1212/* verify that dl_primitive in ctl_area = prim */
1198static int check_ctrl(int prim){ 1213static int check_ctrl(int prim){
@@ -1201,10 +1216,10 @@ static int check_ctrl(int prim){
1201 if(err_ack->dl_primitive != prim){ 1216 if(err_ack->dl_primitive != prim){
1202 printf(_("Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"), strerror(errno)); 1217 printf(_("Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"), strerror(errno));
1203 exit(STATE_UNKNOWN); 1218 exit(STATE_UNKNOWN);
1204 } 1219 }
1205 1220
1206 return 0; 1221 return 0;
1207 } 1222}
1208 1223
1209/* put a control message on a stream */ 1224/* put a control message on a stream */
1210static int put_ctrl(int fd, int len, int pri){ 1225static int put_ctrl(int fd, int len, int pri){
@@ -1213,10 +1228,10 @@ static int put_ctrl(int fd, int len, int pri){
1213 if(putmsg(fd, &ctl, 0, pri) < 0){ 1228 if(putmsg(fd, &ctl, 0, pri) < 0){
1214 printf(_("Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"), strerror(errno)); 1229 printf(_("Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"), strerror(errno));
1215 exit(STATE_UNKNOWN); 1230 exit(STATE_UNKNOWN);
1216 } 1231 }
1217 1232
1218 return 0; 1233 return 0;
1219 } 1234}
1220 1235
1221/* put a control + data message on a stream */ 1236/* put a control + data message on a stream */
1222static int put_both(int fd, int clen, int dlen, int pri){ 1237static int put_both(int fd, int clen, int dlen, int pri){
@@ -1226,10 +1241,10 @@ static int put_both(int fd, int clen, int dlen, int pri){
1226 if(putmsg(fd, &ctl, &dat, pri) < 0){ 1241 if(putmsg(fd, &ctl, &dat, pri) < 0){
1227 printf(_("Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"), strerror(errno)); 1242 printf(_("Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"), strerror(errno));
1228 exit(STATE_UNKNOWN); 1243 exit(STATE_UNKNOWN);
1229 } 1244 }
1230 1245
1231 return 0; 1246 return 0;
1232 } 1247}
1233 1248
1234/* open file descriptor and attach */ 1249/* open file descriptor and attach */
1235static int dl_open(const char *dev, int unit, int *fd){ 1250static int dl_open(const char *dev, int unit, int *fd){
@@ -1238,13 +1253,13 @@ static int dl_open(const char *dev, int unit, int *fd){
1238 if((*fd = open(dev, O_RDWR)) == -1){ 1253 if((*fd = open(dev, O_RDWR)) == -1){
1239 printf(_("Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"), dev, strerror(errno)); 1254 printf(_("Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"), dev, strerror(errno));
1240 exit(STATE_UNKNOWN); 1255 exit(STATE_UNKNOWN);
1241 } 1256 }
1242 attach_req->dl_primitive = DL_ATTACH_REQ; 1257 attach_req->dl_primitive = DL_ATTACH_REQ;
1243 attach_req->dl_ppa = unit; 1258 attach_req->dl_ppa = unit;
1244 put_ctrl(*fd, sizeof(dl_attach_req_t), 0); 1259 put_ctrl(*fd, sizeof(dl_attach_req_t), 0);
1245 get_msg(*fd); 1260 get_msg(*fd);
1246 return check_ctrl(DL_OK_ACK); 1261 return check_ctrl(DL_OK_ACK);
1247 } 1262}
1248 1263
1249/* send DL_BIND_REQ */ 1264/* send DL_BIND_REQ */
1250static int dl_bind(int fd, int sap, u_char *addr){ 1265static int dl_bind(int fd, int sap, u_char *addr){
@@ -1262,12 +1277,12 @@ static int dl_bind(int fd, int sap, u_char *addr){
1262 if (GOT_ERR == check_ctrl(DL_BIND_ACK)){ 1277 if (GOT_ERR == check_ctrl(DL_BIND_ACK)){
1263 printf(_("Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"), strerror(errno)); 1278 printf(_("Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"), strerror(errno));
1264 exit(STATE_UNKNOWN); 1279 exit(STATE_UNKNOWN);
1265 } 1280 }
1266 bcopy((u_char *)bind_ack + bind_ack->dl_addr_offset, addr, 1281 bcopy((u_char *)bind_ack + bind_ack->dl_addr_offset, addr,
1267 bind_ack->dl_addr_length); 1282 bind_ack->dl_addr_length);
1268 1283
1269 return 0; 1284 return 0;
1270 } 1285}
1271 1286
1272/*********************************************************************** 1287/***********************************************************************
1273 * interface: 1288 * interface:
@@ -1286,15 +1301,15 @@ long mac_addr_dlpi( const char *dev, int unit, u_char *addr){
1286 u_char mac_addr[25]; 1301 u_char mac_addr[25];
1287 1302
1288 if(GOT_ERR != dl_open(dev, unit, &fd)){ 1303 if(GOT_ERR != dl_open(dev, unit, &fd)){
1289 if(GOT_ERR != dl_bind(fd, INSAP, mac_addr)){ 1304 if(GOT_ERR != dl_bind(fd, INSAP, mac_addr)){
1290 bcopy( mac_addr, addr, 6); 1305 bcopy( mac_addr, addr, 6);
1291 return 0; 1306 return 0;
1292 }
1293 } 1307 }
1294 close(fd); 1308 }
1309 close(fd);
1295 1310
1296 return -1; 1311 return -1;
1297 } 1312}
1298 1313
1299/* Kompf 2000-2003 */ 1314/* Kompf 2000-2003 */
1300#endif 1315#endif
@@ -1311,7 +1326,7 @@ void resolve_host(const char *in,struct in_addr *out){
1311 1326
1312 memcpy(out,&((struct sockaddr_in *)ai->ai_addr)->sin_addr,sizeof(*out)); 1327 memcpy(out,&((struct sockaddr_in *)ai->ai_addr)->sin_addr,sizeof(*out));
1313 freeaddrinfo(ai); 1328 freeaddrinfo(ai);
1314 } 1329}
1315 1330
1316 1331
1317/* parse MAC address string, return 6 bytes (unterminated) or NULL */ 1332/* parse MAC address string, return 6 bytes (unterminated) or NULL */
@@ -1330,10 +1345,10 @@ unsigned char *mac_aton(const char *string){
1330 result[j]=strtol(tmp,(char **)NULL,16); 1345 result[j]=strtol(tmp,(char **)NULL,16);
1331 i++; 1346 i++;
1332 j++; 1347 j++;
1333 } 1348 }
1334 1349
1335 return (j==6) ? result : NULL; 1350 return (j==6) ? result : NULL;
1336 } 1351}
1337 1352
1338 1353
1339void print_hardware_address(const unsigned char *address){ 1354void print_hardware_address(const unsigned char *address){
@@ -1344,7 +1359,7 @@ void print_hardware_address(const unsigned char *address){
1344 printf("%2.2x:", address[i]); 1359 printf("%2.2x:", address[i]);
1345 printf("%2.2x", address[i]); 1360 printf("%2.2x", address[i]);
1346 putchar('\n'); 1361 putchar('\n');
1347 } 1362}
1348 1363
1349 1364
1350/* print usage help */ 1365/* print usage help */
@@ -1357,7 +1372,7 @@ void print_help(void){
1357 1372
1358 printf("%s\n", _("This plugin tests the availability of DHCP servers on a network.")); 1373 printf("%s\n", _("This plugin tests the availability of DHCP servers on a network."));
1359 1374
1360 printf ("\n\n"); 1375 printf ("\n\n");
1361 1376
1362 print_usage(); 1377 print_usage();
1363 1378
@@ -1367,32 +1382,31 @@ void print_help(void){
1367 printf (UT_VERBOSE); 1382 printf (UT_VERBOSE);
1368 1383
1369 printf (" %s\n", "-s, --serverip=IPADDRESS"); 1384 printf (" %s\n", "-s, --serverip=IPADDRESS");
1370 printf (" %s\n", _("IP address of DHCP server that we must hear from")); 1385 printf (" %s\n", _("IP address of DHCP server that we must hear from"));
1371 printf (" %s\n", "-r, --requestedip=IPADDRESS"); 1386 printf (" %s\n", "-r, --requestedip=IPADDRESS");
1372 printf (" %s\n", _("IP address that should be offered by at least one DHCP server")); 1387 printf (" %s\n", _("IP address that should be offered by at least one DHCP server"));
1373 printf (" %s\n", "-t, --timeout=INTEGER"); 1388 printf (" %s\n", "-t, --timeout=INTEGER");
1374 printf (" %s\n", _("Seconds to wait for DHCPOFFER before timeout occurs")); 1389 printf (" %s\n", _("Seconds to wait for DHCPOFFER before timeout occurs"));
1375 printf (" %s\n", "-i, --interface=STRING"); 1390 printf (" %s\n", "-i, --interface=STRING");
1376 printf (" %s\n", _("Interface to to use for listening (i.e. eth0)")); 1391 printf (" %s\n", _("Interface to to use for listening (i.e. eth0)"));
1377 printf (" %s\n", "-m, --mac=STRING"); 1392 printf (" %s\n", "-m, --mac=STRING");
1378 printf (" %s\n", _("MAC address to use in the DHCP request")); 1393 printf (" %s\n", _("MAC address to use in the DHCP request"));
1379 printf (" %s\n", "-u, --unicast"); 1394 printf (" %s\n", "-u, --unicast");
1380 printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s")); 1395 printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
1381 1396 printf (" %s\n", "-x, --exclusive");
1382 printf (UT_SUPPORT); 1397 printf (" %s\n", _("Only requested DHCP server may response (rogue DHCP server detection), requires -s"));
1398
1399 printf (UT_SUPPORT);
1383 return; 1400 return;
1384 } 1401}
1385 1402
1386 1403
1387void 1404void
1388print_usage(void){ 1405print_usage(void){
1389 1406
1390 printf ("%s\n", _("Usage:")); 1407 printf ("%s\n", _("Usage:"));
1391 printf (" %s [-v] [-u] [-s serverip] [-r requestedip] [-t timeout]\n",progname); 1408 printf (" %s [-v] [-u] [-x] [-s serverip] [-r requestedip] [-t timeout]\n",progname);
1392 printf (" [-i interface] [-m mac]\n"); 1409 printf (" [-i interface] [-m mac]\n");
1393 1410
1394 return; 1411 return;
1395 } 1412}
1396
1397
1398
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 1d47e9f..f788d42 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -43,7 +43,7 @@ const char *copyright = "2005-2008";
43const char *email = "devel@monitoring-plugins.org"; 43const char *email = "devel@monitoring-plugins.org";
44 44
45/** Monitoring Plugins basic includes */ 45/** Monitoring Plugins basic includes */
46#include "common.h" 46#include "../plugins/common.h"
47#include "netutils.h" 47#include "netutils.h"
48#include "utils.h" 48#include "utils.h"
49 49
@@ -109,18 +109,35 @@ typedef struct rta_host {
109 unsigned char icmp_type, icmp_code; /* type and code from errors */ 109 unsigned char icmp_type, icmp_code; /* type and code from errors */
110 unsigned short flags; /* control/status flags */ 110 unsigned short flags; /* control/status flags */
111 double rta; /* measured RTA */ 111 double rta; /* measured RTA */
112 int rta_status; // check result for RTA checks
112 double rtmax; /* max rtt */ 113 double rtmax; /* max rtt */
113 double rtmin; /* min rtt */ 114 double rtmin; /* min rtt */
115 double jitter; /* measured jitter */
116 int jitter_status; // check result for Jitter checks
117 double jitter_max; /* jitter rtt maximum */
118 double jitter_min; /* jitter rtt minimum */
119 double EffectiveLatency;
120 double mos; /* Mean opnion score */
121 int mos_status; // check result for MOS checks
122 double score; /* score */
123 int score_status; // check result for score checks
124 u_int last_tdiff;
125 u_int last_icmp_seq; /* Last ICMP_SEQ to check out of order pkts */
114 unsigned char pl; /* measured packet loss */ 126 unsigned char pl; /* measured packet loss */
127 int pl_status; // check result for packet loss checks
115 struct rta_host *next; /* linked list */ 128 struct rta_host *next; /* linked list */
129 int order_status; // check result for packet order checks
116} rta_host; 130} rta_host;
117 131
118#define FLAG_LOST_CAUSE 0x01 /* decidedly dead target. */ 132#define FLAG_LOST_CAUSE 0x01 /* decidedly dead target. */
119 133
120/* threshold structure. all values are maximum allowed, exclusive */ 134/* threshold structure. all values are maximum allowed, exclusive */
121typedef struct threshold { 135typedef struct threshold {
122 unsigned char pl; /* max allowed packet loss in percent */ 136 unsigned char pl; /* max allowed packet loss in percent */
123 unsigned int rta; /* roundtrip time average, microseconds */ 137 unsigned int rta; /* roundtrip time average, microseconds */
138 double jitter; /* jitter time average, microseconds */
139 double mos; /* MOS */
140 double score; /* Score */
124} threshold; 141} threshold;
125 142
126/* the data structure */ 143/* the data structure */
@@ -159,6 +176,16 @@ typedef union icmp_packet {
159#define MODE_ALL 2 176#define MODE_ALL 2
160#define MODE_ICMP 3 177#define MODE_ICMP 3
161 178
179enum enum_threshold_mode {
180 const_rta_mode,
181 const_packet_loss_mode,
182 const_jitter_mode,
183 const_mos_mode,
184 const_score_mode
185};
186
187typedef enum enum_threshold_mode threshold_mode;
188
162/* the different ping types we can do 189/* the different ping types we can do
163 * TODO: investigate ARP ping as well */ 190 * TODO: investigate ARP ping as well */
164#define HAVE_ICMP 1 191#define HAVE_ICMP 1
@@ -188,6 +215,8 @@ static int wait_for_reply(int, u_int);
188static int recvfrom_wto(int, void *, unsigned int, struct sockaddr *, u_int *, struct timeval*); 215static int recvfrom_wto(int, void *, unsigned int, struct sockaddr *, u_int *, struct timeval*);
189static int send_icmp_ping(int, struct rta_host *); 216static int send_icmp_ping(int, struct rta_host *);
190static int get_threshold(char *str, threshold *th); 217static int get_threshold(char *str, threshold *th);
218static bool get_threshold2(char *str, size_t length, threshold *, threshold *, threshold_mode mode);
219static bool parse_threshold2_helper(char *s, size_t length, threshold *thr, threshold_mode mode);
191static void run_checks(void); 220static void run_checks(void);
192static void set_source_ip(char *); 221static void set_source_ip(char *);
193static int add_target(char *); 222static int add_target(char *);
@@ -199,13 +228,28 @@ static void finish(int);
199static void crash(const char *, ...); 228static void crash(const char *, ...);
200 229
201/** external **/ 230/** external **/
202extern int optind, opterr, optopt; 231extern int optind;
203extern char *optarg; 232extern char *optarg;
204extern char **environ; 233extern char **environ;
205 234
206/** global variables **/ 235/** global variables **/
207static struct rta_host **table, *cursor, *list; 236static struct rta_host **table, *cursor, *list;
208static threshold crit = {80, 500000}, warn = {40, 200000}; 237
238static threshold crit = {
239 .pl = 80,
240 .rta = 500000,
241 .jitter = 0.0,
242 .mos = 0.0,
243 .score = 0.0
244};
245static threshold warn = {
246 .pl = 40,
247 .rta = 200000,
248 .jitter = 0.0,
249 .mos = 0.0,
250 .score = 0.0
251};
252
209static int mode, protocols, sockets, debug = 0, timeout = 10; 253static int mode, protocols, sockets, debug = 0, timeout = 10;
210static unsigned short icmp_data_size = DEFAULT_PING_DATA_SIZE; 254static unsigned short icmp_data_size = DEFAULT_PING_DATA_SIZE;
211static unsigned short icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN; 255static unsigned short icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN;
@@ -224,6 +268,12 @@ static unsigned int warn_down = 1, crit_down = 1; /* host down threshold values
224static int min_hosts_alive = -1; 268static int min_hosts_alive = -1;
225float pkt_backoff_factor = 1.5; 269float pkt_backoff_factor = 1.5;
226float target_backoff_factor = 1.5; 270float target_backoff_factor = 1.5;
271bool rta_mode=false;
272bool pl_mode=false;
273bool jitter_mode=false;
274bool score_mode=false;
275bool mos_mode=false;
276bool order_mode=false;
227 277
228/** code start **/ 278/** code start **/
229static void 279static void
@@ -393,12 +443,14 @@ main(int argc, char **argv)
393 int icmp_sockerrno, udp_sockerrno, tcp_sockerrno; 443 int icmp_sockerrno, udp_sockerrno, tcp_sockerrno;
394 int result; 444 int result;
395 struct rta_host *host; 445 struct rta_host *host;
446#ifdef HAVE_SIGACTION
447 struct sigaction sig_action;
448#endif
396#ifdef SO_TIMESTAMP 449#ifdef SO_TIMESTAMP
397 int on = 1; 450 int on = 1;
398#endif 451#endif
399 char *source_ip = NULL; 452 char *source_ip = NULL;
400 char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:64"; 453 char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:P:R:J:S:M:O64";
401
402 setlocale (LC_ALL, ""); 454 setlocale (LC_ALL, "");
403 bindtextdomain (PACKAGE, LOCALEDIR); 455 bindtextdomain (PACKAGE, LOCALEDIR);
404 textdomain (PACKAGE); 456 textdomain (PACKAGE);
@@ -407,7 +459,7 @@ main(int argc, char **argv)
407 * that before pointer magic (esp. on network data) */ 459 * that before pointer magic (esp. on network data) */
408 icmp_sockerrno = udp_sockerrno = tcp_sockerrno = sockets = 0; 460 icmp_sockerrno = udp_sockerrno = tcp_sockerrno = sockets = 0;
409 461
410 address_family = -1; 462 address_family = -1;
411 int icmp_proto = IPPROTO_ICMP; 463 int icmp_proto = IPPROTO_ICMP;
412 464
413 /* get calling name the old-fashioned way for portability instead 465 /* get calling name the old-fashioned way for portability instead
@@ -422,10 +474,19 @@ main(int argc, char **argv)
422 table = NULL; 474 table = NULL;
423 475
424 mode = MODE_RTA; 476 mode = MODE_RTA;
477 /* Default critical thresholds */
425 crit.rta = 500000; 478 crit.rta = 500000;
426 crit.pl = 80; 479 crit.pl = 80;
480 crit.jitter = 50;
481 crit.mos= 3;
482 crit.score=70;
483 /* Default warning thresholds */
427 warn.rta = 200000; 484 warn.rta = 200000;
428 warn.pl = 40; 485 warn.pl = 40;
486 warn.jitter = 40;
487 warn.mos= 3.5;
488 warn.score=80;
489
429 protocols = HAVE_ICMP | HAVE_UDP | HAVE_TCP; 490 protocols = HAVE_ICMP | HAVE_UDP | HAVE_TCP;
430 pkt_interval = 80000; /* 80 msec packet interval by default */ 491 pkt_interval = 80000; /* 80 msec packet interval by default */
431 packets = 5; 492 packets = 5;
@@ -481,7 +542,8 @@ main(int argc, char **argv)
481 /* Reset argument scanning */ 542 /* Reset argument scanning */
482 optind = 1; 543 optind = 1;
483 544
484 unsigned short size; 545 unsigned long size;
546 bool err;
485 /* parse the arguments */ 547 /* parse the arguments */
486 for(i = 1; i < argc; i++) { 548 for(i = 1; i < argc; i++) {
487 while((arg = getopt(argc, argv, opts_str)) != EOF) { 549 while((arg = getopt(argc, argv, opts_str)) != EOF) {
@@ -490,7 +552,7 @@ main(int argc, char **argv)
490 debug++; 552 debug++;
491 break; 553 break;
492 case 'b': 554 case 'b':
493 size = (unsigned short)strtol(optarg,NULL,0); 555 size = strtol(optarg,NULL,0);
494 if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) && 556 if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) &&
495 size < MAX_PING_DATA) { 557 size < MAX_PING_DATA) {
496 icmp_data_size = size; 558 icmp_data_size = size;
@@ -545,6 +607,49 @@ main(int argc, char **argv)
545 print_help (); 607 print_help ();
546 exit (STATE_UNKNOWN); 608 exit (STATE_UNKNOWN);
547 break; 609 break;
610 case 'R': /* RTA mode */
611 err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_rta_mode);
612 if (!err) {
613 crash("Failed to parse RTA threshold");
614 }
615
616 rta_mode=true;
617 break;
618 case 'P': /* packet loss mode */
619 err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_packet_loss_mode);
620 if (!err) {
621 crash("Failed to parse packet loss threshold");
622 }
623
624 pl_mode=true;
625 break;
626 case 'J': /* jitter mode */
627 err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_jitter_mode);
628 if (!err) {
629 crash("Failed to parse jitter threshold");
630 }
631
632 jitter_mode=true;
633 break;
634 case 'M': /* MOS mode */
635 err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_mos_mode);
636 if (!err) {
637 crash("Failed to parse MOS threshold");
638 }
639
640 mos_mode=true;
641 break;
642 case 'S': /* score mode */
643 err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_score_mode);
644 if (!err) {
645 crash("Failed to parse score threshold");
646 }
647
648 score_mode=true;
649 break;
650 case 'O': /* out of order mode */
651 order_mode=true;
652 break;
548 } 653 }
549 } 654 }
550 } 655 }
@@ -565,10 +670,10 @@ main(int argc, char **argv)
565 add_target(*argv); 670 add_target(*argv);
566 argv++; 671 argv++;
567 } 672 }
673
568 if(!targets) { 674 if(!targets) {
569 errno = 0; 675 errno = 0;
570 crash("No hosts to check"); 676 crash("No hosts to check");
571 exit(3);
572 } 677 }
573 678
574 // add_target might change address_family 679 // add_target might change address_family
@@ -631,11 +736,25 @@ main(int argc, char **argv)
631 if(warn.pl > crit.pl) warn.pl = crit.pl; 736 if(warn.pl > crit.pl) warn.pl = crit.pl;
632 if(warn.rta > crit.rta) warn.rta = crit.rta; 737 if(warn.rta > crit.rta) warn.rta = crit.rta;
633 if(warn_down > crit_down) crit_down = warn_down; 738 if(warn_down > crit_down) crit_down = warn_down;
634 739 if(warn.jitter > crit.jitter) crit.jitter = warn.jitter;
740 if(warn.mos < crit.mos) warn.mos = crit.mos;
741 if(warn.score < crit.score) warn.score = crit.score;
742
743#ifdef HAVE_SIGACTION
744 sig_action.sa_sigaction = NULL;
745 sig_action.sa_handler = finish;
746 sigfillset(&sig_action.sa_mask);
747 sig_action.sa_flags = SA_NODEFER|SA_RESTART;
748 sigaction(SIGINT, &sig_action, NULL);
749 sigaction(SIGHUP, &sig_action, NULL);
750 sigaction(SIGTERM, &sig_action, NULL);
751 sigaction(SIGALRM, &sig_action, NULL);
752#else /* HAVE_SIGACTION */
635 signal(SIGINT, finish); 753 signal(SIGINT, finish);
636 signal(SIGHUP, finish); 754 signal(SIGHUP, finish);
637 signal(SIGTERM, finish); 755 signal(SIGTERM, finish);
638 signal(SIGALRM, finish); 756 signal(SIGALRM, finish);
757#endif /* HAVE_SIGACTION */
639 if(debug) printf("Setting alarm timeout to %u seconds\n", timeout); 758 if(debug) printf("Setting alarm timeout to %u seconds\n", timeout);
640 alarm(timeout); 759 alarm(timeout);
641 760
@@ -685,7 +804,11 @@ main(int argc, char **argv)
685 } 804 }
686 805
687 host = list; 806 host = list;
688 table = (struct rta_host**)malloc(sizeof(struct rta_host **) * targets); 807 table = malloc(sizeof(struct rta_host *) * targets);
808 if(!table) {
809 crash("main(): malloc failed for host table");
810 }
811
689 i = 0; 812 i = 0;
690 while(host) { 813 while(host) {
691 host->id = i*packets; 814 host->id = i*packets;
@@ -772,6 +895,7 @@ wait_for_reply(int sock, u_int t)
772 struct icmp_ping_data data; 895 struct icmp_ping_data data;
773 struct timeval wait_start, now; 896 struct timeval wait_start, now;
774 u_int tdiff, i, per_pkt_wait; 897 u_int tdiff, i, per_pkt_wait;
898 double jitter_tmp;
775 899
776 if (!(packet.buf = malloc(icmp_pkt_size))) { 900 if (!(packet.buf = malloc(icmp_pkt_size))) {
777 crash("send_icmp_ping(): failed to malloc %d bytes for send buffer", 901 crash("send_icmp_ping(): failed to malloc %d bytes for send buffer",
@@ -890,12 +1014,44 @@ wait_for_reply(int sock, u_int t)
890 1014
891 tdiff = get_timevaldiff(&data.stime, &now); 1015 tdiff = get_timevaldiff(&data.stime, &now);
892 1016
1017 if (host->last_tdiff>0) {
1018 /* Calculate jitter */
1019 if (host->last_tdiff > tdiff) {
1020 jitter_tmp = host->last_tdiff - tdiff;
1021 } else {
1022 jitter_tmp = tdiff - host->last_tdiff;
1023 }
1024
1025 if (host->jitter==0) {
1026 host->jitter=jitter_tmp;
1027 host->jitter_max=jitter_tmp;
1028 host->jitter_min=jitter_tmp;
1029 } else {
1030 host->jitter+=jitter_tmp;
1031
1032 if (jitter_tmp < host->jitter_min) {
1033 host->jitter_min=jitter_tmp;
1034 }
1035
1036 if (jitter_tmp > host->jitter_max) {
1037 host->jitter_max=jitter_tmp;
1038 }
1039 }
1040
1041 /* Check if packets in order */
1042 if (host->last_icmp_seq >= packet.icp->icmp_seq)
1043 host->order_status=STATE_CRITICAL;
1044 }
1045 host->last_tdiff=tdiff;
1046
1047 host->last_icmp_seq=packet.icp->icmp_seq;
1048
893 host->time_waited += tdiff; 1049 host->time_waited += tdiff;
894 host->icmp_recv++; 1050 host->icmp_recv++;
895 icmp_recv++; 1051 icmp_recv++;
896 if (tdiff > host->rtmax) 1052 if (tdiff > (unsigned int)host->rtmax)
897 host->rtmax = tdiff; 1053 host->rtmax = tdiff;
898 if (tdiff < host->rtmin) 1054 if (tdiff < (unsigned int)host->rtmin)
899 host->rtmin = tdiff; 1055 host->rtmin = tdiff;
900 1056
901 if(debug) { 1057 if(debug) {
@@ -1056,7 +1212,9 @@ recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr,
1056 int n, ret; 1212 int n, ret;
1057 struct timeval to, then, now; 1213 struct timeval to, then, now;
1058 fd_set rd, wr; 1214 fd_set rd, wr;
1215#ifdef HAVE_MSGHDR_MSG_CONTROL
1059 char ans_data[4096]; 1216 char ans_data[4096];
1217#endif // HAVE_MSGHDR_MSG_CONTROL
1060 struct msghdr hdr; 1218 struct msghdr hdr;
1061 struct iovec iov; 1219 struct iovec iov;
1062#ifdef SO_TIMESTAMP 1220#ifdef SO_TIMESTAMP
@@ -1094,8 +1252,10 @@ recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr,
1094 hdr.msg_namelen = slen; 1252 hdr.msg_namelen = slen;
1095 hdr.msg_iov = &iov; 1253 hdr.msg_iov = &iov;
1096 hdr.msg_iovlen = 1; 1254 hdr.msg_iovlen = 1;
1255#ifdef HAVE_MSGHDR_MSG_CONTROL
1097 hdr.msg_control = ans_data; 1256 hdr.msg_control = ans_data;
1098 hdr.msg_controllen = sizeof(ans_data); 1257 hdr.msg_controllen = sizeof(ans_data);
1258#endif
1099 1259
1100 ret = recvmsg(sock, &hdr, 0); 1260 ret = recvmsg(sock, &hdr, 0);
1101#ifdef SO_TIMESTAMP 1261#ifdef SO_TIMESTAMP
@@ -1125,6 +1285,8 @@ finish(int sig)
1125 {"OK", "WARNING", "CRITICAL", "UNKNOWN", "DEPENDENT"}; 1285 {"OK", "WARNING", "CRITICAL", "UNKNOWN", "DEPENDENT"};
1126 int hosts_ok = 0; 1286 int hosts_ok = 0;
1127 int hosts_warn = 0; 1287 int hosts_warn = 0;
1288 int this_status;
1289 double R;
1128 1290
1129 alarm(0); 1291 alarm(0);
1130 if(debug > 1) printf("finish(%d) called\n", sig); 1292 if(debug > 1) printf("finish(%d) called\n", sig);
@@ -1140,9 +1302,12 @@ finish(int sig)
1140 } 1302 }
1141 1303
1142 /* iterate thrice to calculate values, give output, and print perfparse */ 1304 /* iterate thrice to calculate values, give output, and print perfparse */
1305 status=STATE_OK;
1143 host = list; 1306 host = list;
1144 1307
1145 while(host) { 1308 while(host) {
1309 this_status = STATE_OK;
1310
1146 if(!host->icmp_recv) { 1311 if(!host->icmp_recv) {
1147 /* rta 0 is ofcourse not entirely correct, but will still show up 1312 /* rta 0 is ofcourse not entirely correct, but will still show up
1148 * conspicuously as missing entries in perfparse and cacti */ 1313 * conspicuously as missing entries in perfparse and cacti */
@@ -1151,26 +1316,138 @@ finish(int sig)
1151 status = STATE_CRITICAL; 1316 status = STATE_CRITICAL;
1152 /* up the down counter if not already counted */ 1317 /* up the down counter if not already counted */
1153 if(!(host->flags & FLAG_LOST_CAUSE) && targets_alive) targets_down++; 1318 if(!(host->flags & FLAG_LOST_CAUSE) && targets_alive) targets_down++;
1154 } 1319 } else {
1155 else {
1156 pl = ((host->icmp_sent - host->icmp_recv) * 100) / host->icmp_sent; 1320 pl = ((host->icmp_sent - host->icmp_recv) * 100) / host->icmp_sent;
1157 rta = (double)host->time_waited / host->icmp_recv; 1321 rta = (double)host->time_waited / host->icmp_recv;
1158 } 1322 }
1323
1324 if (host->icmp_recv>1) {
1325 /*
1326 * This algorithm is probably pretty much blindly copied from
1327 * locations like this one: https://www.slac.stanford.edu/comp/net/wan-mon/tutorial.html#mos
1328 * It calculates a MOS value (range of 1 to 5, where 1 is bad and 5 really good).
1329 * According to some quick research MOS originates from the Audio/Video transport network area.
1330 * Whether it can and should be computed from ICMP data, I can not say.
1331 *
1332 * Anyway the basic idea is to map a value "R" with a range of 0-100 to the MOS value
1333 *
1334 * MOS stands likely for Mean Opinion Score ( https://en.wikipedia.org/wiki/Mean_Opinion_Score )
1335 *
1336 * More links:
1337 * - https://confluence.slac.stanford.edu/display/IEPM/MOS
1338 */
1339 host->jitter=(host->jitter / (host->icmp_recv - 1)/1000);
1340
1341 /*
1342 * Take the average round trip latency (in milliseconds), add
1343 * round trip jitter, but double the impact to latency
1344 * then add 10 for protocol latencies (in milliseconds).
1345 */
1346 host->EffectiveLatency = (rta/1000) + host->jitter * 2 + 10;
1347
1348 if (host->EffectiveLatency < 160) {
1349 R = 93.2 - (host->EffectiveLatency / 40);
1350 } else {
1351 R = 93.2 - ((host->EffectiveLatency - 120) / 10);
1352 }
1353
1354 // Now, let us deduct 2.5 R values per percentage of packet loss (i.e. a
1355 // loss of 5% will be entered as 5).
1356 R = R - (pl * 2.5);
1357
1358 if (R < 0) {
1359 R = 0;
1360 }
1361
1362 host->score = R;
1363 host->mos= 1 + ((0.035) * R) + ((.000007) * R * (R-60) * (100-R));
1364 } else {
1365 host->jitter=0;
1366 host->jitter_min=0;
1367 host->jitter_max=0;
1368 host->mos=0;
1369 }
1370
1159 host->pl = pl; 1371 host->pl = pl;
1160 host->rta = rta; 1372 host->rta = rta;
1161 if(pl >= crit.pl || rta >= crit.rta) { 1373
1162 status = STATE_CRITICAL; 1374 /* if no new mode selected, use old schema */
1375 if (!rta_mode && !pl_mode && !jitter_mode && !score_mode && !mos_mode && !order_mode) {
1376 rta_mode = true;
1377 pl_mode = true;
1163 } 1378 }
1164 else if(!status && (pl >= warn.pl || rta >= warn.rta)) { 1379
1165 status = STATE_WARNING; 1380 /* Check which mode is on and do the warn / Crit stuff */
1166 hosts_warn++; 1381 if (rta_mode) {
1382 if(rta >= crit.rta) {
1383 this_status = STATE_CRITICAL;
1384 status = STATE_CRITICAL;
1385 host->rta_status=STATE_CRITICAL;
1386 } else if(status!=STATE_CRITICAL && (rta >= warn.rta)) {
1387 this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
1388 status = STATE_WARNING;
1389 host->rta_status=STATE_WARNING;
1390 }
1391 }
1392
1393 if (pl_mode) {
1394 if(pl >= crit.pl) {
1395 this_status = STATE_CRITICAL;
1396 status = STATE_CRITICAL;
1397 host->pl_status=STATE_CRITICAL;
1398 } else if(status!=STATE_CRITICAL && (pl >= warn.pl)) {
1399 this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
1400 status = STATE_WARNING;
1401 host->pl_status=STATE_WARNING;
1402 }
1403 }
1404
1405 if (jitter_mode) {
1406 if(host->jitter >= crit.jitter) {
1407 this_status = STATE_CRITICAL;
1408 status = STATE_CRITICAL;
1409 host->jitter_status=STATE_CRITICAL;
1410 } else if(status!=STATE_CRITICAL && (host->jitter >= warn.jitter)) {
1411 this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
1412 status = STATE_WARNING;
1413 host->jitter_status=STATE_WARNING;
1414 }
1415 }
1416
1417 if (mos_mode) {
1418 if(host->mos <= crit.mos) {
1419 this_status = STATE_CRITICAL;
1420 status = STATE_CRITICAL;
1421 host->mos_status=STATE_CRITICAL;
1422 } else if(status!=STATE_CRITICAL && (host->mos <= warn.mos)) {
1423 this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
1424 status = STATE_WARNING;
1425 host->mos_status=STATE_WARNING;
1426 }
1427 }
1428
1429 if (score_mode) {
1430 if(host->score <= crit.score) {
1431 this_status = STATE_CRITICAL;
1432 status = STATE_CRITICAL;
1433 host->score_status=STATE_CRITICAL;
1434 } else if(status!=STATE_CRITICAL && (host->score <= warn.score)) {
1435 this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
1436 status = STATE_WARNING;
1437 host->score_status=STATE_WARNING;
1438 }
1167 } 1439 }
1168 else { 1440
1441 if (this_status == STATE_WARNING) {
1442 hosts_warn++;
1443 } else if (this_status == STATE_OK) {
1169 hosts_ok++; 1444 hosts_ok++;
1170 } 1445 }
1171 1446
1172 host = host->next; 1447 host = host->next;
1173 } 1448 }
1449
1450
1174 /* this is inevitable */ 1451 /* this is inevitable */
1175 if(!targets_alive) status = STATE_CRITICAL; 1452 if(!targets_alive) status = STATE_CRITICAL;
1176 if(min_hosts_alive > -1) { 1453 if(min_hosts_alive > -1) {
@@ -1181,6 +1458,7 @@ finish(int sig)
1181 1458
1182 host = list; 1459 host = list;
1183 while(host) { 1460 while(host) {
1461
1184 if(debug) puts(""); 1462 if(debug) puts("");
1185 if(i) { 1463 if(i) {
1186 if(i < targets) printf(" :: "); 1464 if(i < targets) printf(" :: ");
@@ -1189,6 +1467,8 @@ finish(int sig)
1189 i++; 1467 i++;
1190 if(!host->icmp_recv) { 1468 if(!host->icmp_recv) {
1191 status = STATE_CRITICAL; 1469 status = STATE_CRITICAL;
1470 host->rtmin=0;
1471 host->jitter_min=0;
1192 if(host->flags & FLAG_LOST_CAUSE) { 1472 if(host->flags & FLAG_LOST_CAUSE) {
1193 char address[INET6_ADDRSTRLEN]; 1473 char address[INET6_ADDRSTRLEN];
1194 parse_address(&host->error_addr, address, sizeof(address)); 1474 parse_address(&host->error_addr, address, sizeof(address));
@@ -1197,31 +1477,137 @@ finish(int sig)
1197 get_icmp_error_msg(host->icmp_type, host->icmp_code), 1477 get_icmp_error_msg(host->icmp_type, host->icmp_code),
1198 address, 1478 address,
1199 100); 1479 100);
1200 } 1480 } else { /* not marked as lost cause, so we have no flags for it */
1201 else { /* not marked as lost cause, so we have no flags for it */
1202 printf("%s: rta nan, lost 100%%", host->name); 1481 printf("%s: rta nan, lost 100%%", host->name);
1203 } 1482 }
1483 } else { /* !icmp_recv */
1484 printf("%s", host->name);
1485 /* rta text output */
1486 if (rta_mode) {
1487 if (status == STATE_OK)
1488 printf(" rta %0.3fms", host->rta / 1000);
1489 else if (status==STATE_WARNING && host->rta_status==status)
1490 printf(" rta %0.3fms > %0.3fms", (float)host->rta / 1000, (float)warn.rta/1000);
1491 else if (status==STATE_CRITICAL && host->rta_status==status)
1492 printf(" rta %0.3fms > %0.3fms", (float)host->rta / 1000, (float)crit.rta/1000);
1493 }
1494 /* pl text output */
1495 if (pl_mode) {
1496 if (status == STATE_OK)
1497 printf(" lost %u%%", host->pl);
1498 else if (status==STATE_WARNING && host->pl_status==status)
1499 printf(" lost %u%% > %u%%", host->pl, warn.pl);
1500 else if (status==STATE_CRITICAL && host->pl_status==status)
1501 printf(" lost %u%% > %u%%", host->pl, crit.pl);
1502 }
1503 /* jitter text output */
1504 if (jitter_mode) {
1505 if (status == STATE_OK)
1506 printf(" jitter %0.3fms", (float)host->jitter);
1507 else if (status==STATE_WARNING && host->jitter_status==status)
1508 printf(" jitter %0.3fms > %0.3fms", (float)host->jitter, warn.jitter);
1509 else if (status==STATE_CRITICAL && host->jitter_status==status)
1510 printf(" jitter %0.3fms > %0.3fms", (float)host->jitter, crit.jitter);
1511 }
1512 /* mos text output */
1513 if (mos_mode) {
1514 if (status == STATE_OK)
1515 printf(" MOS %0.1f", (float)host->mos);
1516 else if (status==STATE_WARNING && host->mos_status==status)
1517 printf(" MOS %0.1f < %0.1f", (float)host->mos, (float)warn.mos);
1518 else if (status==STATE_CRITICAL && host->mos_status==status)
1519 printf(" MOS %0.1f < %0.1f", (float)host->mos, (float)crit.mos);
1520 }
1521 /* score text output */
1522 if (score_mode) {
1523 if (status == STATE_OK)
1524 printf(" Score %u", (int)host->score);
1525 else if (status==STATE_WARNING && host->score_status==status )
1526 printf(" Score %u < %u", (int)host->score, (int)warn.score);
1527 else if (status==STATE_CRITICAL && host->score_status==status )
1528 printf(" Score %u < %u", (int)host->score, (int)crit.score);
1529 }
1530 /* order statis text output */
1531 if (order_mode) {
1532 if (status == STATE_OK)
1533 printf(" Packets in order");
1534 else if (status==STATE_CRITICAL && host->order_status==status)
1535 printf(" Packets out of order");
1536 }
1204 } 1537 }
1205 else { /* !icmp_recv */
1206 printf("%s: rta %0.3fms, lost %u%%",
1207 host->name, host->rta / 1000, host->pl);
1208 }
1209
1210 host = host->next; 1538 host = host->next;
1211 } 1539 }
1212 1540
1213 /* iterate once more for pretty perfparse output */ 1541 /* iterate once more for pretty perfparse output */
1214 printf("|"); 1542 if (!(!rta_mode && !pl_mode && !jitter_mode && !score_mode && !mos_mode && order_mode)) {
1543 printf("|");
1544 }
1215 i = 0; 1545 i = 0;
1216 host = list; 1546 host = list;
1217 while(host) { 1547 while(host) {
1218 if(debug) puts(""); 1548 if(debug) puts("");
1219 printf("%srta=%0.3fms;%0.3f;%0.3f;0; %spl=%u%%;%u;%u;; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ", 1549
1220 (targets > 1) ? host->name : "", 1550 if (rta_mode) {
1221 host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000, 1551 if (host->pl<100) {
1222 (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl, 1552 printf("%srta=%0.3fms;%0.3f;%0.3f;0; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ",
1223 (targets > 1) ? host->name : "", (float)host->rtmax / 1000, 1553 (targets > 1) ? host->name : "",
1224 (targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0); 1554 host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000,
1555 (targets > 1) ? host->name : "", (float)host->rtmax / 1000,
1556 (targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0);
1557 } else {
1558 printf("%srta=U;;;; %srtmax=U;;;; %srtmin=U;;;; ",
1559 (targets > 1) ? host->name : "",
1560 (targets > 1) ? host->name : "",
1561 (targets > 1) ? host->name : "");
1562 }
1563 }
1564
1565 if (pl_mode) {
1566 printf("%spl=%u%%;%u;%u;0;100 ", (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl);
1567 }
1568
1569 if (jitter_mode) {
1570 if (host->pl<100) {
1571 printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; %sjitter_min=%0.3fms;;;; ",
1572 (targets > 1) ? host->name : "",
1573 (float)host->jitter,
1574 (float)warn.jitter,
1575 (float)crit.jitter,
1576 (targets > 1) ? host->name : "",
1577 (float)host->jitter_max / 1000, (targets > 1) ? host->name : "",
1578 (float)host->jitter_min / 1000
1579 );
1580 } else {
1581 printf("%sjitter_avg=U;;;; %sjitter_max=U;;;; %sjitter_min=U;;;; ",
1582 (targets > 1) ? host->name : "",
1583 (targets > 1) ? host->name : "",
1584 (targets > 1) ? host->name : "");
1585 }
1586 }
1587
1588 if (mos_mode) {
1589 if (host->pl<100) {
1590 printf("%smos=%0.1f;%0.1f;%0.1f;0;5 ",
1591 (targets > 1) ? host->name : "",
1592 (float)host->mos,
1593 (float)warn.mos,
1594 (float)crit.mos);
1595 } else {
1596 printf("%smos=U;;;; ", (targets > 1) ? host->name : "");
1597 }
1598 }
1599
1600 if (score_mode) {
1601 if (host->pl<100) {
1602 printf("%sscore=%u;%u;%u;0;100 ",
1603 (targets > 1) ? host->name : "",
1604 (int)host->score,
1605 (int)warn.score,
1606 (int)crit.score);
1607 } else {
1608 printf("%sscore=U;;;; ", (targets > 1) ? host->name : "");
1609 }
1610 }
1225 1611
1226 host = host->next; 1612 host = host->next;
1227 } 1613 }
@@ -1312,6 +1698,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in)
1312 /* set the values. use calling name for output */ 1698 /* set the values. use calling name for output */
1313 host->name = strdup(arg); 1699 host->name = strdup(arg);
1314 1700
1701
1315 /* fill out the sockaddr_storage struct */ 1702 /* fill out the sockaddr_storage struct */
1316 if(address_family == AF_INET) { 1703 if(address_family == AF_INET) {
1317 host_sin = (struct sockaddr_in *)&host->saddr_in; 1704 host_sin = (struct sockaddr_in *)&host->saddr_in;
@@ -1324,7 +1711,22 @@ add_target_ip(char *arg, struct sockaddr_storage *in)
1324 memcpy(host_sin6->sin6_addr.s6_addr, sin6->sin6_addr.s6_addr, sizeof host_sin6->sin6_addr.s6_addr); 1711 memcpy(host_sin6->sin6_addr.s6_addr, sin6->sin6_addr.s6_addr, sizeof host_sin6->sin6_addr.s6_addr);
1325 } 1712 }
1326 1713
1714 /* fill out the sockaddr_in struct */
1327 host->rtmin = INFINITY; 1715 host->rtmin = INFINITY;
1716 host->rtmax = 0;
1717 host->jitter=0;
1718 host->jitter_max=0;
1719 host->jitter_min=INFINITY;
1720 host->last_tdiff=0;
1721 host->order_status=STATE_OK;
1722 host->last_icmp_seq=0;
1723 host->rta_status=0;
1724 host->pl_status=0;
1725 host->jitter_status=0;
1726 host->mos_status=0;
1727 host->score_status=0;
1728 host->pl_status=0;
1729
1328 1730
1329 if(!list) list = cursor = host; 1731 if(!list) list = cursor = host;
1330 else cursor->next = host; 1732 else cursor->next = host;
@@ -1408,7 +1810,7 @@ add_target(char *arg)
1408 } 1810 }
1409 break; 1811 break;
1410 } 1812 }
1411 freeaddrinfo(res); 1813 freeaddrinfo(res);
1412 1814
1413 return 0; 1815 return 0;
1414} 1816}
@@ -1472,7 +1874,7 @@ get_timevar(const char *str)
1472 1874
1473 /* unit might be given as ms|m (millisec), 1875 /* unit might be given as ms|m (millisec),
1474 * us|u (microsec) or just plain s, for seconds */ 1876 * us|u (microsec) or just plain s, for seconds */
1475 u = p = '\0'; 1877 p = '\0';
1476 u = str[len - 1]; 1878 u = str[len - 1];
1477 if(len >= 2 && !isdigit((int)str[len - 2])) p = str[len - 2]; 1879 if(len >= 2 && !isdigit((int)str[len - 2])) p = str[len - 2];
1478 if(p && u == 's') u = p; 1880 if(p && u == 's') u = p;
@@ -1530,6 +1932,81 @@ get_threshold(char *str, threshold *th)
1530 return 0; 1932 return 0;
1531} 1933}
1532 1934
1935/*
1936 * This functions receives a pointer to a string which should contain a threshold for the
1937 * rta, packet_loss, jitter, mos or score mode in the form number,number[m|%]* assigns the
1938 * parsed number to the corresponding threshold variable.
1939 * @param[in,out] str String containing the given threshold values
1940 * @param[in] length strlen(str)
1941 * @param[out] warn Pointer to the warn threshold struct to which the values should be assigned
1942 * @param[out] crit Pointer to the crit threshold struct to which the values should be assigned
1943 * @param[in] mode Determines whether this a threshold for rta, packet_loss, jitter, mos or score (exclusively)
1944 */
1945static bool get_threshold2(char *str, size_t length, threshold *warn, threshold *crit, threshold_mode mode) {
1946 if (!str || !length || !warn || !crit) return false;
1947
1948
1949 // p points to the last char in str
1950 char *p = &str[length - 1];
1951
1952 // first_iteration is bof-stop on stupid libc's
1953 bool first_iteration = true;
1954
1955 while(p != &str[0]) {
1956 if( (*p == 'm') || (*p == '%') ) {
1957 *p = '\0';
1958 } else if(*p == ',' && !first_iteration) {
1959 *p = '\0'; /* reset it so get_timevar(str) works nicely later */
1960
1961 char *start_of_value = p + 1;
1962
1963 if (!parse_threshold2_helper(start_of_value, strlen(start_of_value), crit, mode)){
1964 return false;
1965 }
1966
1967 }
1968 first_iteration = false;
1969 p--;
1970 }
1971
1972 return parse_threshold2_helper(p, strlen(p), warn, mode);
1973}
1974
1975static bool parse_threshold2_helper(char *s, size_t length, threshold *thr, threshold_mode mode) {
1976 char *resultChecker = {0};
1977
1978 switch (mode) {
1979 case const_rta_mode:
1980 thr->rta = strtod(s, &resultChecker) * 1000;
1981 break;
1982 case const_packet_loss_mode:
1983 thr->pl = (unsigned char)strtoul(s, &resultChecker, 0);
1984 break;
1985 case const_jitter_mode:
1986 thr->jitter = strtod(s, &resultChecker);
1987
1988 break;
1989 case const_mos_mode:
1990 thr->mos = strtod(s, &resultChecker);
1991 break;
1992 case const_score_mode:
1993 thr->score = strtod(s, &resultChecker);
1994 break;
1995 }
1996
1997 if (resultChecker == s) {
1998 // Failed to parse
1999 return false;
2000 }
2001
2002 if (resultChecker != (s + length)) {
2003 // Trailing symbols
2004 return false;
2005 }
2006
2007 return true;
2008}
2009
1533unsigned short 2010unsigned short
1534icmp_checksum(uint16_t *p, size_t n) 2011icmp_checksum(uint16_t *p, size_t n)
1535{ 2012{
@@ -1555,74 +2032,91 @@ icmp_checksum(uint16_t *p, size_t n)
1555void 2032void
1556print_help(void) 2033print_help(void)
1557{ 2034{
1558 2035 /*print_revision (progname);*/ /* FIXME: Why? */
1559 /*print_revision (progname);*/ /* FIXME: Why? */ 2036 printf ("Copyright (c) 2005 Andreas Ericsson <ae@op5.se>\n");
1560 2037
1561 printf ("Copyright (c) 2005 Andreas Ericsson <ae@op5.se>\n"); 2038 printf (COPYRIGHT, copyright, email);
1562 printf (COPYRIGHT, copyright, email); 2039
1563 2040 printf ("\n\n");
1564 printf ("\n\n"); 2041
1565 2042 print_usage ();
1566 print_usage (); 2043
1567 2044 printf (UT_HELP_VRSN);
1568 printf (UT_HELP_VRSN); 2045 printf (UT_EXTRA_OPTS);
1569 printf (UT_EXTRA_OPTS); 2046
1570 2047 printf (" %s\n", "-H");
1571 printf (" %s\n", "-H"); 2048 printf (" %s\n", _("specify a target"));
1572 printf (" %s\n", _("specify a target")); 2049 printf (" %s\n", "[-4|-6]");
1573 printf (" %s\n", "[-4|-6]"); 2050 printf (" %s\n", _("Use IPv4 (default) or IPv6 to communicate with the targets"));
1574 printf (" %s\n", _("Use IPv4 (default) or IPv6 to communicate with the targets")); 2051 printf (" %s\n", "-w");
1575 printf (" %s\n", "-w"); 2052 printf (" %s", _("warning threshold (currently "));
1576 printf (" %s", _("warning threshold (currently ")); 2053 printf ("%0.3fms,%u%%)\n", (float)warn.rta / 1000, warn.pl);
1577 printf ("%0.3fms,%u%%)\n", (float)warn.rta / 1000, warn.pl); 2054 printf (" %s\n", "-c");
1578 printf (" %s\n", "-c"); 2055 printf (" %s", _("critical threshold (currently "));
1579 printf (" %s", _("critical threshold (currently ")); 2056 printf ("%0.3fms,%u%%)\n", (float)crit.rta / 1000, crit.pl);
1580 printf ("%0.3fms,%u%%)\n", (float)crit.rta / 1000, crit.pl); 2057
1581 printf (" %s\n", "-s"); 2058 printf (" %s\n", "-R");
1582 printf (" %s\n", _("specify a source IP address or device name")); 2059 printf (" %s\n", _("RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms"));
1583 printf (" %s\n", "-n"); 2060 printf (" %s\n", "-P");
1584 printf (" %s", _("number of packets to send (currently ")); 2061 printf (" %s\n", _("packet loss mode, ex. 40%,50% , unit in %"));
1585 printf ("%u)\n",packets); 2062 printf (" %s\n", "-J");
1586 printf (" %s\n", "-i"); 2063 printf (" %s\n", _("jitter mode warning,critical, ex. 40.000ms,50.000ms , unit in ms "));
1587 printf (" %s", _("max packet interval (currently ")); 2064 printf (" %s\n", "-M");
1588 printf ("%0.3fms)\n",(float)pkt_interval / 1000); 2065 printf (" %s\n", _("MOS mode, between 0 and 4.4 warning,critical, ex. 3.5,3.0"));
1589 printf (" %s\n", "-I"); 2066 printf (" %s\n", "-S");
1590 printf (" %s", _("max target interval (currently ")); 2067 printf (" %s\n", _("score mode, max value 100 warning,critical, ex. 80,70 "));
1591 printf ("%0.3fms)\n", (float)target_interval / 1000); 2068 printf (" %s\n", "-O");
1592 printf (" %s\n", "-m"); 2069 printf (" %s\n", _("detect out of order ICMP packts "));
1593 printf (" %s",_("number of alive hosts required for success")); 2070 printf (" %s\n", "-H");
1594 printf ("\n"); 2071 printf (" %s\n", _("specify a target"));
1595 printf (" %s\n", "-l"); 2072 printf (" %s\n", "-s");
1596 printf (" %s", _("TTL on outgoing packets (currently ")); 2073 printf (" %s\n", _("specify a source IP address or device name"));
1597 printf ("%u)\n", ttl); 2074 printf (" %s\n", "-n");
1598 printf (" %s\n", "-t"); 2075 printf (" %s", _("number of packets to send (currently "));
1599 printf (" %s",_("timeout value (seconds, currently ")); 2076 printf ("%u)\n",packets);
1600 printf ("%u)\n", timeout); 2077 printf (" %s\n", "-p");
1601 printf (" %s\n", "-b"); 2078 printf (" %s", _("number of packets to send (currently "));
1602 printf (" %s\n", _("Number of icmp data bytes to send")); 2079 printf ("%u)\n",packets);
1603 printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); 2080 printf (" %s\n", "-i");
1604 printf (" %s\n", "-v"); 2081 printf (" %s", _("max packet interval (currently "));
1605 printf (" %s\n", _("verbose")); 2082 printf ("%0.3fms)\n",(float)pkt_interval / 1000);
1606 2083 printf (" %s\n", "-I");
1607 printf ("\n"); 2084 printf (" %s", _("max target interval (currently "));
1608 printf ("%s\n", _("Notes:")); 2085 printf ("%0.3fms)\n", (float)target_interval / 1000);
1609 printf (" %s\n", _("The -H switch is optional. Naming a host (or several) to check is not.")); 2086 printf (" %s\n", "-m");
1610 printf ("\n"); 2087 printf (" %s",_("number of alive hosts required for success"));
1611 printf (" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%")); 2088 printf ("\n");
1612 printf (" %s\n", _("packet loss. The default values should work well for most users.")); 2089 printf (" %s\n", "-l");
1613 printf (" %s\n", _("You can specify different RTA factors using the standardized abbreviations")); 2090 printf (" %s", _("TTL on outgoing packets (currently "));
1614 printf (" %s\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds.")); 2091 printf ("%u)\n", ttl);
1615/* -d not yet implemented */ 2092 printf (" %s\n", "-t");
1616/* printf ("%s\n", _("Threshold format for -d is warn,crit. 12,14 means WARNING if >= 12 hops")); 2093 printf (" %s",_("timeout value (seconds, currently "));
1617 printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent.")); 2094 printf ("%u)\n", timeout);
1618 printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/ 2095 printf (" %s\n", "-b");
1619 printf ("\n"); 2096 printf (" %s\n", _("Number of icmp data bytes to send"));
1620 printf (" %s\n", _("The -v switch can be specified several times for increased verbosity.")); 2097 printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN);
1621/* printf ("%s\n", _("Long options are currently unsupported.")); 2098 printf (" %s\n", "-v");
1622 printf ("%s\n", _("Options marked with * require an argument")); 2099 printf (" %s\n", _("verbose"));
1623*/ 2100 printf ("\n");
1624 2101 printf ("%s\n", _("Notes:"));
1625 printf (UT_SUPPORT); 2102 printf (" %s\n", _("If none of R,P,J,M,S or O is specified, default behavior is -R -P"));
2103 printf (" %s\n", _("The -H switch is optional. Naming a host (or several) to check is not."));
2104 printf ("\n");
2105 printf (" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"));
2106 printf (" %s\n", _("packet loss. The default values should work well for most users."));
2107 printf (" %s\n", _("You can specify different RTA factors using the standardized abbreviations"));
2108 printf (" %s\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds."));
2109 /* -d not yet implemented */
2110 /* printf ("%s\n", _("Threshold format for -d is warn,crit. 12,14 means WARNING if >= 12 hops"));
2111 printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent."));
2112 printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/
2113 printf ("\n");
2114 printf (" %s\n", _("The -v switch can be specified several times for increased verbosity."));
2115 /* printf ("%s\n", _("Long options are currently unsupported."));
2116 printf ("%s\n", _("Options marked with * require an argument"));
2117 */
2118
2119 printf (UT_SUPPORT);
1626} 2120}
1627 2121
1628 2122
@@ -1630,6 +2124,6 @@ print_help(void)
1630void 2124void
1631print_usage (void) 2125print_usage (void)
1632{ 2126{
1633 printf ("%s\n", _("Usage:")); 2127 printf ("%s\n", _("Usage:"));
1634 printf(" %s [options] [-H] host1 host2 hostN\n", progname); 2128 printf(" %s [options] [-H] host1 host2 hostN\n", progname);
1635} 2129}
diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t
index 96addd3..de1d88d 100644
--- a/plugins-root/t/check_icmp.t
+++ b/plugins-root/t/check_icmp.t
@@ -12,14 +12,14 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO",
12 "no" ); 12 "no" );
13 13
14if ($allow_sudo eq "yes" or $> == 0) { 14if ($allow_sudo eq "yes" or $> == 0) {
15 plan tests => 20; 15 plan tests => 40;
16} else { 16} else {
17 plan skip_all => "Need sudo to test check_icmp"; 17 plan skip_all => "Need sudo to test check_icmp";
18} 18}
19my $sudo = $> == 0 ? '' : 'sudo'; 19my $sudo = $> == 0 ? '' : 'sudo';
20 20
21my $successOutput = '/OK - .*?: rta (?:[\d\.]+ms)|(?:nan), lost \d+%/'; 21my $successOutput = '/OK - .*? rta (?:[\d\.]+ms)|(?:nan), lost \d+%/';
22my $failureOutput = '/(WARNING|CRITICAL) - .*?: rta [\d\.]+ms, lost \d%/'; 22my $failureOutput = '/(WARNING|CRITICAL) - .*? rta (?:[\d\.]+ms > [\d\.]+ms|nan)/';
23 23
24my $host_responsive = getTestParameter( "NP_HOST_RESPONSIVE", 24my $host_responsive = getTestParameter( "NP_HOST_RESPONSIVE",
25 "The hostname of system responsive to network requests", 25 "The hostname of system responsive to network requests",
@@ -54,10 +54,11 @@ is( $res->return_code, 2, "Syntax ok, with forced critical" );
54like( $res->output, $failureOutput, "Output OK" ); 54like( $res->output, $failureOutput, "Output OK" );
55 55
56$res = NPTest->testCmd( 56$res = NPTest->testCmd(
57 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100%" 57 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -t 2"
58 ); 58 );
59is( $res->return_code, 2, "Timeout - host nonresponsive" ); 59is( $res->return_code, 2, "Timeout - host nonresponsive" );
60like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" ); 60like( $res->output, '/pl=100%/', "Error contains 'pl=100%' string (for 100% packet loss)" );
61like( $res->output, '/rta=U/', "Error contains 'rta=U' string" );
61 62
62$res = NPTest->testCmd( 63$res = NPTest->testCmd(
63 "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%" 64 "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%"
@@ -66,13 +67,13 @@ is( $res->return_code, 3, "No hostname" );
66like( $res->output, '/No hosts to check/', "Output with appropriate error message"); 67like( $res->output, '/No hosts to check/', "Output with appropriate error message");
67 68
68$res = NPTest->testCmd( 69$res = NPTest->testCmd(
69 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 0" 70 "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 0 -t 2"
70 ); 71 );
71is( $res->return_code, 0, "One host nonresponsive - zero required" ); 72is( $res->return_code, 0, "One host nonresponsive - zero required" );
72like( $res->output, $successOutput, "Output OK" ); 73like( $res->output, $successOutput, "Output OK" );
73 74
74$res = NPTest->testCmd( 75$res = NPTest->testCmd(
75 "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 1" 76 "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 1 -t 2"
76 ); 77 );
77is( $res->return_code, 0, "One of two host nonresponsive - one required" ); 78is( $res->return_code, 0, "One of two host nonresponsive - one required" );
78like( $res->output, $successOutput, "Output OK" ); 79like( $res->output, $successOutput, "Output OK" );
@@ -94,3 +95,49 @@ $res = NPTest->testCmd(
94 ); 95 );
95is( $res->return_code, 0, "Try max packet size" ); 96is( $res->return_code, 0, "Try max packet size" );
96like( $res->output, $successOutput, "Output OK - Didn't overflow" ); 97like( $res->output, $successOutput, "Output OK - Didn't overflow" );
98
99$res = NPTest->testCmd(
100 "$sudo ./check_icmp -H $host_responsive -R 100,100 -n 1 -t 2"
101 );
102is( $res->return_code, 0, "rta works" );
103like( $res->output, $successOutput, "Output OK" );
104$res = NPTest->testCmd(
105 "$sudo ./check_icmp -H $host_responsive -P 80,90 -n 1 -t 2"
106 );
107is( $res->return_code, 0, "pl works" );
108like( $res->output, '/lost 0%/', "Output OK" );
109
110$res = NPTest->testCmd(
111 "$sudo ./check_icmp -H $host_responsive -J 80,90 -t 2"
112 );
113is( $res->return_code, 0, "jitter works" );
114like( $res->output, '/jitter \d/', "Output OK" );
115
116$res = NPTest->testCmd(
117 "$sudo ./check_icmp -H $host_responsive -M 4,3 -t 2"
118 );
119is( $res->return_code, 0, "mos works" );
120like( $res->output, '/MOS \d/', "Output OK" );
121
122$res = NPTest->testCmd(
123 "$sudo ./check_icmp -H $host_responsive -S 80,70 -t 2"
124 );
125is( $res->return_code, 0, "score works" );
126like( $res->output, '/Score \d/', "Output OK" );
127
128$res = NPTest->testCmd(
129 "$sudo ./check_icmp -H $host_responsive -O -t 2"
130 );
131is( $res->return_code, 0, "order works" );
132like( $res->output, '/Packets in order/', "Output OK" );
133
134$res = NPTest->testCmd(
135 "$sudo ./check_icmp -H $host_responsive -O -S 80,70 -M 4,3 -J 80,90 -P 80,90 -R 100,100 -t 2"
136 );
137is( $res->return_code, 0, "order works" );
138like( $res->output, '/Packets in order/', "Output OK" );
139like( $res->output, '/Score \d/', "Output OK" );
140like( $res->output, '/MOS \d/', "Output OK" );
141like( $res->output, '/jitter \d/', "Output OK" );
142like( $res->output, '/lost 0%/', "Output OK" );
143like( $res->output, $successOutput, "Output OK" );
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index f4d33a7..eda8dd4 100644
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -226,7 +226,8 @@ if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
226 my ($total_bytes) = $1 * $2; 226 my ($total_bytes) = $1 * $2;
227 my ($occupied_bytes) = $1 * $2 - $avail_bytes; 227 my ($occupied_bytes) = $1 * $2 - $avail_bytes;
228 my ($avail) = $avail_bytes/1024; 228 my ($avail) = $avail_bytes/1024;
229 my ($capper) = int(($3/$1)*100); 229 my ($capper);
230 if ($1!=0) { $capper = int(($3/$1)*100) } else { $capper=100 };
230 my ($mountpt) = "\\\\$host\\$share"; 231 my ($mountpt) = "\\\\$host\\$share";
231 232
232 # TODO : why is the kB the standard unit for args ? 233 # TODO : why is the kB the standard unit for args ?
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index 84f2022..15a7080 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -40,15 +40,16 @@
40 40
41# ----------------------------------------------------------------[ Require ]-- 41# ----------------------------------------------------------------[ Require ]--
42 42
43require 5.004; 43require 5.14.0;
44 44
45# -------------------------------------------------------------------[ Uses ]-- 45# -------------------------------------------------------------------[ Uses ]--
46 46
47use Socket;
48use strict; 47use strict;
48use IO::Socket::IP;
49use Getopt::Long; 49use Getopt::Long;
50use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); 50use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $opt_4 $opt_6 $verbose);
51use vars qw($PROGNAME); 51use vars qw($PROGNAME);
52use vars qw($ClientSocket);
52use FindBin; 53use FindBin;
53use lib "$FindBin::Bin"; 54use lib "$FindBin::Bin";
54use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 55use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
@@ -58,7 +59,6 @@ use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
58sub print_help (); 59sub print_help ();
59sub print_usage (); 60sub print_usage ();
60sub connection ($$$$); 61sub connection ($$$$);
61sub bindRemote ($$);
62 62
63# -------------------------------------------------------------[ Environment ]-- 63# -------------------------------------------------------------[ Environment ]--
64 64
@@ -104,7 +104,7 @@ sub connection ($$$$)
104 $answer = "Server $in_remotehost has less than 0 users! Something is Really WRONG!\n"; 104 $answer = "Server $in_remotehost has less than 0 users! Something is Really WRONG!\n";
105 } 105 }
106 106
107 print ClientSocket "quit\n"; 107 print $ClientSocket "quit\n";
108 print $answer; 108 print $answer;
109 exit $ERRORS{$state}; 109 exit $ERRORS{$state};
110} 110}
@@ -112,7 +112,7 @@ sub connection ($$$$)
112# ------------------------------------------------------------[ print_usage ]-- 112# ------------------------------------------------------------[ print_usage ]--
113 113
114sub print_usage () { 114sub print_usage () {
115 print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>]\n"; 115 print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>] [ -4|-6 ]\n";
116} 116}
117 117
118# -------------------------------------------------------------[ print_help ]-- 118# -------------------------------------------------------------[ print_help ]--
@@ -135,35 +135,15 @@ Perl Check IRCD plugin for monitoring
135 Number of connected users which generates a critical state (Default: 100) 135 Number of connected users which generates a critical state (Default: 100)
136-p, --port=INTEGER 136-p, --port=INTEGER
137 Port that the ircd daemon is running on <host> (Default: 6667) 137 Port that the ircd daemon is running on <host> (Default: 6667)
138-4, --use-ipv4
139 Use IPv4 connection
140-6, --use-ipv6
141 Use IPv6 connection
138-v, --verbose 142-v, --verbose
139 Print extra debugging information 143 Print extra debugging information
140"; 144";
141} 145}
142 146
143# -------------------------------------------------------------[ bindRemote ]--
144
145sub bindRemote ($$)
146{
147 my ($in_remotehost, $in_remoteport) = @_;
148 my $proto = getprotobyname('tcp');
149 my $sockaddr;
150 my $that;
151 my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost);
152
153 if (!socket(ClientSocket,AF_INET, SOCK_STREAM, $proto)) {
154 print "IRCD UNKNOWN: Could not start socket ($!)\n";
155 exit $ERRORS{"UNKNOWN"};
156 }
157 $sockaddr = 'S n a4 x8';
158 $that = pack($sockaddr, AF_INET, $in_remoteport, $thataddr);
159 if (!connect(ClientSocket, $that)) {
160 print "IRCD UNKNOWN: Could not connect socket ($!)\n";
161 exit $ERRORS{"UNKNOWN"};
162 }
163 select(ClientSocket); $| = 1; select(STDOUT);
164 return \*ClientSocket;
165}
166
167# ===================================================================[ MAIN ]== 147# ===================================================================[ MAIN ]==
168 148
169MAIN: 149MAIN:
@@ -179,6 +159,8 @@ MAIN:
179 "w=i" => \$opt_w, "warning=i" => \$opt_w, 159 "w=i" => \$opt_w, "warning=i" => \$opt_w,
180 "c=i" => \$opt_c, "critical=i" => \$opt_c, 160 "c=i" => \$opt_c, "critical=i" => \$opt_c,
181 "p=i" => \$opt_p, "port=i" => \$opt_p, 161 "p=i" => \$opt_p, "port=i" => \$opt_p,
162 "4" => \$opt_4, "use-ipv4" => \$opt_4,
163 "6" => \$opt_6, "use-ipv6" => \$opt_6,
182 "H=s" => \$opt_H, "hostname=s" => \$opt_H); 164 "H=s" => \$opt_H, "hostname=s" => \$opt_H);
183 165
184 if ($opt_V) { 166 if ($opt_V) {
@@ -189,7 +171,7 @@ MAIN:
189 if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} 171 if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
190 172
191 ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n"); 173 ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
192 my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); 174 my $remotehost = $1 if ($opt_H =~ /([-.:%A-Za-z0-9]+)/);
193 ($remotehost) || usage("Invalid host: $opt_H\n"); 175 ($remotehost) || usage("Invalid host: $opt_H\n");
194 176
195 ($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 50); 177 ($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 50);
@@ -214,21 +196,28 @@ MAIN:
214 196
215 alarm($TIMEOUT); 197 alarm($TIMEOUT);
216 198
217 my ($name, $alias, $proto) = getprotobyname('tcp');
218
219 print "MAIN(debug): binding to remote host: $remotehost -> $remoteport\n" if $verbose; 199 print "MAIN(debug): binding to remote host: $remotehost -> $remoteport\n" if $verbose;
220 my $ClientSocket = &bindRemote($remotehost,$remoteport); 200 $ClientSocket = IO::Socket::IP->new(
201 PeerHost => $remotehost,
202 PeerService => $remoteport,
203 Family => $opt_4 ? AF_INET : $opt_6 ? AF_INET6 : undef,
204 Type => SOCK_STREAM,
205 );
206 if (!$ClientSocket) {
207 print "IRCD UNKNOWN: Could not start socket ($!)\n";
208 exit $ERRORS{"UNKNOWN"};
209 }
221 210
222 print ClientSocket "NICK $NICK\nUSER $USER_INFO\n"; 211 print $ClientSocket "NICK $NICK\nUSER $USER_INFO\n";
223 212
224 while (<ClientSocket>) { 213 while (<$ClientSocket>) {
225 print "MAIN(debug): default var = $_\n" if $verbose; 214 print "MAIN(debug): default var = $_\n" if $verbose;
226 215
227 # DALnet,LagNet,UnderNet etc. Require this! 216 # DALnet,LagNet,UnderNet etc. Require this!
228 # Replies with a PONG when presented with a PING query. 217 # Replies with a PONG when presented with a PING query.
229 # If a server doesn't require it, it will be ignored. 218 # If a server doesn't require it, it will be ignored.
230 219
231 if (m/^PING (.*)/) {print ClientSocket "PONG $1\n";} 220 if (m/^PING (.*)/) {print $ClientSocket "PONG $1\n";}
232 221
233 alarm(0); 222 alarm(0);
234 223
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 49156af..f143c6f 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -1,7 +1,7 @@
1#!@PERL@ -w 1#!@PERL@ -w
2 2
3# check_mailq - check to see how many messages are in the smtp queue awating 3# check_mailq - check to see how many messages are in the smtp queue awating
4# transmittal. 4# transmittal.
5# 5#
6# Initial version support sendmail's mailq command 6# Initial version support sendmail's mailq command
7# Support for multiple sendmail queues (Carlos Canau) 7# Support for multiple sendmail queues (Carlos Canau)
@@ -29,8 +29,8 @@ use POSIX;
29use strict; 29use strict;
30use Getopt::Long; 30use Getopt::Long;
31use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t $opt_s $opt_d 31use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t $opt_s $opt_d
32 $opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq $mailq_args 32 $opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq $mailq_args
33 @lines %srcdomains %dstdomains); 33 @lines %srcdomains %dstdomains);
34use FindBin; 34use FindBin;
35use lib "$FindBin::Bin"; 35use lib "$FindBin::Bin";
36use utils qw(%ERRORS &print_revision &support &usage ); 36use utils qw(%ERRORS &print_revision &support &usage );
@@ -42,10 +42,10 @@ sub print_usage ();
42sub process_arguments (); 42sub process_arguments ();
43 43
44$ENV{'PATH'}='@TRUSTED_PATH@'; 44$ENV{'PATH'}='@TRUSTED_PATH@';
45$ENV{'BASH_ENV'}=''; 45$ENV{'BASH_ENV'}='';
46$ENV{'ENV'}=''; 46$ENV{'ENV'}='';
47$PROGNAME = "check_mailq"; 47$PROGNAME = "check_mailq";
48$mailq = 'sendmail'; # default 48$mailq = 'sendmail'; # default
49$msg_q = 0 ; 49$msg_q = 0 ;
50$msg_p = 0 ; 50$msg_p = 0 ;
51# If appended, must start with a space 51# If appended, must start with a space
@@ -55,50 +55,49 @@ $state = $ERRORS{'UNKNOWN'};
55Getopt::Long::Configure('bundling'); 55Getopt::Long::Configure('bundling');
56$status = process_arguments(); 56$status = process_arguments();
57if ($status){ 57if ($status){
58 print "ERROR: processing arguments\n"; 58 print "ERROR: processing arguments\n";
59 exit $ERRORS{"UNKNOWN"}; 59 exit $ERRORS{"UNKNOWN"};
60} 60}
61 61
62if ($opt_s) { 62if ($opt_s) {
63 if (defined $utils::PATH_TO_SUDO && -x $utils::PATH_TO_SUDO) { 63 if (defined $utils::PATH_TO_SUDO && -x $utils::PATH_TO_SUDO) {
64 $sudo = $utils::PATH_TO_SUDO; 64 $sudo = $utils::PATH_TO_SUDO;
65 } else { 65 } else {
66 print "ERROR: Cannot execute sudo\n"; 66 print "ERROR: Cannot execute sudo\n";
67 exit $ERRORS{'UNKNOWN'}; 67 exit $ERRORS{'UNKNOWN'};
68 } 68 }
69} else { 69} else {
70 $sudo = ""; 70 $sudo = "";
71} 71}
72 72
73if ($opt_d) { 73if ($opt_d) {
74 $mailq_args = $mailq_args . ' -C ' . $opt_d; 74 $mailq_args = $mailq_args . ' -C ' . $opt_d;
75} 75}
76 76
77$SIG{'ALRM'} = sub { 77$SIG{'ALRM'} = sub {
78 print ("ERROR: timed out waiting for $utils::PATH_TO_MAILQ \n"); 78 print ("ERROR: timed out waiting for $utils::PATH_TO_MAILQ \n");
79 exit $ERRORS{"WARNING"}; 79 exit $ERRORS{"WARNING"};
80}; 80};
81alarm($opt_t); 81alarm($opt_t);
82 82
83# switch based on MTA 83# switch based on MTA
84 84
85if ($mailq eq "sendmail") { 85if ($mailq eq "sendmail") {
86 86 if( ! $utils::PATH_TO_MAILQ) {
87 ## open mailq 87 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
88 if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { 88 exit $ERRORS{'UNKNOWN'};
89 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { 89 }
90 print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; 90
91 exit $ERRORS{'UNKNOWN'}; 91 if ( ! -x $utils::PATH_TO_MAILQ) {
92 } 92 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
93 }elsif( defined $utils::PATH_TO_MAILQ){ 93 exit $ERRORS{'UNKNOWN'};
94 unless (-x $utils::PATH_TO_MAILQ) { 94 }
95 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; 95
96 exit $ERRORS{'UNKNOWN'}; 96 ## open mailq
97 } 97 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
98 } else { 98 print "ERROR: could not open $sudo $utils::PATH_TO_MAILQ \n";
99 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; 99 exit $ERRORS{'UNKNOWN'};
100 exit $ERRORS{'UNKNOWN'}; 100 }
101 }
102# single queue empty 101# single queue empty
103##/var/spool/mqueue is empty 102##/var/spool/mqueue is empty
104# single queue: 1 103# single queue: 1
@@ -168,213 +167,207 @@ if ($mailq eq "sendmail") {
168## /var/spool/mqueue is empty 167## /var/spool/mqueue is empty
169## Total requests: 0 168## Total requests: 0
170 169
171 my $this_msg_q = 0; 170 my $this_msg_q = 0;
172 while (<MAILQ>) { 171 while (<MAILQ>) {
173 172
174 # match email addr on queue listing 173 # match email addr on queue listing
175 if ( (/<.*@.*\.(\w+\.\w+)>/) || (/<.*@(\w+\.\w+)>/) ) { 174 if ( (/<.*@.*\.(\w+\.\w+)>/) || (/<.*@(\w+\.\w+)>/) ) {
176 my $domain = $1; 175 my $domain = $1;
177 if (/^\w+/) { 176 if (/^\w+/) {
178 print "$utils::PATH_TO_MAILQ = srcdomain = $domain \n" if $verbose ; 177 print "$utils::PATH_TO_MAILQ = srcdomain = $domain \n" if $verbose ;
179 $srcdomains{$domain} ++; 178 $srcdomains{$domain} ++;
180 } 179 }
181 next; 180 next;
182 } 181 }
183
184 #
185 # ...
186 # sendmail considers a message with more than one destiny, say N, to the same MX
187 # to have N messages in queue.
188 # we will only consider one in this code
189 if (( /\s\(reply:\sread\serror\sfrom\s.*\.(\w+\.\w+)\.$/ ) || ( /\s\(reply:\sread\serror\sfrom\s(\w+\.\w+)\.$/ ) ||
190 ( /\s\(timeout\swriting\smessage\sto\s.*\.(\w+\.\w+)\.:/ ) || ( /\s\(timeout\swriting\smessage\sto\s(\w+\.\w+)\.:/ ) ||
191 ( /\s\(host\smap:\slookup\s\(.*\.(\w+\.\w+)\):/ ) || ( /\s\(host\smap:\slookup\s\((\w+\.\w+)\):/ ) ||
192 ( /\s\(Deferred:\s.*\s.*\.(\w+\.\w+)\.\)/ ) || ( /\s\(Deferred:\s.*\s(\w+\.\w+)\.\)/ ) ) {
193
194 print "$utils::PATH_TO_MAILQ = dstdomain = $1 \n" if $verbose ;
195 $dstdomains{$1} ++;
196 }
197
198 if (/\s+\(I\/O\serror\)/) {
199 print "$utils::PATH_TO_MAILQ = dstdomain = UNKNOWN \n" if $verbose ;
200 $dstdomains{'UNKNOWN'} ++;
201 }
202
203 # Finally look at the overall queue length
204 #
205 if (/mqueue/) {
206 print "$utils::PATH_TO_MAILQ = $_ "if $verbose ;
207 if (/ \((\d+) request/) {
208 #
209 # single queue: first line
210 # multi queue: one for each queue. overwrite on multi queue below
211 $this_msg_q = $1 ;
212 $msg_q += $1 ;
213 }
214 } elsif (/^\s+Total\sRequests:\s(\d+)$/i) {
215 if ($this_msg_q) {
216 $this_msg_q = 0 ;
217 } else {
218 print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
219 #
220 # multi queue: last line
221 $msg_q += $1 ;
222 }
223 }
224
225 }
226
227
228 ## close mailq
229
230 close (MAILQ);
231
232 if ( $? ) {
233 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
234 exit $ERRORS{CRITICAL};
235 }
236
237 ## shut off the alarm
238 alarm(0);
239
240
241
242 ## now check the queue length(s)
243
244 if ($msg_q == 0) {
245 $msg = "OK: $mailq mailq is empty";
246 $state = $ERRORS{'OK'};
247 } else {
248 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
249
250 # overall queue length
251 if ($msg_q < $opt_w) {
252 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
253 $state = $ERRORS{'OK'};
254 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
255 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
256 $state = $ERRORS{'WARNING'};
257 }else {
258 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
259 $state = $ERRORS{'CRITICAL'};
260 }
261
262 # check for domain specific queue lengths if requested
263 if (defined $opt_W) {
264
265 # Apply threshold to queue lengths FROM domain
266 my @srckeys = sort { $srcdomains{$b} <=> $srcdomains{$a} } keys %srcdomains;
267 my $srcmaxkey = $srckeys[0];
268 print "src max is $srcmaxkey with $srcdomains{$srcmaxkey} messages\n" if $verbose;
269
270 if ($srcdomains{$srcmaxkey} >= $opt_W && $srcdomains{$srcmaxkey} < $opt_C) {
271 if ($state == $ERRORS{'OK'}) {
272 $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
273 $state = $ERRORS{'WARNING'};
274 } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){
275 $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
276 } else {
277 $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
278 $state = $ERRORS{'WARNING'};
279 }
280 } elsif ($srcdomains{$srcmaxkey} >= $opt_C) {
281 if ($state == $ERRORS{'OK'}) {
282 $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C)";
283 $state = $ERRORS{'CRITICAL'};
284 } elsif ($state == $ERRORS{'WARNING'}) {
285 $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C) -and- " . $msg;
286 $msg =~ s/WARNING: //;
287 } elsif ($state == $ERRORS{'CRITICAL'}) {
288 $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
289 } else {
290 $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
291 $state = $ERRORS{'CRITICAL'};
292 }
293 } else {
294 if ($srcdomains{$srcmaxkey} > 0) {
295 $msg .= " $srcdomains{$srcmaxkey} msgs. FROM $srcmaxkey is below threshold ($opt_W/$opt_C)";
296 }
297 }
298
299 # Apply threshold to queue lengths TO domain
300 my @dstkeys = sort { $dstdomains{$b} <=> $dstdomains{$a} } keys %dstdomains;
301 my $dstmaxkey = $dstkeys[0];
302 print "dst max is $dstmaxkey with $dstdomains{$dstmaxkey} messages\n" if $verbose;
303
304 if ($dstdomains{$dstmaxkey} >= $opt_W && $dstdomains{$dstmaxkey} < $opt_C) {
305 if ($state == $ERRORS{'OK'}) {
306 $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
307 $state = $ERRORS{'WARNING'};
308 } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){
309 $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
310 } else {
311 $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
312 $state = $ERRORS{'WARNING'};
313 }
314 } elsif ($dstdomains{$dstmaxkey} >= $opt_C) {
315 if ($state == $ERRORS{'OK'}) {
316 $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C)";
317 $state = $ERRORS{'CRITICAL'};
318 } elsif ($state == $ERRORS{'WARNING'}) {
319 $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C) -and- " . $msg;
320 $msg =~ s/WARNING: //;
321 } elsif ($state == $ERRORS{'CRITICAL'}) {
322 $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
323 } else {
324 $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
325 $state = $ERRORS{'CRITICAL'};
326 }
327 } else {
328 if ($dstdomains{$dstmaxkey} > 0) {
329 $msg .= " $dstdomains{$dstmaxkey} msgs. TO $dstmaxkey is below threshold ($opt_W/$opt_C)";
330 }
331 }
332
333 } # End of queue length thresholds
334
335 }
336 182
337} # end of ($mailq eq "sendmail") 183 #
338elsif ( $mailq eq "postfix" ) { 184 # ...
185 # sendmail considers a message with more than one destiny, say N, to the same MX
186 # to have N messages in queue.
187 # we will only consider one in this code
188 if (( /\s\(reply:\sread\serror\sfrom\s.*\.(\w+\.\w+)\.$/ ) || ( /\s\(reply:\sread\serror\sfrom\s(\w+\.\w+)\.$/ ) ||
189 ( /\s\(timeout\swriting\smessage\sto\s.*\.(\w+\.\w+)\.:/ ) || ( /\s\(timeout\swriting\smessage\sto\s(\w+\.\w+)\.:/ ) ||
190 ( /\s\(host\smap:\slookup\s\(.*\.(\w+\.\w+)\):/ ) || ( /\s\(host\smap:\slookup\s\((\w+\.\w+)\):/ ) ||
191 ( /\s\(Deferred:\s.*\s.*\.(\w+\.\w+)\.\)/ ) || ( /\s\(Deferred:\s.*\s(\w+\.\w+)\.\)/ ) ) {
192
193 print "$utils::PATH_TO_MAILQ = dstdomain = $1 \n" if $verbose ;
194 $dstdomains{$1} ++;
195 }
339 196
340 ## open mailq 197 if (/\s+\(I\/O\serror\)/) {
341 if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { 198 print "$utils::PATH_TO_MAILQ = dstdomain = UNKNOWN \n" if $verbose ;
342 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args | " ) ) { 199 $dstdomains{'UNKNOWN'} ++;
343 print "ERROR: could not open $utils::PATH_TO_MAILQ$mailq_args \n";
344 exit $ERRORS{'UNKNOWN'};
345 }
346 }elsif( defined $utils::PATH_TO_MAILQ){
347 unless (-x $utils::PATH_TO_MAILQ) {
348 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
349 exit $ERRORS{'UNKNOWN'};
350 }
351 } else {
352 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
353 exit $ERRORS{'UNKNOWN'};
354 } 200 }
355 201
202 # Finally look at the overall queue length
203 #
204 if (/mqueue/) {
205 print "$utils::PATH_TO_MAILQ = $_ "if $verbose ;
206 if (/ \((\d+) request/) {
207 #
208 # single queue: first line
209 # multi queue: one for each queue. overwrite on multi queue below
210 $this_msg_q = $1 ;
211 $msg_q += $1 ;
212 }
213 } elsif (/^\s+Total\sRequests:\s(\d+)$/i) {
214 if ($this_msg_q) {
215 $this_msg_q = 0 ;
216 } else {
217 print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
218 #
219 # multi queue: last line
220 $msg_q += $1 ;
221 }
222 }
356 223
357 @lines = reverse <MAILQ>; 224 }
225
226 ## close mailq
227 close (MAILQ);
228
229 if ( $? ) {
230 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
231 exit $ERRORS{CRITICAL};
232 }
233
234 ## shut off the alarm
235 alarm(0);
236
237 ## now check the queue length(s)
238
239 if ($msg_q == 0) {
240 $msg = "OK: $mailq mailq is empty";
241 $state = $ERRORS{'OK'};
242 } else {
243 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
244
245 # overall queue length
246 if ($msg_q < $opt_w) {
247 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
248 $state = $ERRORS{'OK'};
249 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
250 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
251 $state = $ERRORS{'WARNING'};
252 }else {
253 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
254 $state = $ERRORS{'CRITICAL'};
255 }
358 256
359 # close qmail-qstat 257 # check for domain specific queue lengths if requested
360 close MAILQ; 258 if (defined $opt_W) {
259
260 # Apply threshold to queue lengths FROM domain
261 my @srckeys = sort { $srcdomains{$b} <=> $srcdomains{$a} } keys %srcdomains;
262 my $srcmaxkey = $srckeys[0];
263 print "src max is $srcmaxkey with $srcdomains{$srcmaxkey} messages\n" if $verbose;
264
265 if ($srcdomains{$srcmaxkey} >= $opt_W && $srcdomains{$srcmaxkey} < $opt_C) {
266 if ($state == $ERRORS{'OK'}) {
267 $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
268 $state = $ERRORS{'WARNING'};
269 } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){
270 $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
271 } else {
272 $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
273 $state = $ERRORS{'WARNING'};
274 }
275 } elsif ($srcdomains{$srcmaxkey} >= $opt_C) {
276 if ($state == $ERRORS{'OK'}) {
277 $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C)";
278 $state = $ERRORS{'CRITICAL'};
279 } elsif ($state == $ERRORS{'WARNING'}) {
280 $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C) -and- " . $msg;
281 $msg =~ s/WARNING: //;
282 } elsif ($state == $ERRORS{'CRITICAL'}) {
283 $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
284 } else {
285 $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
286 $state = $ERRORS{'CRITICAL'};
287 }
288 } else {
289 if ($srcdomains{$srcmaxkey} > 0) {
290 $msg .= " $srcdomains{$srcmaxkey} msgs. FROM $srcmaxkey is below threshold ($opt_W/$opt_C)";
291 }
292 }
293
294 # Apply threshold to queue lengths TO domain
295 my @dstkeys = sort { $dstdomains{$b} <=> $dstdomains{$a} } keys %dstdomains;
296 my $dstmaxkey = $dstkeys[0];
297 print "dst max is $dstmaxkey with $dstdomains{$dstmaxkey} messages\n" if $verbose;
298
299 if ($dstdomains{$dstmaxkey} >= $opt_W && $dstdomains{$dstmaxkey} < $opt_C) {
300 if ($state == $ERRORS{'OK'}) {
301 $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
302 $state = $ERRORS{'WARNING'};
303 } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){
304 $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
305 } else {
306 $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
307 $state = $ERRORS{'WARNING'};
308 }
309 } elsif ($dstdomains{$dstmaxkey} >= $opt_C) {
310 if ($state == $ERRORS{'OK'}) {
311 $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C)";
312 $state = $ERRORS{'CRITICAL'};
313 } elsif ($state == $ERRORS{'WARNING'}) {
314 $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C) -and- " . $msg;
315 $msg =~ s/WARNING: //;
316 } elsif ($state == $ERRORS{'CRITICAL'}) {
317 $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
318 } else {
319 $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
320 $state = $ERRORS{'CRITICAL'};
321 }
322 } else {
323 if ($dstdomains{$dstmaxkey} > 0) {
324 $msg .= " $dstdomains{$dstmaxkey} msgs. TO $dstmaxkey is below threshold ($opt_W/$opt_C)";
325 }
326 }
361 327
362 if ( $? ) { 328 } # End of queue length thresholds
363 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ$mailq_args",$/;
364 exit $ERRORS{CRITICAL};
365 }
366 329
367 ## shut off the alarm 330 }
368 alarm(0);
369 331
370 # check queue length 332} # end of ($mailq eq "sendmail")
371 if ($lines[0]=~/Kbytes in (\d+)/) { 333elsif ( $mailq eq "postfix" ) {
372 $msg_q = $1 ; 334 if( ! $utils::PATH_TO_MAILQ ) {
373 }elsif ($lines[0]=~/Mail queue is empty/) { 335 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
374 $msg_q = 0; 336 exit $ERRORS{'UNKNOWN'};
337 }
338
339 if ( ! -x $utils::PATH_TO_MAILQ) {
340 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
341 exit $ERRORS{'UNKNOWN'};
342 }
343
344 ## open mailq
345 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args | " ) ) {
346 print "ERROR: could not open $utils::PATH_TO_MAILQ$mailq_args \n";
347 exit $ERRORS{'UNKNOWN'};
348 }
349
350 @lines = reverse <MAILQ>;
351
352 # close qmail-qstat
353 close MAILQ;
354
355 if ( $? ) {
356 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ$mailq_args",$/;
357 exit $ERRORS{CRITICAL};
358 }
359
360 ## shut off the alarm
361 alarm(0);
362
363 # check queue length
364 if ($lines[0]=~/Kbytes in (\d+)/) {
365 $msg_q = $1 ;
366 }elsif ($lines[0]=~/Mail queue is empty/) {
367 $msg_q = 0;
375 }else{ 368 }else{
376 print "Couldn't match $utils::PATH_TO_MAILQ$mailq_args output\n"; 369 print "Couldn't match $utils::PATH_TO_MAILQ$mailq_args output\n";
377 exit $ERRORS{'UNKNOWN'}; 370 exit $ERRORS{'UNKNOWN'};
378 } 371 }
379 372
380 # check messages not processed 373 # check messages not processed
@@ -390,194 +383,193 @@ elsif ( $mailq eq "postfix" ) {
390 $msg = "OK: $mailq mailq reports queue is empty"; 383 $msg = "OK: $mailq mailq reports queue is empty";
391 $state = $ERRORS{'OK'}; 384 $state = $ERRORS{'OK'};
392 } else { 385 } else {
393 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; 386 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
394 387
395 # overall queue length 388 # overall queue length
396 if ($msg_q < $opt_w) { 389 if ($msg_q < $opt_w) {
397 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 390 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
398 $state = $ERRORS{'OK'}; 391 $state = $ERRORS{'OK'};
399 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 392 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
400 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; 393 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
401 $state = $ERRORS{'WARNING'}; 394 $state = $ERRORS{'WARNING'};
402 }else { 395 }else {
403 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; 396 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
404 $state = $ERRORS{'CRITICAL'}; 397 $state = $ERRORS{'CRITICAL'};
405 } 398 }
406 399
407 # check messages not yet preprocessed (only compare is $opt_W and $opt_C 400 # check messages not yet preprocessed (only compare is $opt_W and $opt_C
408 # are defined) 401 # are defined)
409 402
410 #if (defined $opt_W) { 403 #if (defined $opt_W) {
411 # $msg .= "[Preprocessed = $msg_p]"; 404 # $msg .= "[Preprocessed = $msg_p]";
412 # if ($msg_p >= $opt_W && $msg_p < $opt_C ) { 405 # if ($msg_p >= $opt_W && $msg_p < $opt_C ) {
413 # $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ; 406 # $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
414 # }elsif ($msg_p >= $opt_C ) { 407 # }elsif ($msg_p >= $opt_C ) {
415 # $state = $ERRORS{"CRITICAL"} ; 408 # $state = $ERRORS{"CRITICAL"} ;
416 # } 409 # }
417 #} 410 #}
418 } 411 }
419} # end of ($mailq eq "postfix") 412} # end of ($mailq eq "postfix")
420elsif ( $mailq eq "qmail" ) { 413elsif ( $mailq eq "qmail" ) {
414 if ( ! $utils::PATH_TO_QMAIL_QSTAT ) {
415 print "ERROR: \$utils::PATH_TO_QMAIL_QSTAT is not defined\n";
416 exit $ERRORS{'UNKNOWN'};
417 }
418
419 if ( ! -x $utils::PATH_TO_QMAIL_QSTAT) {
420 print "ERROR: $utils::PATH_TO_QMAIL_QSTAT is not executable by (uid $>:gid($)))\n";
421 exit $ERRORS{'UNKNOWN'};
422 }
423
424 # open qmail-qstat
425 if (! open (MAILQ, "$sudo $utils::PATH_TO_QMAIL_QSTAT | " ) ) {
426 print "ERROR: could not open $utils::PATH_TO_QMAIL_QSTAT \n";
427 exit $ERRORS{'UNKNOWN'};
428 }
429
430 @lines = <MAILQ>;
431
432 # close qmail-qstat
433 close MAILQ;
434
435 if ( $? ) {
436 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
437 exit $ERRORS{CRITICAL};
438 }
439
440 ## shut off the alarm
441 alarm(0);
442
443 # check queue length
444 if ($lines[0]=~/^messages in queue: (\d+)/) {
445 $msg_q = $1 ;
446 }else{
447 print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n";
448 exit $ERRORS{'UNKNOWN'};
449 }
450
451 # check messages not processed
452 if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) {
453 my $msg_p = $1;
454 }else{
455 print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n";
456 exit $ERRORS{'UNKNOWN'};
457 }
458
459
460 # check queue length(s)
461 if ($msg_q == 0){
462 $msg = "OK: qmail-qstat reports queue is empty";
463 $state = $ERRORS{'OK'};
464 } else {
465 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
466
467 # overall queue length
468 if ($msg_q < $opt_w) {
469 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
470 $state = $ERRORS{'OK'};
471 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
472 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
473 $state = $ERRORS{'WARNING'};
474 }else {
475 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
476 $state = $ERRORS{'CRITICAL'};
477 }
478
479 # check messages not yet preprocessed (only compare is $opt_W and $opt_C
480 # are defined)
481
482 if (defined $opt_W) {
483 $msg .= "[Preprocessed = $msg_p]";
484 if ($msg_p >= $opt_W && $msg_p < $opt_C ) {
485 $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
486 }elsif ($msg_p >= $opt_C ) {
487 $state = $ERRORS{"CRITICAL"} ;
488 }
489 }
490 }
421 491
422 # open qmail-qstat
423 if ( defined $utils::PATH_TO_QMAIL_QSTAT && -x $utils::PATH_TO_QMAIL_QSTAT ) {
424 if (! open (MAILQ, "$sudo $utils::PATH_TO_QMAIL_QSTAT | " ) ) {
425 print "ERROR: could not open $utils::PATH_TO_QMAIL_QSTAT \n";
426 exit $ERRORS{'UNKNOWN'};
427 }
428 }elsif( defined $utils::PATH_TO_QMAIL_QSTAT){
429 unless (-x $utils::PATH_TO_QMAIL_QSTAT) {
430 print "ERROR: $utils::PATH_TO_QMAIL_QSTAT is not executable by (uid $>:gid($)))\n";
431 exit $ERRORS{'UNKNOWN'};
432 }
433 } else {
434 print "ERROR: \$utils::PATH_TO_QMAIL_QSTAT is not defined\n";
435 exit $ERRORS{'UNKNOWN'};
436 }
437
438 @lines = <MAILQ>;
439
440 # close qmail-qstat
441 close MAILQ;
442
443 if ( $? ) {
444 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
445 exit $ERRORS{CRITICAL};
446 }
447
448 ## shut off the alarm
449 alarm(0);
450
451 # check queue length
452 if ($lines[0]=~/^messages in queue: (\d+)/) {
453 $msg_q = $1 ;
454 }else{
455 print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n";
456 exit $ERRORS{'UNKNOWN'};
457 }
458
459 # check messages not processed
460 if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) {
461 my $msg_p = $1;
462 }else{
463 print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n";
464 exit $ERRORS{'UNKNOWN'};
465 }
466
467
468 # check queue length(s)
469 if ($msg_q == 0){
470 $msg = "OK: qmail-qstat reports queue is empty";
471 $state = $ERRORS{'OK'};
472 } else {
473 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
474
475 # overall queue length
476 if ($msg_q < $opt_w) {
477 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
478 $state = $ERRORS{'OK'};
479 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
480 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
481 $state = $ERRORS{'WARNING'};
482 }else {
483 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
484 $state = $ERRORS{'CRITICAL'};
485 }
486
487 # check messages not yet preprocessed (only compare is $opt_W and $opt_C
488 # are defined)
489
490 if (defined $opt_W) {
491 $msg .= "[Preprocessed = $msg_p]";
492 if ($msg_p >= $opt_W && $msg_p < $opt_C ) {
493 $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
494 }elsif ($msg_p >= $opt_C ) {
495 $state = $ERRORS{"CRITICAL"} ;
496 }
497 }
498 }
499
500 492
501 493
502} # end of ($mailq eq "qmail") 494} # end of ($mailq eq "qmail")
503elsif ( $mailq eq "exim" ) { 495elsif ( $mailq eq "exim" ) {
504 ## open mailq 496 if ( ! $utils::PATH_TO_MAILQ ) {
505 if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { 497 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
506 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { 498 exit $ERRORS{'UNKNOWN'};
507 print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; 499 }
508 exit $ERRORS{'UNKNOWN'}; 500
509 } 501 if ( ! -x $utils::PATH_TO_MAILQ) {
510 }elsif( defined $utils::PATH_TO_MAILQ){ 502 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
511 unless (-x $utils::PATH_TO_MAILQ) { 503 exit $ERRORS{'UNKNOWN'};
512 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; 504 }
513 exit $ERRORS{'UNKNOWN'}; 505
514 } 506 ## open mailq
515 } else { 507 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
516 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; 508 print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
517 exit $ERRORS{'UNKNOWN'}; 509 exit $ERRORS{'UNKNOWN'};
518 } 510 }
519 511
520 while (<MAILQ>) { 512 while (<MAILQ>) {
521 #22m 1.7K 19aEEr-0007hx-Dy <> *** frozen *** 513 #22m 1.7K 19aEEr-0007hx-Dy <> *** frozen ***
522 #root@exlixams.glups.fr 514 #root@exlixams.glups.fr
523 515
524 if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy 516 if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy
525 $msg_q++ ; 517 $msg_q++ ;
526 } 518 }
527 } 519 }
528 close(MAILQ) ; 520 close(MAILQ) ;
529 521
530 if ( $? ) { 522 if ( $? ) {
531 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/; 523 print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
532 exit $ERRORS{CRITICAL}; 524 exit $ERRORS{CRITICAL};
533 } 525 }
534 if ($msg_q < $opt_w) { 526 if ($msg_q < $opt_w) {
535 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 527 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
536 $state = $ERRORS{'OK'}; 528 $state = $ERRORS{'OK'};
537 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 529 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
538 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; 530 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
539 $state = $ERRORS{'WARNING'}; 531 $state = $ERRORS{'WARNING'};
540 }else { 532 }else {
541 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; 533 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
542 $state = $ERRORS{'CRITICAL'}; 534 $state = $ERRORS{'CRITICAL'};
543 } 535 }
544} # end of ($mailq eq "exim") 536} # end of ($mailq eq "exim")
545 537
546elsif ( $mailq eq "nullmailer" ) { 538elsif ( $mailq eq "nullmailer" ) {
547 ## open mailq 539 if( ! $utils::PATH_TO_MAILQ) {
548 if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { 540 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
549 if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { 541 exit $ERRORS{'UNKNOWN'};
550 print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; 542 }
551 exit $ERRORS{'UNKNOWN'}; 543
552 } 544 if ( ! -x $utils::PATH_TO_MAILQ) {
553 }elsif( defined $utils::PATH_TO_MAILQ){ 545 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
554 unless (-x $utils::PATH_TO_MAILQ) { 546 exit $ERRORS{'UNKNOWN'};
555 print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; 547 }
556 exit $ERRORS{'UNKNOWN'}; 548
557 } 549 ## open mailq
558 } else { 550 if ( ! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
559 print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; 551 print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
560 exit $ERRORS{'UNKNOWN'}; 552 exit $ERRORS{'UNKNOWN'};
561 } 553 }
562 554
563 while (<MAILQ>) { 555 while (<MAILQ>) {
564 #2022-08-25 01:30:40 502 bytes from <user@example.com> 556 #2022-08-25 01:30:40 502 bytes from <user@example.com>
565 557
566 if (/^\d{4}-\d{2}-\d{2}\s+\d{2}\:\d{2}\:\d{2}\s+\d+\sbytes/) { 558 if (/^\d{4}-\d{2}-\d{2}\s+\d{2}\:\d{2}\:\d{2}\s+\d+\sbytes/) {
567 $msg_q++ ; 559 $msg_q++ ;
568 } 560 }
569 } 561 }
570 close(MAILQ) ; 562 close(MAILQ) ;
571 if ($msg_q < $opt_w) { 563 if ($msg_q < $opt_w) {
572 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 564 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
573 $state = $ERRORS{'OK'}; 565 $state = $ERRORS{'OK'};
574 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 566 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
575 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; 567 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
576 $state = $ERRORS{'WARNING'}; 568 $state = $ERRORS{'WARNING'};
577 }else { 569 }else {
578 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; 570 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
579 $state = $ERRORS{'CRITICAL'}; 571 $state = $ERRORS{'CRITICAL'};
580 } 572 }
581} # end of ($mailq eq "nullmailer") 573} # end of ($mailq eq "nullmailer")
582 574
583# Perfdata support 575# Perfdata support
@@ -590,130 +582,130 @@ exit $state;
590 582
591 583
592sub process_arguments(){ 584sub process_arguments(){
593 GetOptions 585 GetOptions
594 ("V" => \$opt_V, "version" => \$opt_V, 586 ("V" => \$opt_V, "version" => \$opt_V,
595 "v" => \$opt_v, "verbose" => \$opt_v, 587 "v" => \$opt_v, "verbose" => \$opt_v,
596 "h" => \$opt_h, "help" => \$opt_h, 588 "h" => \$opt_h, "help" => \$opt_h,
597 "M:s" => \$opt_M, "mailserver:s" => \$opt_M, # mailserver (default sendmail) 589 "M:s" => \$opt_M, "mailserver:s" => \$opt_M, # mailserver (default sendmail)
598 "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number 590 "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number
599 "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number 591 "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number
600 "W=i" => \$opt_W, "warning-domain=i" => \$opt_W, # Warning if above this number 592 "W=i" => \$opt_W, "warning-domain=i" => \$opt_W, # Warning if above this number
601 "C=i" => \$opt_C, "critical-domain=i" => \$opt_C, # Critical if above this number 593 "C=i" => \$opt_C, "critical-domain=i" => \$opt_C, # Critical if above this number
602 "t=i" => \$opt_t, "timeout=i" => \$opt_t, 594 "t=i" => \$opt_t, "timeout=i" => \$opt_t,
603 "s" => \$opt_s, "sudo" => \$opt_s, 595 "s" => \$opt_s, "sudo" => \$opt_s,
604 "d:s" => \$opt_d, "configdir:s" => \$opt_d, 596 "d:s" => \$opt_d, "configdir:s" => \$opt_d,
605 ); 597 );
606 598
607 if ($opt_V) { 599 if ($opt_V) {
608 print_revision($PROGNAME,'@NP_VERSION@'); 600 print_revision($PROGNAME,'@NP_VERSION@');
609 exit $ERRORS{'UNKNOWN'}; 601 exit $ERRORS{'UNKNOWN'};
610 } 602 }
611 603
612 if ($opt_h) { 604 if ($opt_h) {
613 print_help(); 605 print_help();
614 exit $ERRORS{'UNKNOWN'}; 606 exit $ERRORS{'UNKNOWN'};
615 } 607 }
616 608
617 if (defined $opt_v ){ 609 if (defined $opt_v ){
618 $verbose = $opt_v; 610 $verbose = $opt_v;
619 } 611 }
620 612
621 unless (defined $opt_t) { 613 unless (defined $opt_t) {
622 $opt_t = $utils::TIMEOUT ; # default timeout 614 $opt_t = $utils::TIMEOUT ; # default timeout
623 } 615 }
624 616
625 unless ( defined $opt_w && defined $opt_c ) { 617 unless ( defined $opt_w && defined $opt_c ) {
626 print_usage(); 618 print_usage();
627 exit $ERRORS{'UNKNOWN'}; 619 exit $ERRORS{'UNKNOWN'};
628 } 620 }
629 621
630 if ( $opt_w >= $opt_c) { 622 if ( $opt_w >= $opt_c) {
631 print "Warning (-w) cannot be greater than Critical (-c)!\n"; 623 print "Warning (-w) cannot be greater than Critical (-c)!\n";
632 exit $ERRORS{'UNKNOWN'}; 624 exit $ERRORS{'UNKNOWN'};
633 } 625 }
634 626
635 if (defined $opt_W && ! defined !$opt_C) { 627 if (defined $opt_W && ! defined !$opt_C) {
636 print "Need -C if using -W\n"; 628 print "Need -C if using -W\n";
637 exit $ERRORS{'UNKNOWN'}; 629 exit $ERRORS{'UNKNOWN'};
638 }elsif(defined $opt_W && defined $opt_C) { 630 }elsif(defined $opt_W && defined $opt_C) {
639 if ($opt_W >= $opt_C) { 631 if ($opt_W >= $opt_C) {
640 print "Warning (-W) cannot be greater than Critical (-C)!\n"; 632 print "Warning (-W) cannot be greater than Critical (-C)!\n";
641 exit $ERRORS{'UNKNOWN'}; 633 exit $ERRORS{'UNKNOWN'};
642 } 634 }
643 } 635 }
644 636
645 if (defined $opt_M) { 637 if (defined $opt_M) {
646 if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) { 638 if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) {
647 $mailq = $opt_M ; 639 $mailq = $opt_M ;
648 }elsif( $opt_M eq ''){ 640 }elsif( $opt_M eq ''){
649 $mailq = 'sendmail'; 641 $mailq = 'sendmail';
650 }else{ 642 }else{
651 print "-M: $opt_M is not supported\n"; 643 print "-M: $opt_M is not supported\n";
652 exit $ERRORS{'UNKNOWN'}; 644 exit $ERRORS{'UNKNOWN'};
653 } 645 }
654 }else{ 646 }else{
655 if (defined $utils::PATH_TO_QMAIL_QSTAT 647 if (defined $utils::PATH_TO_QMAIL_QSTAT
656 && -x $utils::PATH_TO_QMAIL_QSTAT) 648 && -x $utils::PATH_TO_QMAIL_QSTAT)
657 { 649 {
658 $mailq = 'qmail'; 650 $mailq = 'qmail';
659 } 651 }
660 elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix' 652 elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
661 || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix') 653 || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
662 { 654 {
663 $mailq = 'postfix'; 655 $mailq = 'postfix';
664 } 656 }
665 elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4' 657 elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
666 || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim') 658 || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
667 { 659 {
668 $mailq = 'exim'; 660 $mailq = 'exim';
669 } 661 }
670 elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer' 662 elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
671 || -e '/usr/sbin/nullmailer-send' 663 || -e '/usr/sbin/nullmailer-send'
672 || -e '/usr/local/sbin/nullmailer-send') 664 || -e '/usr/local/sbin/nullmailer-send')
673 { 665 {
674 $mailq = 'nullmailer'; 666 $mailq = 'nullmailer';
675 } 667 }
676 else { 668 else {
677 $mailq = 'sendmail'; 669 $mailq = 'sendmail';
678 } 670 }
679 } 671 }
680 672
681 return $ERRORS{'OK'}; 673 return $ERRORS{'OK'};
682} 674}
683 675
684sub print_usage () { 676sub print_usage () {
685 print "Usage: $PROGNAME -w <warn> -c <crit> [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-s] [-d <CONFIGDIR>] [-v]\n"; 677 print "Usage: $PROGNAME -w <warn> -c <crit> [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-s] [-d <CONFIGDIR>] [-v]\n";
686} 678}
687 679
688sub print_help () { 680sub print_help () {
689 print_revision($PROGNAME,'@NP_VERSION@'); 681 print_revision($PROGNAME,'@NP_VERSION@');
690 print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n"; 682 print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n";
691 print "\n"; 683 print "\n";
692 print_usage(); 684 print_usage();
693 print "\n"; 685 print "\n";
694 print " Checks the number of messages in the mail queue (supports multiple sendmail queues, qmail)\n"; 686 print " Checks the number of messages in the mail queue (supports multiple sendmail queues, qmail)\n";
695 print " Feedback/patches to support non-sendmail mailqueue welcome\n\n"; 687 print " Feedback/patches to support non-sendmail mailqueue welcome\n\n";
696 print "-w (--warning) = Min. number of messages in queue to generate warning\n"; 688 print "-w (--warning) = Min. number of messages in queue to generate warning\n";
697 print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n"; 689 print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n";
698 print "-W (--warning-domain) = Min. number of messages for same domain in queue to generate warning\n"; 690 print "-W (--warning-domain) = Min. number of messages for same domain in queue to generate warning\n";
699 print "-C (--critical-domain) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n"; 691 print "-C (--critical-domain) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n";
700 print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; 692 print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n";
701 print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n"; 693 print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n";
702 print "-s (--sudo) = Use sudo to call the mailq command\n"; 694 print "-s (--sudo) = Use sudo to call the mailq command\n";
703 print "-d (--configdir) = Config file or directory\n"; 695 print "-d (--configdir) = Config file or directory\n";
704 print "-h (--help)\n"; 696 print "-h (--help)\n";
705 print "-V (--version)\n"; 697 print "-V (--version)\n";
706 print "-v (--verbose) = debugging output\n"; 698 print "-v (--verbose) = debugging output\n";
707 print "\n\n"; 699 print "\n\n";
708 print "Note: -w and -c are required arguments. -W and -C are optional.\n"; 700 print "Note: -w and -c are required arguments. -W and -C are optional.\n";
709 print " -W and -C are applied to domains listed on the queues - both FROM and TO. (sendmail)\n"; 701 print " -W and -C are applied to domains listed on the queues - both FROM and TO. (sendmail)\n";
710 print " -W and -C are applied message not yet preproccessed. (qmail)\n"; 702 print " -W and -C are applied message not yet preproccessed. (qmail)\n";
711 print " This plugin tries to autodetect which mailserver you are running,\n"; 703 print " This plugin tries to autodetect which mailserver you are running,\n";
712 print " you can override the autodetection with -M.\n"; 704 print " you can override the autodetection with -M.\n";
713 print " This plugin uses the system mailq command (sendmail) or qmail-stat (qmail)\n"; 705 print " This plugin uses the system mailq command (sendmail) or qmail-stat (qmail)\n";
714 print " to look at the queues. Mailq can usually only be accessed by root or \n"; 706 print " to look at the queues. Mailq can usually only be accessed by root or \n";
715 print " a TrustedUser. You will have to set appropriate permissions for the plugin to work.\n"; 707 print " a TrustedUser. You will have to set appropriate permissions for the plugin to work.\n";
716 print ""; 708 print "";
717 print "\n\n"; 709 print "\n\n";
718 support(); 710 support();
719} 711}
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index 5998138..db824be 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -47,7 +47,7 @@ print_help() {
47 echo "--cache" 47 echo "--cache"
48 echo " Check local database for library and buffer cache hit ratios" 48 echo " Check local database for library and buffer cache hit ratios"
49 echo " ---> Requires Oracle user/password and SID specified." 49 echo " ---> Requires Oracle user/password and SID specified."
50 echo " ---> Requires select on v_$sysstat and v_$librarycache" 50 echo " ---> Requires select on v_\$sysstat and v_\$librarycache"
51 echo "--tablespace" 51 echo "--tablespace"
52 echo " Check local database for tablespace capacity in ORACLE_SID" 52 echo " Check local database for tablespace capacity in ORACLE_SID"
53 echo " ---> Requires Oracle user/password specified." 53 echo " ---> Requires Oracle user/password specified."
@@ -109,14 +109,14 @@ if [ -z "$ORACLE_HOME" ] ; then
109 for oratab in /var/opt/oracle/oratab /etc/oratab 109 for oratab in /var/opt/oracle/oratab /etc/oratab
110 do 110 do
111 [ ! -f $oratab ] && continue 111 [ ! -f $oratab ] && continue
112 ORACLE_HOME=`IFS=: 112 ORACLE_HOME=$(IFS=:
113 while read -r SID ORACLE_HOME junk; 113 while read -r SID ORACLE_HOME _;
114 do 114 do
115 if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then 115 if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then
116 echo "$ORACLE_HOME"; 116 echo "$ORACLE_HOME";
117 exit; 117 exit;
118 fi; 118 fi;
119 done < $oratab` 119 done < $oratab)
120 [ -n "$ORACLE_HOME" ] && break 120 [ -n "$ORACLE_HOME" ] && break
121 done 121 done
122fi 122fi
@@ -209,7 +209,7 @@ case "$cmd" in
209 echo "UNKNOWN - Warning level is less then Crit" 209 echo "UNKNOWN - Warning level is less then Crit"
210 exit "$STATE_UNKNOWN" 210 exit "$STATE_UNKNOWN"
211 fi 211 fi
212 result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF 212 result=$(sqlplus -s "${3}"/"${4}"@"${2}" << EOF
213set pagesize 0 213set pagesize 0
214set numf '9999999.99' 214set numf '9999999.99'
215select (1-(pr.value/(dbg.value+cg.value)))*100 215select (1-(pr.value/(dbg.value+cg.value)))*100
@@ -217,7 +217,8 @@ from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg
217where pr.name='physical reads' 217where pr.name='physical reads'
218and dbg.name='db block gets' 218and dbg.name='db block gets'
219and cg.name='consistent gets'; 219and cg.name='consistent gets';
220EOF` 220EOF
221)
221 222
222 if echo "$result" | grep -q 'ORA-' ; then 223 if echo "$result" | grep -q 'ORA-' ; then
223 error=$(echo "$result" | grep "ORA-" | head -1) 224 error=$(echo "$result" | grep "ORA-" | head -1)
@@ -227,12 +228,13 @@ EOF`
227 228
228 buf_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}') 229 buf_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
229 buf_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}') 230 buf_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
230 result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF 231 result=$(sqlplus -s "${3}"/"${4}"@"${2}" << EOF
231set pagesize 0 232set pagesize 0
232set numf '9999999.99' 233set numf '9999999.99'
233select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100 234select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
234from v\\$librarycache lc; 235from v\\$librarycache lc;
235EOF` 236EOF
237)
236 238
237 if echo "$result" | grep -q 'ORA-' ; then 239 if echo "$result" | grep -q 'ORA-' ; then
238 error=$(echo "$result" | grep "ORA-" | head -1) 240 error=$(echo "$result" | grep "ORA-" | head -1)
@@ -260,7 +262,7 @@ EOF`
260 echo "UNKNOWN - Warning level is more then Crit" 262 echo "UNKNOWN - Warning level is more then Crit"
261 exit "$STATE_UNKNOWN" 263 exit "$STATE_UNKNOWN"
262 fi 264 fi
263 result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF 265 result=$(sqlplus -s "${3}"/"${4}"@"${2}" << EOF
264set pagesize 0 266set pagesize 0
265set numf '9999999.99' 267set numf '9999999.99'
266select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc 268select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc
@@ -271,7 +273,8 @@ LEFT OUTER JOIN
271( select tablespace_name,sum(bytes)/1024/1024 free 273( select tablespace_name,sum(bytes)/1024/1024 free
272from dba_free_space group by tablespace_name) B 274from dba_free_space group by tablespace_name) B
273ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}'; 275ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
274EOF` 276EOF
277)
275 278
276 if echo "$result" | grep -q 'ORA-' ; then 279 if echo "$result" | grep -q 'ORA-' ; then
277 error=$(echo "$result" | grep "ORA-" | head -1) 280 error=$(echo "$result" | grep "ORA-" | head -1)
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
index fa982ae..5c0f6e2 100644
--- a/plugins/check_apt.c
+++ b/plugins/check_apt.c
@@ -94,7 +94,7 @@ static int stderr_warning = 0; /* if a cmd issued output on stderr */
94static int exec_warning = 0; /* if a cmd exited non-zero */ 94static int exec_warning = 0; /* if a cmd exited non-zero */
95 95
96int main (int argc, char **argv) { 96int main (int argc, char **argv) {
97 int result=STATE_UNKNOWN, packages_available=0, sec_count=0, i=0; 97 int result=STATE_UNKNOWN, packages_available=0, sec_count=0;
98 char **packages_list=NULL, **secpackages_list=NULL; 98 char **packages_list=NULL, **secpackages_list=NULL;
99 99
100 /* Parse extra opts if any */ 100 /* Parse extra opts if any */
@@ -142,10 +142,11 @@ int main (int argc, char **argv) {
142 qsort(secpackages_list, sec_count, sizeof(char*), cmpstringp); 142 qsort(secpackages_list, sec_count, sizeof(char*), cmpstringp);
143 qsort(packages_list, packages_available-sec_count, sizeof(char*), cmpstringp); 143 qsort(packages_list, packages_available-sec_count, sizeof(char*), cmpstringp);
144 144
145 for(i = 0; i < sec_count; i++) 145 for(int i = 0; i < sec_count; i++)
146 printf("%s (security)\n", secpackages_list[i]); 146 printf("%s (security)\n", secpackages_list[i]);
147
147 if (only_critical == false) { 148 if (only_critical == false) {
148 for(i = 0; i < packages_available - sec_count; i++) 149 for(int i = 0; i < packages_available - sec_count; i++)
149 printf("%s\n", packages_list[i]); 150 printf("%s\n", packages_list[i]);
150 } 151 }
151 } 152 }
@@ -251,7 +252,7 @@ int process_arguments (int argc, char **argv) {
251 252
252/* run an apt-get upgrade */ 253/* run an apt-get upgrade */
253int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist){ 254int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist){
254 int i=0, result=STATE_UNKNOWN, regres=0, pc=0, spc=0; 255 int result=STATE_UNKNOWN, regres=0, pc=0, spc=0;
255 struct output chld_out, chld_err; 256 struct output chld_out, chld_err;
256 regex_t ireg, ereg, sreg; 257 regex_t ireg, ereg, sreg;
257 char *cmdline=NULL, rerrbuf[64]; 258 char *cmdline=NULL, rerrbuf[64];
@@ -320,7 +321,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
320 * we may need to switch to the --print-uris output format, 321 * we may need to switch to the --print-uris output format,
321 * in which case the logic here will slightly change. 322 * in which case the logic here will slightly change.
322 */ 323 */
323 for(i = 0; i < chld_out.lines; i++) { 324 for(size_t i = 0; i < chld_out.lines; i++) {
324 if(verbose){ 325 if(verbose){
325 printf("%s\n", chld_out.line[i]); 326 printf("%s\n", chld_out.line[i]);
326 } 327 }
@@ -353,7 +354,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
353 stderr_warning=1; 354 stderr_warning=1;
354 result = max_state(result, STATE_WARNING); 355 result = max_state(result, STATE_WARNING);
355 if(verbose){ 356 if(verbose){
356 for(i = 0; i < chld_err.lines; i++) { 357 for(size_t i = 0; i < chld_err.lines; i++) {
357 fprintf(stderr, "%s\n", chld_err.line[i]); 358 fprintf(stderr, "%s\n", chld_err.line[i]);
358 } 359 }
359 } 360 }
@@ -367,7 +368,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
367 368
368/* run an apt-get update (needs root) */ 369/* run an apt-get update (needs root) */
369int run_update(void){ 370int run_update(void){
370 int i=0, result=STATE_UNKNOWN; 371 int result=STATE_UNKNOWN;
371 struct output chld_out, chld_err; 372 struct output chld_out, chld_err;
372 char *cmdline; 373 char *cmdline;
373 374
@@ -385,7 +386,7 @@ int run_update(void){
385 } 386 }
386 387
387 if(verbose){ 388 if(verbose){
388 for(i = 0; i < chld_out.lines; i++) { 389 for(size_t i = 0; i < chld_out.lines; i++) {
389 printf("%s\n", chld_out.line[i]); 390 printf("%s\n", chld_out.line[i]);
390 } 391 }
391 } 392 }
@@ -395,7 +396,7 @@ int run_update(void){
395 stderr_warning=1; 396 stderr_warning=1;
396 result = max_state(result, STATE_WARNING); 397 result = max_state(result, STATE_WARNING);
397 if(verbose){ 398 if(verbose){
398 for(i = 0; i < chld_err.lines; i++) { 399 for(size_t i = 0; i < chld_err.lines; i++) {
399 fprintf(stderr, "%s\n", chld_err.line[i]); 400 fprintf(stderr, "%s\n", chld_err.line[i]);
400 } 401 }
401 } 402 }
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 1ad547e..2a23b39 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -50,7 +50,7 @@ unsigned int services = 0;
50int skip_stdout = 0; 50int skip_stdout = 0;
51int skip_stderr = 0; 51int skip_stderr = 0;
52int warn_on_stderr = 0; 52int warn_on_stderr = 0;
53bool unknown_timeout = FALSE; 53bool unknown_timeout = false;
54char *remotecmd = NULL; 54char *remotecmd = NULL;
55char **commargv = NULL; 55char **commargv = NULL;
56int commargc = 0; 56int commargc = 0;
@@ -58,8 +58,8 @@ char *hostname = NULL;
58char *outputfile = NULL; 58char *outputfile = NULL;
59char *host_shortname = NULL; 59char *host_shortname = NULL;
60char **service; 60char **service;
61int passive = FALSE; 61bool passive = false;
62int verbose = FALSE; 62bool verbose = false;
63 63
64int 64int
65main (int argc, char **argv) 65main (int argc, char **argv)
@@ -68,7 +68,6 @@ main (int argc, char **argv)
68 char *status_text; 68 char *status_text;
69 int cresult; 69 int cresult;
70 int result = STATE_UNKNOWN; 70 int result = STATE_UNKNOWN;
71 int i;
72 time_t local_time; 71 time_t local_time;
73 FILE *fp = NULL; 72 FILE *fp = NULL;
74 output chld_out, chld_err; 73 output chld_out, chld_err;
@@ -96,7 +95,7 @@ main (int argc, char **argv)
96 /* run the command */ 95 /* run the command */
97 if (verbose) { 96 if (verbose) {
98 printf ("Command: %s\n", commargv[0]); 97 printf ("Command: %s\n", commargv[0]);
99 for (i=1; i<commargc; i++) 98 for (int i = 1; i < commargc; i++)
100 printf ("Argument %i: %s\n", i, commargv[i]); 99 printf ("Argument %i: %s\n", i, commargv[i]);
101 } 100 }
102 101
@@ -110,9 +109,9 @@ main (int argc, char **argv)
110 } 109 }
111 110
112 if (verbose) { 111 if (verbose) {
113 for(i = 0; i < chld_out.lines; i++) 112 for(size_t i = 0; i < chld_out.lines; i++)
114 printf("stdout: %s\n", chld_out.line[i]); 113 printf("stdout: %s\n", chld_out.line[i]);
115 for(i = 0; i < chld_err.lines; i++) 114 for(size_t i = 0; i < chld_err.lines; i++)
116 printf("stderr: %s\n", chld_err.line[i]); 115 printf("stderr: %s\n", chld_err.line[i]);
117 } 116 }
118 117
@@ -122,7 +121,7 @@ main (int argc, char **argv)
122 skip_stderr = chld_err.lines; 121 skip_stderr = chld_err.lines;
123 122
124 /* UNKNOWN or worse if (non-skipped) output found on stderr */ 123 /* UNKNOWN or worse if (non-skipped) output found on stderr */
125 if(chld_err.lines > skip_stderr) { 124 if(chld_err.lines > (size_t)skip_stderr) {
126 printf (_("Remote command execution failed: %s\n"), 125 printf (_("Remote command execution failed: %s\n"),
127 chld_err.line[skip_stderr]); 126 chld_err.line[skip_stderr]);
128 if ( warn_on_stderr ) 127 if ( warn_on_stderr )
@@ -134,8 +133,8 @@ main (int argc, char **argv)
134 /* this is simple if we're not supposed to be passive. 133 /* this is simple if we're not supposed to be passive.
135 * Wrap up quickly and keep the tricks below */ 134 * Wrap up quickly and keep the tricks below */
136 if(!passive) { 135 if(!passive) {
137 if (chld_out.lines > skip_stdout) 136 if (chld_out.lines > (size_t)skip_stdout)
138 for (i = skip_stdout; i < chld_out.lines; i++) 137 for (size_t i = skip_stdout; i < chld_out.lines; i++)
139 puts (chld_out.line[i]); 138 puts (chld_out.line[i]);
140 else 139 else
141 printf (_("%s - check_by_ssh: Remote command '%s' returned status %d\n"), 140 printf (_("%s - check_by_ssh: Remote command '%s' returned status %d\n"),
@@ -156,7 +155,7 @@ main (int argc, char **argv)
156 155
157 local_time = time (NULL); 156 local_time = time (NULL);
158 commands = 0; 157 commands = 0;
159 for(i = skip_stdout; i < chld_out.lines; i++) { 158 for(size_t i = skip_stdout; i < chld_out.lines; i++) {
160 status_text = chld_out.line[i++]; 159 status_text = chld_out.line[i++];
161 if (i == chld_out.lines || strstr (chld_out.line[i], "STATUS CODE: ") == NULL) 160 if (i == chld_out.lines || strstr (chld_out.line[i], "STATUS CODE: ") == NULL)
162 die (STATE_UNKNOWN, _("%s: Error parsing output\n"), progname); 161 die (STATE_UNKNOWN, _("%s: Error parsing output\n"), progname);
@@ -235,7 +234,7 @@ process_arguments (int argc, char **argv)
235 print_help (); 234 print_help ();
236 exit (STATE_UNKNOWN); 235 exit (STATE_UNKNOWN);
237 case 'v': /* help */ 236 case 'v': /* help */
238 verbose = TRUE; 237 verbose = true;
239 break; 238 break;
240 case 't': /* timeout period */ 239 case 't': /* timeout period */
241 if (!is_integer (optarg)) 240 if (!is_integer (optarg))
@@ -244,7 +243,7 @@ process_arguments (int argc, char **argv)
244 timeout_interval = atoi (optarg); 243 timeout_interval = atoi (optarg);
245 break; 244 break;
246 case 'U': 245 case 'U':
247 unknown_timeout = TRUE; 246 unknown_timeout = true;
248 break; 247 break;
249 case 'H': /* host */ 248 case 'H': /* host */
250 hostname = optarg; 249 hostname = optarg;
@@ -257,7 +256,7 @@ process_arguments (int argc, char **argv)
257 break; 256 break;
258 case 'O': /* output file */ 257 case 'O': /* output file */
259 outputfile = optarg; 258 outputfile = optarg;
260 passive = TRUE; 259 passive = true;
261 break; 260 break;
262 case 's': /* description of service to check */ 261 case 's': /* description of service to check */
263 p1 = optarg; 262 p1 = optarg;
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index d0871c4..d3bddac 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -134,6 +134,7 @@ char regexp[MAX_RE_SIZE];
134int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE; 134int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE;
135int errcode; 135int errcode;
136bool invert_regex = false; 136bool invert_regex = false;
137int state_regex = STATE_CRITICAL;
137 138
138char *server_address = NULL; 139char *server_address = NULL;
139char *host_name = NULL; 140char *host_name = NULL;
@@ -213,6 +214,7 @@ char *client_privkey = NULL;
213char *ca_cert = NULL; 214char *ca_cert = NULL;
214bool verify_peer_and_host = false; 215bool verify_peer_and_host = false;
215bool is_openssl_callback = false; 216bool is_openssl_callback = false;
217bool add_sslctx_verify_fun = false;
216#if defined(HAVE_SSL) && defined(USE_OPENSSL) 218#if defined(HAVE_SSL) && defined(USE_OPENSSL)
217X509 *cert = NULL; 219X509 *cert = NULL;
218#endif /* defined(HAVE_SSL) && defined(USE_OPENSSL) */ 220#endif /* defined(HAVE_SSL) && defined(USE_OPENSSL) */
@@ -223,6 +225,7 @@ curlhelp_ssl_library ssl_library = CURLHELP_SSL_LIBRARY_UNKNOWN;
223int curl_http_version = CURL_HTTP_VERSION_NONE; 225int curl_http_version = CURL_HTTP_VERSION_NONE;
224bool automatic_decompression = false; 226bool automatic_decompression = false;
225char *cookie_jar_file = NULL; 227char *cookie_jar_file = NULL;
228bool haproxy_protocol = false;
226 229
227bool process_arguments (int, char**); 230bool process_arguments (int, char**);
228void handle_curl_option_return_code (CURLcode res, const char* option); 231void handle_curl_option_return_code (CURLcode res, const char* option);
@@ -239,10 +242,10 @@ void print_help (void);
239void print_usage (void); 242void print_usage (void);
240void print_curl_version (void); 243void print_curl_version (void);
241int curlhelp_initwritebuffer (curlhelp_write_curlbuf*); 244int curlhelp_initwritebuffer (curlhelp_write_curlbuf*);
242int curlhelp_buffer_write_callback (void*, size_t , size_t , void*); 245size_t curlhelp_buffer_write_callback(void*, size_t , size_t , void*);
243void curlhelp_freewritebuffer (curlhelp_write_curlbuf*); 246void curlhelp_freewritebuffer (curlhelp_write_curlbuf*);
244int curlhelp_initreadbuffer (curlhelp_read_curlbuf *, const char *, size_t); 247int curlhelp_initreadbuffer (curlhelp_read_curlbuf *, const char *, size_t);
245int curlhelp_buffer_read_callback (void *, size_t , size_t , void *); 248size_t curlhelp_buffer_read_callback(void *, size_t , size_t , void *);
246void curlhelp_freereadbuffer (curlhelp_read_curlbuf *); 249void curlhelp_freereadbuffer (curlhelp_read_curlbuf *);
247curlhelp_ssl_library curlhelp_get_ssl_library (); 250curlhelp_ssl_library curlhelp_get_ssl_library ();
248const char* curlhelp_get_ssl_library_string (curlhelp_ssl_library); 251const char* curlhelp_get_ssl_library_string (curlhelp_ssl_library);
@@ -297,7 +300,7 @@ main (int argc, char **argv)
297 300
298int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) 301int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
299{ 302{
300 (void) preverify_ok; 303 (void) preverify_ok;
301 /* TODO: we get all certificates of the chain, so which ones 304 /* TODO: we get all certificates of the chain, so which ones
302 * should we test? 305 * should we test?
303 * TODO: is the last certificate always the server certificate? 306 * TODO: is the last certificate always the server certificate?
@@ -322,9 +325,18 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
322 325
323CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm) 326CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm)
324{ 327{
325 (void) curl; // ignore unused parameter 328 (void) curl; // ignore unused parameter
326 (void) parm; // ignore unused parameter 329 (void) parm; // ignore unused parameter
327 SSL_CTX_set_verify(sslctx, SSL_VERIFY_PEER, verify_callback); 330 if(add_sslctx_verify_fun) {
331 SSL_CTX_set_verify(sslctx, SSL_VERIFY_PEER, verify_callback);
332 }
333
334 // workaround for issue:
335 // OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0
336 // see discussion https://github.com/openssl/openssl/discussions/22690
337#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
338 SSL_CTX_set_options(sslctx, SSL_OP_IGNORE_UNEXPECTED_EOF);
339#endif
328 340
329 return CURLE_OK; 341 return CURLE_OK;
330} 342}
@@ -395,7 +407,7 @@ lookup_host (const char *host, char *buf, size_t buflen)
395 char addrstr[100]; 407 char addrstr[100];
396 size_t addrstr_len; 408 size_t addrstr_len;
397 int errcode; 409 int errcode;
398 void *ptr; 410 void *ptr = { 0 };
399 size_t buflen_remaining = buflen - 1; 411 size_t buflen_remaining = buflen - 1;
400 412
401 memset (&hints, 0, sizeof (hints)); 413 memset (&hints, 0, sizeof (hints));
@@ -466,6 +478,7 @@ int
466check_http (void) 478check_http (void)
467{ 479{
468 int result = STATE_OK; 480 int result = STATE_OK;
481 int result_ssl = STATE_OK;
469 int page_len = 0; 482 int page_len = 0;
470 int i; 483 int i;
471 char *force_host_header = NULL; 484 char *force_host_header = NULL;
@@ -485,7 +498,7 @@ check_http (void)
485 498
486 /* register cleanup function to shut down libcurl properly */ 499 /* register cleanup function to shut down libcurl properly */
487 atexit (cleanup); 500 atexit (cleanup);
488 501
489 if (verbose >= 1) 502 if (verbose >= 1)
490 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_VERBOSE, 1), "CURLOPT_VERBOSE"); 503 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_VERBOSE, 1), "CURLOPT_VERBOSE");
491 504
@@ -520,6 +533,11 @@ check_http (void)
520 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, socket_timeout), "CURLOPT_CONNECTTIMEOUT"); 533 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, socket_timeout), "CURLOPT_CONNECTTIMEOUT");
521 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_TIMEOUT, socket_timeout), "CURLOPT_TIMEOUT"); 534 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_TIMEOUT, socket_timeout), "CURLOPT_TIMEOUT");
522 535
536 /* enable haproxy protocol */
537 if (haproxy_protocol) {
538 handle_curl_option_return_code(curl_easy_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L), "CURLOPT_HAPROXYPROTOCOL");
539 }
540
523 // fill dns resolve cache to make curl connect to the given server_address instead of the host_name, only required for ssl, because we use the host_name later on to make SNI happy 541 // fill dns resolve cache to make curl connect to the given server_address instead of the host_name, only required for ssl, because we use the host_name later on to make SNI happy
524 if(use_ssl && host_name != NULL) { 542 if(use_ssl && host_name != NULL) {
525 if ( (res=lookup_host (server_address, addrstr, DEFAULT_BUFFER_SIZE/2)) != 0) { 543 if ( (res=lookup_host (server_address, addrstr, DEFAULT_BUFFER_SIZE/2)) != 0) {
@@ -670,9 +688,8 @@ check_http (void)
670 * OpenSSL-style libraries only!) */ 688 * OpenSSL-style libraries only!) */
671#ifdef USE_OPENSSL 689#ifdef USE_OPENSSL
672 /* libcurl and monitoring plugins built with OpenSSL, good */ 690 /* libcurl and monitoring plugins built with OpenSSL, good */
673 handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun), "CURLOPT_SSL_CTX_FUNCTION"); 691 add_sslctx_verify_fun = true;
674 is_openssl_callback = true; 692 is_openssl_callback = true;
675#else /* USE_OPENSSL */
676#endif /* USE_OPENSSL */ 693#endif /* USE_OPENSSL */
677 /* libcurl is built with OpenSSL, monitoring plugins, so falling 694 /* libcurl is built with OpenSSL, monitoring plugins, so falling
678 * back to manually extracting certificate information */ 695 * back to manually extracting certificate information */
@@ -705,12 +722,18 @@ check_http (void)
705#else /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1) */ 722#else /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1) */
706 /* old libcurl, our only hope is OpenSSL, otherwise we are out of luck */ 723 /* old libcurl, our only hope is OpenSSL, otherwise we are out of luck */
707 if (ssl_library == CURLHELP_SSL_LIBRARY_OPENSSL || ssl_library == CURLHELP_SSL_LIBRARY_LIBRESSL) 724 if (ssl_library == CURLHELP_SSL_LIBRARY_OPENSSL || ssl_library == CURLHELP_SSL_LIBRARY_LIBRESSL)
708 handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun), "CURLOPT_SSL_CTX_FUNCTION"); 725 add_sslctx_verify_fun = true;
709 else 726 else
710 die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates (no CURLOPT_SSL_CTX_FUNCTION, no OpenSSL library or libcurl too old and has no CURLOPT_CERTINFO)\n"); 727 die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates (no CURLOPT_SSL_CTX_FUNCTION, no OpenSSL library or libcurl too old and has no CURLOPT_CERTINFO)\n");
711#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1) */ 728#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1) */
712 } 729 }
713 730
731#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 10, 6) /* required for CURLOPT_SSL_CTX_FUNCTION */
732 // ssl ctx function is not available with all ssl backends
733 if (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, NULL) != CURLE_UNKNOWN_OPTION)
734 handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun), "CURLOPT_SSL_CTX_FUNCTION");
735#endif
736
714#endif /* LIBCURL_FEATURE_SSL */ 737#endif /* LIBCURL_FEATURE_SSL */
715 738
716 /* set default or user-given user agent identification */ 739 /* set default or user-given user agent identification */
@@ -805,7 +828,7 @@ check_http (void)
805 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_INFILESIZE, (curl_off_t)strlen (http_post_data)), "CURLOPT_INFILESIZE"); 828 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_INFILESIZE, (curl_off_t)strlen (http_post_data)), "CURLOPT_INFILESIZE");
806 } 829 }
807 } 830 }
808 831
809 /* cookie handling */ 832 /* cookie handling */
810 if (cookie_jar_file != NULL) { 833 if (cookie_jar_file != NULL) {
811 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_COOKIEJAR, cookie_jar_file), "CURLOPT_COOKIEJAR"); 834 handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_COOKIEJAR, cookie_jar_file), "CURLOPT_COOKIEJAR");
@@ -845,9 +868,9 @@ check_http (void)
845 /* check certificate with OpenSSL functions, curl has been built against OpenSSL 868 /* check certificate with OpenSSL functions, curl has been built against OpenSSL
846 * and we actually have OpenSSL in the monitoring tools 869 * and we actually have OpenSSL in the monitoring tools
847 */ 870 */
848 result = np_net_ssl_check_certificate(cert, days_till_exp_warn, days_till_exp_crit); 871 result_ssl = np_net_ssl_check_certificate(cert, days_till_exp_warn, days_till_exp_crit);
849 if (!continue_after_check_cert) { 872 if (!continue_after_check_cert) {
850 return result; 873 return result_ssl;
851 } 874 }
852#else /* USE_OPENSSL */ 875#else /* USE_OPENSSL */
853 die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates - OpenSSL callback used and not linked against OpenSSL\n"); 876 die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates - OpenSSL callback used and not linked against OpenSSL\n");
@@ -891,17 +914,17 @@ GOT_FIRST_CERT:
891 die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg); 914 die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
892 } 915 }
893 BIO_free (cert_BIO); 916 BIO_free (cert_BIO);
894 result = np_net_ssl_check_certificate(cert, days_till_exp_warn, days_till_exp_crit); 917 result_ssl = np_net_ssl_check_certificate(cert, days_till_exp_warn, days_till_exp_crit);
895 if (!continue_after_check_cert) { 918 if (!continue_after_check_cert) {
896 return result; 919 return result_ssl;
897 } 920 }
898#else /* USE_OPENSSL */ 921#else /* USE_OPENSSL */
899 /* We assume we don't have OpenSSL and np_net_ssl_check_certificate at our disposal, 922 /* We assume we don't have OpenSSL and np_net_ssl_check_certificate at our disposal,
900 * so we use the libcurl CURLINFO data 923 * so we use the libcurl CURLINFO data
901 */ 924 */
902 result = net_noopenssl_check_certificate(&cert_ptr, days_till_exp_warn, days_till_exp_crit); 925 result_ssl = net_noopenssl_check_certificate(&cert_ptr, days_till_exp_warn, days_till_exp_crit);
903 if (!continue_after_check_cert) { 926 if (!continue_after_check_cert) {
904 return result; 927 return result_ssl;
905 } 928 }
906#endif /* USE_OPENSSL */ 929#endif /* USE_OPENSSL */
907 } else { 930 } else {
@@ -1127,7 +1150,7 @@ GOT_FIRST_CERT:
1127 strcpy(msg, tmp); 1150 strcpy(msg, tmp);
1128 1151
1129 } 1152 }
1130 result = STATE_CRITICAL; 1153 result = state_regex;
1131 } else { 1154 } else {
1132 regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER); 1155 regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
1133 1156
@@ -1167,9 +1190,9 @@ GOT_FIRST_CERT:
1167 else 1190 else
1168 msg[strlen(msg)-3] = '\0'; 1191 msg[strlen(msg)-3] = '\0';
1169 } 1192 }
1170 1193
1171 /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */ 1194 /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */
1172 die (result, "HTTP %s: %s %d %s%s%s - %d bytes in %.3f second response time %s|%s\n%s%s", 1195 die (max_state_alt(result, result_ssl), "HTTP %s: %s %d %s%s%s - %d bytes in %.3f second response time %s|%s\n%s%s",
1173 state_text(result), string_statuscode (status_line.http_major, status_line.http_minor), 1196 state_text(result), string_statuscode (status_line.http_major, status_line.http_minor),
1174 status_line.http_code, status_line.msg, 1197 status_line.http_code, status_line.msg,
1175 strlen(msg) > 0 ? " - " : "", 1198 strlen(msg) > 0 ? " - " : "",
@@ -1179,23 +1202,23 @@ GOT_FIRST_CERT:
1179 (show_body ? body_buf.buf : ""), 1202 (show_body ? body_buf.buf : ""),
1180 (show_body ? "\n" : "") ); 1203 (show_body ? "\n" : "") );
1181 1204
1182 return result; 1205 return max_state_alt(result, result_ssl);
1183} 1206}
1184 1207
1185int 1208int
1186uri_strcmp (const UriTextRangeA range, const char* s) 1209uri_strcmp (const UriTextRangeA range, const char* s)
1187{ 1210{
1188 if (!range.first) return -1; 1211 if (!range.first) return -1;
1189 if (range.afterLast - range.first < strlen (s)) return -1; 1212 if ( (size_t)(range.afterLast - range.first) < strlen (s) ) return -1;
1190 return strncmp (s, range.first, min( range.afterLast - range.first, strlen (s))); 1213 return strncmp (s, range.first, min( (size_t)(range.afterLast - range.first), strlen (s)));
1191} 1214}
1192 1215
1193char* 1216char*
1194uri_string (const UriTextRangeA range, char* buf, size_t buflen) 1217uri_string (const UriTextRangeA range, char* buf, size_t buflen)
1195{ 1218{
1196 if (!range.first) return "(null)"; 1219 if (!range.first) return "(null)";
1197 strncpy (buf, range.first, max (buflen-1, range.afterLast - range.first)); 1220 strncpy (buf, range.first, max (buflen-1, (size_t)(range.afterLast - range.first)));
1198 buf[max (buflen-1, range.afterLast - range.first)] = '\0'; 1221 buf[max (buflen-1, (size_t)(range.afterLast - range.first))] = '\0';
1199 buf[range.afterLast - range.first] = '\0'; 1222 buf[range.afterLast - range.first] = '\0';
1200 return buf; 1223 return buf;
1201} 1224}
@@ -1218,6 +1241,10 @@ redir (curlhelp_write_curlbuf* header_buf)
1218 &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, 1241 &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
1219 headers, &nof_headers, 0); 1242 headers, &nof_headers, 0);
1220 1243
1244 if (res == -1) {
1245 die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
1246 }
1247
1221 location = get_header_value (headers, nof_headers, "location"); 1248 location = get_header_value (headers, nof_headers, "location");
1222 1249
1223 if (verbose >= 2) 1250 if (verbose >= 2)
@@ -1274,10 +1301,12 @@ redir (curlhelp_write_curlbuf* header_buf)
1274 } 1301 }
1275 } 1302 }
1276 1303
1277 if (!uri_strcmp (uri.scheme, "https")) 1304 if (uri.scheme.first) {
1278 use_ssl = true; 1305 if (!uri_strcmp (uri.scheme, "https"))
1279 else 1306 use_ssl = true;
1280 use_ssl = false; 1307 else
1308 use_ssl = false;
1309 }
1281 1310
1282 /* we do a sloppy test here only, because uriparser would have failed 1311 /* we do a sloppy test here only, because uriparser would have failed
1283 * above, if the port would be invalid, we just check for MAX_PORT 1312 * above, if the port would be invalid, we just check for MAX_PORT
@@ -1295,10 +1324,13 @@ redir (curlhelp_write_curlbuf* header_buf)
1295 MAX_PORT, location, display_html ? "</A>" : ""); 1324 MAX_PORT, location, display_html ? "</A>" : "");
1296 1325
1297 /* by RFC 7231 relative URLs in Location should be taken relative to 1326 /* by RFC 7231 relative URLs in Location should be taken relative to
1298 * the original URL, so wy try to form a new absolute URL here 1327 * the original URL, so we try to form a new absolute URL here
1299 */ 1328 */
1300 if (!uri.scheme.first && !uri.hostText.first) { 1329 if (!uri.scheme.first && !uri.hostText.first) {
1301 new_host = strdup (host_name ? host_name : server_address); 1330 new_host = strdup (host_name ? host_name : server_address);
1331 new_port = server_port;
1332 if(use_ssl)
1333 uri_string (uri.scheme, "https", DEFAULT_BUFFER_SIZE);
1302 } else { 1334 } else {
1303 new_host = strdup (uri_string (uri.hostText, buf, DEFAULT_BUFFER_SIZE)); 1335 new_host = strdup (uri_string (uri.hostText, buf, DEFAULT_BUFFER_SIZE));
1304 } 1336 }
@@ -1380,7 +1412,9 @@ process_arguments (int argc, char **argv)
1380 CA_CERT_OPTION, 1412 CA_CERT_OPTION,
1381 HTTP_VERSION_OPTION, 1413 HTTP_VERSION_OPTION,
1382 AUTOMATIC_DECOMPRESSION, 1414 AUTOMATIC_DECOMPRESSION,
1383 COOKIE_JAR 1415 COOKIE_JAR,
1416 HAPROXY_PROTOCOL,
1417 STATE_REGEX
1384 }; 1418 };
1385 1419
1386 int option = 0; 1420 int option = 0;
@@ -1419,6 +1453,7 @@ process_arguments (int argc, char **argv)
1419 {"content-type", required_argument, 0, 'T'}, 1453 {"content-type", required_argument, 0, 'T'},
1420 {"pagesize", required_argument, 0, 'm'}, 1454 {"pagesize", required_argument, 0, 'm'},
1421 {"invert-regex", no_argument, NULL, INVERT_REGEX}, 1455 {"invert-regex", no_argument, NULL, INVERT_REGEX},
1456 {"state-regex", required_argument, 0, STATE_REGEX},
1422 {"use-ipv4", no_argument, 0, '4'}, 1457 {"use-ipv4", no_argument, 0, '4'},
1423 {"use-ipv6", no_argument, 0, '6'}, 1458 {"use-ipv6", no_argument, 0, '6'},
1424 {"extended-perfdata", no_argument, 0, 'E'}, 1459 {"extended-perfdata", no_argument, 0, 'E'},
@@ -1427,6 +1462,7 @@ process_arguments (int argc, char **argv)
1427 {"http-version", required_argument, 0, HTTP_VERSION_OPTION}, 1462 {"http-version", required_argument, 0, HTTP_VERSION_OPTION},
1428 {"enable-automatic-decompression", no_argument, 0, AUTOMATIC_DECOMPRESSION}, 1463 {"enable-automatic-decompression", no_argument, 0, AUTOMATIC_DECOMPRESSION},
1429 {"cookie-jar", required_argument, 0, COOKIE_JAR}, 1464 {"cookie-jar", required_argument, 0, COOKIE_JAR},
1465 {"haproxy-protocol", no_argument, 0, HAPROXY_PROTOCOL},
1430 {0, 0, 0, 0} 1466 {0, 0, 0, 0}
1431 }; 1467 };
1432 1468
@@ -1694,7 +1730,7 @@ process_arguments (int argc, char **argv)
1694 else { 1730 else {
1695 max_depth = atoi (optarg); 1731 max_depth = atoi (optarg);
1696 } 1732 }
1697 break; 1733 break;
1698 case 'f': /* onredirect */ 1734 case 'f': /* onredirect */
1699 if (!strcmp (optarg, "ok")) 1735 if (!strcmp (optarg, "ok"))
1700 onredirect = STATE_OK; 1736 onredirect = STATE_OK;
@@ -1753,6 +1789,13 @@ process_arguments (int argc, char **argv)
1753 case INVERT_REGEX: 1789 case INVERT_REGEX:
1754 invert_regex = true; 1790 invert_regex = true;
1755 break; 1791 break;
1792 case STATE_REGEX:
1793 if (!strcasecmp (optarg, "critical"))
1794 state_regex = STATE_CRITICAL;
1795 else if (!strcasecmp (optarg, "warning"))
1796 state_regex = STATE_WARNING;
1797 else usage2 (_("Invalid state-regex option"), optarg);
1798 break;
1756 case '4': 1799 case '4':
1757 address_family = AF_INET; 1800 address_family = AF_INET;
1758 break; 1801 break;
@@ -1837,6 +1880,9 @@ process_arguments (int argc, char **argv)
1837 case COOKIE_JAR: 1880 case COOKIE_JAR:
1838 cookie_jar_file = optarg; 1881 cookie_jar_file = optarg;
1839 break; 1882 break;
1883 case HAPROXY_PROTOCOL:
1884 haproxy_protocol = true;
1885 break;
1840 case '?': 1886 case '?':
1841 /* print short usage statement if args not parsable */ 1887 /* print short usage statement if args not parsable */
1842 usage5 (); 1888 usage5 ();
@@ -1977,8 +2023,11 @@ print_help (void)
1977 printf (" %s\n", _("Note: SNI is not supported in libcurl before 7.18.1")); 2023 printf (" %s\n", _("Note: SNI is not supported in libcurl before 7.18.1"));
1978#endif 2024#endif
1979 printf (" %s\n", "-C, --certificate=INTEGER[,INTEGER]"); 2025 printf (" %s\n", "-C, --certificate=INTEGER[,INTEGER]");
1980 printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443")); 2026 printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443."));
1981 printf (" %s\n", _("(when this option is used the URL is not checked by default. You can use")); 2027 printf (" %s\n", _("A STATE_WARNING is returned if the certificate has a validity less than the"));
2028 printf (" %s\n", _("first agument's value. If there is a second argument and the certificate's"));
2029 printf (" %s\n", _("validity is less than its value, a STATE_CRITICAL is returned."));
2030 printf (" %s\n", _("(When this option is used the URL is not checked by default. You can use"));
1982 printf (" %s\n", _(" --continue-after-certificate to override this behavior)")); 2031 printf (" %s\n", _(" --continue-after-certificate to override this behavior)"));
1983 printf (" %s\n", "--continue-after-certificate"); 2032 printf (" %s\n", "--continue-after-certificate");
1984 printf (" %s\n", _("Allows the HTTP check to continue after performing the certificate check.")); 2033 printf (" %s\n", _("Allows the HTTP check to continue after performing the certificate check."));
@@ -2007,7 +2056,7 @@ print_help (void)
2007 printf (" %s\n", "-u, --url=PATH"); 2056 printf (" %s\n", "-u, --url=PATH");
2008 printf (" %s\n", _("URL to GET or POST (default: /)")); 2057 printf (" %s\n", _("URL to GET or POST (default: /)"));
2009 printf (" %s\n", "-P, --post=STRING"); 2058 printf (" %s\n", "-P, --post=STRING");
2010 printf (" %s\n", _("URL encoded http POST data")); 2059 printf (" %s\n", _("URL decoded http POST data"));
2011 printf (" %s\n", "-j, --method=STRING (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT)"); 2060 printf (" %s\n", "-j, --method=STRING (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT)");
2012 printf (" %s\n", _("Set HTTP method.")); 2061 printf (" %s\n", _("Set HTTP method."));
2013 printf (" %s\n", "-N, --no-body"); 2062 printf (" %s\n", "-N, --no-body");
@@ -2025,7 +2074,10 @@ print_help (void)
2025 printf (" %s\n", "-R, --eregi=STRING"); 2074 printf (" %s\n", "-R, --eregi=STRING");
2026 printf (" %s\n", _("Search page for case-insensitive regex STRING")); 2075 printf (" %s\n", _("Search page for case-insensitive regex STRING"));
2027 printf (" %s\n", "--invert-regex"); 2076 printf (" %s\n", "--invert-regex");
2028 printf (" %s\n", _("Return CRITICAL if found, OK if not\n")); 2077 printf (" %s\n", _("Return STATE if found, OK if not (STATE is CRITICAL, per default)"));
2078 printf (" %s\n", _("can be changed with --state--regex)"));
2079 printf (" %s\n", "--state-regex=STATE");
2080 printf (" %s\n", _("Return STATE if regex is found, OK if not. STATE can be one of \"critical\",\"warning\""));
2029 printf (" %s\n", "-a, --authorization=AUTH_PAIR"); 2081 printf (" %s\n", "-a, --authorization=AUTH_PAIR");
2030 printf (" %s\n", _("Username:password on sites with basic authentication")); 2082 printf (" %s\n", _("Username:password on sites with basic authentication"));
2031 printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR"); 2083 printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
@@ -2056,7 +2108,9 @@ print_help (void)
2056 printf (" %s\n", _("1.0 = HTTP/1.0, 1.1 = HTTP/1.1, 2.0 = HTTP/2 (HTTP/2 will fail without -S)")); 2108 printf (" %s\n", _("1.0 = HTTP/1.0, 1.1 = HTTP/1.1, 2.0 = HTTP/2 (HTTP/2 will fail without -S)"));
2057 printf (" %s\n", "--enable-automatic-decompression"); 2109 printf (" %s\n", "--enable-automatic-decompression");
2058 printf (" %s\n", _("Enable automatic decompression of body (CURLOPT_ACCEPT_ENCODING).")); 2110 printf (" %s\n", _("Enable automatic decompression of body (CURLOPT_ACCEPT_ENCODING)."));
2059 printf (" %s\n", "---cookie-jar=FILE"); 2111 printf(" %s\n", "--haproxy-protocol");
2112 printf(" %s\n", _("Send HAProxy proxy protocol v1 header (CURLOPT_HAPROXYPROTOCOL)."));
2113 printf (" %s\n", "--cookie-jar=FILE");
2060 printf (" %s\n", _("Store cookies in the cookie jar and send them out when requested.")); 2114 printf (" %s\n", _("Store cookies in the cookie jar and send them out when requested."));
2061 printf ("\n"); 2115 printf ("\n");
2062 2116
@@ -2140,7 +2194,7 @@ print_usage (void)
2140 printf (" [-b proxy_auth] [-f <ok|warning|critical|follow|sticky|stickyport|curl>]\n"); 2194 printf (" [-b proxy_auth] [-f <ok|warning|critical|follow|sticky|stickyport|curl>]\n");
2141 printf (" [-e <expect>] [-d string] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n"); 2195 printf (" [-e <expect>] [-d string] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
2142 printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n"); 2196 printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
2143 printf (" [-A string] [-k string] [-S <version>] [--sni]\n"); 2197 printf (" [-A string] [-k string] [-S <version>] [--sni] [--haproxy-protocol]\n");
2144 printf (" [-T <content-type>] [-j method]\n"); 2198 printf (" [-T <content-type>] [-j method]\n");
2145 printf (" [--http-version=<version>] [--enable-automatic-decompression]\n"); 2199 printf (" [--http-version=<version>] [--enable-automatic-decompression]\n");
2146 printf (" [--cookie-jar=<cookie jar file>\n"); 2200 printf (" [--cookie-jar=<cookie jar file>\n");
@@ -2151,8 +2205,6 @@ print_usage (void)
2151 printf ("%s\n", _("In the first form, make an HTTP request.")); 2205 printf ("%s\n", _("In the first form, make an HTTP request."));
2152 printf ("%s\n\n", _("In the second form, connect to the server and check the TLS certificate.")); 2206 printf ("%s\n\n", _("In the second form, connect to the server and check the TLS certificate."));
2153#endif 2207#endif
2154 printf ("%s\n", _("WARNING: check_curl is experimental. Please use"));
2155 printf ("%s\n\n", _("check_http if you need a stable version."));
2156} 2208}
2157 2209
2158void 2210void
@@ -2171,8 +2223,7 @@ curlhelp_initwritebuffer (curlhelp_write_curlbuf *buf)
2171 return 0; 2223 return 0;
2172} 2224}
2173 2225
2174int 2226size_t curlhelp_buffer_write_callback (void *buffer, size_t size, size_t nmemb, void *stream)
2175curlhelp_buffer_write_callback (void *buffer, size_t size, size_t nmemb, void *stream)
2176{ 2227{
2177 curlhelp_write_curlbuf *buf = (curlhelp_write_curlbuf *)stream; 2228 curlhelp_write_curlbuf *buf = (curlhelp_write_curlbuf *)stream;
2178 2229
@@ -2192,8 +2243,7 @@ curlhelp_buffer_write_callback (void *buffer, size_t size, size_t nmemb, void *s
2192 return (int)(size * nmemb); 2243 return (int)(size * nmemb);
2193} 2244}
2194 2245
2195int 2246size_t curlhelp_buffer_read_callback(void *buffer, size_t size, size_t nmemb, void *stream)
2196curlhelp_buffer_read_callback (void *buffer, size_t size, size_t nmemb, void *stream)
2197{ 2247{
2198 curlhelp_read_curlbuf *buf = (curlhelp_read_curlbuf *)stream; 2248 curlhelp_read_curlbuf *buf = (curlhelp_read_curlbuf *)stream;
2199 2249
@@ -2366,8 +2416,7 @@ remove_newlines (char *s)
2366char * 2416char *
2367get_header_value (const struct phr_header* headers, const size_t nof_headers, const char* header) 2417get_header_value (const struct phr_header* headers, const size_t nof_headers, const char* header)
2368{ 2418{
2369 int i; 2419 for(size_t i = 0; i < nof_headers; i++ ) {
2370 for( i = 0; i < nof_headers; i++ ) {
2371 if(headers[i].name != NULL && strncasecmp( header, headers[i].name, max( headers[i].name_len, 4 ) ) == 0 ) { 2420 if(headers[i].name != NULL && strncasecmp( header, headers[i].name, max( headers[i].name_len, 4 ) ) == 0 ) {
2372 return strndup( headers[i].value, headers[i].value_len ); 2421 return strndup( headers[i].value, headers[i].value_len );
2373 } 2422 }
@@ -2390,6 +2439,10 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA
2390 &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, 2439 &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
2391 headers, &nof_headers, 0); 2440 headers, &nof_headers, 0);
2392 2441
2442 if (res == -1) {
2443 die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
2444 }
2445
2393 server_date = get_header_value (headers, nof_headers, "date"); 2446 server_date = get_header_value (headers, nof_headers, "date");
2394 document_date = get_header_value (headers, nof_headers, "last-modified"); 2447 document_date = get_header_value (headers, nof_headers, "last-modified");
2395 2448
@@ -2465,9 +2518,7 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA
2465int 2518int
2466get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf) 2519get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf)
2467{ 2520{
2468 const char *s; 2521 size_t content_length = 0;
2469 int content_length = 0;
2470 char *copy;
2471 struct phr_header headers[255]; 2522 struct phr_header headers[255];
2472 size_t nof_headers = 255; 2523 size_t nof_headers = 255;
2473 size_t msglen; 2524 size_t msglen;
@@ -2478,6 +2529,10 @@ get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_wri
2478 &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, 2529 &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
2479 headers, &nof_headers, 0); 2530 headers, &nof_headers, 0);
2480 2531
2532 if (res == -1) {
2533 die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
2534 }
2535
2481 content_length_s = get_header_value (headers, nof_headers, "content-length"); 2536 content_length_s = get_header_value (headers, nof_headers, "content-length");
2482 if (!content_length_s) { 2537 if (!content_length_s) {
2483 return header_buf->buflen + body_buf->buflen; 2538 return header_buf->buflen + body_buf->buflen;
diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c
index c24ca24..29c8520 100644
--- a/plugins/check_dbi.c
+++ b/plugins/check_dbi.c
@@ -141,7 +141,7 @@ main (int argc, char **argv)
141 if (verbose > 2) 141 if (verbose > 2)
142 printf ("Initializing DBI\n"); 142 printf ("Initializing DBI\n");
143 143
144 dbi_inst *instance_p; 144 dbi_inst *instance_p = { 0 };
145 145
146 if (dbi_initialize_r(NULL, instance_p) < 0) { 146 if (dbi_initialize_r(NULL, instance_p) < 0) {
147 printf ("UNKNOWN - failed to initialize DBI; possibly you don't have any drivers installed.\n"); 147 printf ("UNKNOWN - failed to initialize DBI; possibly you don't have any drivers installed.\n");
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 5d85ae2..be7a610 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -56,7 +56,7 @@ char *expected_address = NULL;
56char *dns_server = NULL; 56char *dns_server = NULL;
57char *dig_args = ""; 57char *dig_args = "";
58char *query_transport = ""; 58char *query_transport = "";
59int verbose = FALSE; 59bool verbose = false;
60int server_port = DEFAULT_PORT; 60int server_port = DEFAULT_PORT;
61int number_tries = DEFAULT_TRIES; 61int number_tries = DEFAULT_TRIES;
62double warning_interval = UNDEFINED; 62double warning_interval = UNDEFINED;
@@ -176,11 +176,11 @@ main (int argc, char **argv)
176 state_text (result), elapsed_time, 176 state_text (result), elapsed_time,
177 msg ? msg : _("Probably a non-existent host/domain"), 177 msg ? msg : _("Probably a non-existent host/domain"),
178 fperfdata("time", elapsed_time, "s", 178 fperfdata("time", elapsed_time, "s",
179 (warning_interval>UNDEFINED?TRUE:FALSE), 179 (warning_interval>UNDEFINED ? true:false),
180 warning_interval, 180 warning_interval,
181 (critical_interval>UNDEFINED?TRUE:FALSE), 181 (critical_interval>UNDEFINED ? true:false),
182 critical_interval, 182 critical_interval,
183 TRUE, 0, FALSE, 0)); 183 true, 0, false, 0));
184 return result; 184 return result;
185} 185}
186 186
@@ -270,7 +270,7 @@ process_arguments (int argc, char **argv)
270 dig_args = strdup(optarg); 270 dig_args = strdup(optarg);
271 break; 271 break;
272 case 'v': /* verbose */ 272 case 'v': /* verbose */
273 verbose = TRUE; 273 verbose = true;
274 break; 274 break;
275 case 'T': 275 case 'T':
276 record_type = optarg; 276 record_type = optarg;
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 05e5502..b3dd301 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -46,7 +46,7 @@ const char *email = "devel@monitoring-plugins.org";
46#include <stdarg.h> 46#include <stdarg.h>
47#include "fsusage.h" 47#include "fsusage.h"
48#include "mountlist.h" 48#include "mountlist.h"
49#include "intprops.h" /* necessary for TYPE_MAXIMUM */ 49#include <float.h>
50#if HAVE_LIMITS_H 50#if HAVE_LIMITS_H
51# include <limits.h> 51# include <limits.h>
52#endif 52#endif
@@ -93,11 +93,11 @@ static int stat_remote_fs = 0;
93 93
94/* Linked list of filesystem types to omit. 94/* Linked list of filesystem types to omit.
95 If the list is empty, don't exclude any types. */ 95 If the list is empty, don't exclude any types. */
96static struct name_list *fs_exclude_list; 96static struct regex_list *fs_exclude_list = NULL;
97 97
98/* Linked list of filesystem types to check. 98/* Linked list of filesystem types to check.
99 If the list is empty, include all types. */ 99 If the list is empty, include all types. */
100static struct name_list *fs_include_list; 100static struct regex_list *fs_include_list;
101 101
102static struct name_list *dp_exclude_list; 102static struct name_list *dp_exclude_list;
103 103
@@ -112,52 +112,48 @@ enum
112{ 112{
113 SYNC_OPTION = CHAR_MAX + 1, 113 SYNC_OPTION = CHAR_MAX + 1,
114 NO_SYNC_OPTION, 114 NO_SYNC_OPTION,
115 BLOCK_SIZE_OPTION, 115 BLOCK_SIZE_OPTION
116 IGNORE_MISSING
117}; 116};
118 117
119#ifdef _AIX 118#ifdef _AIX
120#pragma alloca 119#pragma alloca
121#endif 120#endif
122 121
123int process_arguments (int, char **); 122static int process_arguments (int, char **);
124void print_path (const char *mypath); 123static void set_all_thresholds (struct parameter_list *path);
125void set_all_thresholds (struct parameter_list *path); 124static void print_help (void);
126int validate_arguments (uintmax_t, uintmax_t, double, double, double, double, char *);
127void print_help (void);
128void print_usage (void); 125void print_usage (void);
129double calculate_percent(uintmax_t, uintmax_t); 126static double calculate_percent(uintmax_t, uintmax_t);
130bool stat_path (struct parameter_list *p); 127static bool stat_path (struct parameter_list *p);
131void get_stats (struct parameter_list *p, struct fs_usage *fsp); 128static void get_stats (struct parameter_list *p, struct fs_usage *fsp);
132void get_path_stats (struct parameter_list *p, struct fs_usage *fsp); 129static void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
133 130
134char *exclude_device; 131static char *units;
135char *units; 132static uintmax_t mult = 1024 * 1024;
136uintmax_t mult = 1024 * 1024; 133static int verbose = 0;
137int verbose = 0; 134static bool erronly = false;
138int erronly = FALSE; 135static bool display_mntp = false;
139int display_mntp = FALSE; 136static bool exact_match = false;
140int exact_match = FALSE; 137static bool ignore_missing = false;
141bool ignore_missing = false; 138static bool freespace_ignore_reserved = false;
142int freespace_ignore_reserved = FALSE; 139static bool display_inodes_perfdata = false;
143int display_inodes_perfdata = FALSE; 140static char *warn_freespace_units = NULL;
144char *warn_freespace_units = NULL; 141static char *crit_freespace_units = NULL;
145char *crit_freespace_units = NULL; 142static char *warn_freespace_percent = NULL;
146char *warn_freespace_percent = NULL; 143static char *crit_freespace_percent = NULL;
147char *crit_freespace_percent = NULL; 144static char *warn_usedspace_units = NULL;
148char *warn_usedspace_units = NULL; 145static char *crit_usedspace_units = NULL;
149char *crit_usedspace_units = NULL; 146static char *warn_usedspace_percent = NULL;
150char *warn_usedspace_percent = NULL; 147static char *crit_usedspace_percent = NULL;
151char *crit_usedspace_percent = NULL; 148static char *warn_usedinodes_percent = NULL;
152char *warn_usedinodes_percent = NULL; 149static char *crit_usedinodes_percent = NULL;
153char *crit_usedinodes_percent = NULL; 150static char *warn_freeinodes_percent = NULL;
154char *warn_freeinodes_percent = NULL; 151static char *crit_freeinodes_percent = NULL;
155char *crit_freeinodes_percent = NULL; 152static bool path_selected = false;
156int path_selected = FALSE; 153static bool path_ignored = false;
157bool path_ignored = false; 154static char *group = NULL;
158char *group = NULL; 155static struct stat *stat_buf;
159struct stat *stat_buf; 156static struct name_list *seen = NULL;
160struct name_list *seen = NULL;
161 157
162 158
163int 159int
@@ -205,7 +201,7 @@ main (int argc, char **argv)
205 /* If a list of paths has not been selected, find entire 201 /* If a list of paths has not been selected, find entire
206 mount list and create list of paths 202 mount list and create list of paths
207 */ 203 */
208 if (path_selected == FALSE && path_ignored == false) { 204 if (path_selected == false && path_ignored == false) {
209 for (me = mount_list; me; me = me->me_next) { 205 for (me = mount_list; me; me = me->me_next) {
210 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) { 206 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) {
211 path = np_add_parameter(&path_select_list, me->me_mountdir); 207 path = np_add_parameter(&path_select_list, me->me_mountdir);
@@ -300,7 +296,7 @@ main (int argc, char **argv)
300 } else if (me->me_dummy && !show_all_fs) { 296 } else if (me->me_dummy && !show_all_fs) {
301 continue; 297 continue;
302 /* Skip excluded fstypes */ 298 /* Skip excluded fstypes */
303 } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { 299 } else if (fs_exclude_list && np_find_regmatch (fs_exclude_list, me->me_type)) {
304 continue; 300 continue;
305 /* Skip excluded fs's */ 301 /* Skip excluded fs's */
306 } else if (dp_exclude_list && 302 } else if (dp_exclude_list &&
@@ -308,7 +304,7 @@ main (int argc, char **argv)
308 np_find_name (dp_exclude_list, me->me_mountdir))) { 304 np_find_name (dp_exclude_list, me->me_mountdir))) {
309 continue; 305 continue;
310 /* Skip not included fstypes */ 306 /* Skip not included fstypes */
311 } else if (fs_include_list && !np_find_name (fs_include_list, me->me_type)) { 307 } else if (fs_include_list && !np_find_regmatch(fs_include_list, me->me_type)) {
312 continue; 308 continue;
313 } 309 }
314 } 310 }
@@ -326,7 +322,7 @@ main (int argc, char **argv)
326 get_stats (path, &fsp); 322 get_stats (path, &fsp);
327 323
328 if (verbose >= 3) { 324 if (verbose >= 3) {
329 printf ("For %s, used_pct=%g free_pct=%g used_units=%lu free_units=%lu total_units=%lu used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%lu mult=%lu\n", 325 printf ("For %s, used_pct=%f free_pct=%f used_units=%lu free_units=%lu total_units=%lu used_inodes_pct=%f free_inodes_pct=%f fsp.fsu_blocksize=%lu mult=%lu\n",
330 me->me_mountdir, 326 me->me_mountdir,
331 path->dused_pct, 327 path->dused_pct,
332 path->dfree_pct, 328 path->dfree_pct,
@@ -396,10 +392,10 @@ main (int argc, char **argv)
396 perfdata_uint64 ( 392 perfdata_uint64 (
397 (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, 393 (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
398 path->dused_units * mult, "B", 394 path->dused_units * mult, "B",
399 (warning_high_tide == UINT64_MAX ? FALSE : TRUE), warning_high_tide, 395 (warning_high_tide == UINT64_MAX ? false : true), warning_high_tide,
400 (critical_high_tide == UINT64_MAX ? FALSE : TRUE), critical_high_tide, 396 (critical_high_tide == UINT64_MAX ? false : true), critical_high_tide,
401 TRUE, 0, 397 true, 0,
402 TRUE, path->dtotal_units * mult)); 398 true, path->dtotal_units * mult));
403 399
404 if (display_inodes_perfdata) { 400 if (display_inodes_perfdata) {
405 /* *_high_tide must be reinitialized at each run */ 401 /* *_high_tide must be reinitialized at each run */
@@ -418,10 +414,10 @@ main (int argc, char **argv)
418 xasprintf (&perf, "%s %s", perf, 414 xasprintf (&perf, "%s %s", perf,
419 perfdata_uint64 (perf_ilabel, 415 perfdata_uint64 (perf_ilabel,
420 path->inodes_used, "", 416 path->inodes_used, "",
421 (warning_high_tide != UINT64_MAX ? TRUE : FALSE), warning_high_tide, 417 (warning_high_tide != UINT64_MAX ? true : false), warning_high_tide,
422 (critical_high_tide != UINT64_MAX ? TRUE : FALSE), critical_high_tide, 418 (critical_high_tide != UINT64_MAX ? true : false), critical_high_tide,
423 TRUE, 0, 419 true, 0,
424 TRUE, path->inodes_total)); 420 true, path->inodes_total));
425 } 421 }
426 422
427 if (disk_result==STATE_OK && erronly && !verbose) 423 if (disk_result==STATE_OK && erronly && !verbose)
@@ -432,7 +428,7 @@ main (int argc, char **argv)
432 } else { 428 } else {
433 xasprintf(&flag_header, ""); 429 xasprintf(&flag_header, "");
434 } 430 }
435 xasprintf (&output, "%s%s %s %llu%s (%.0f%%", 431 xasprintf (&output, "%s%s %s %llu%s (%.1f%%",
436 output, flag_header, 432 output, flag_header,
437 (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir, 433 (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
438 path->dfree_units, 434 path->dfree_units,
@@ -452,7 +448,7 @@ main (int argc, char **argv)
452 448
453 if (strcmp(output, "") == 0 && ! erronly) { 449 if (strcmp(output, "") == 0 && ! erronly) {
454 preamble = ""; 450 preamble = "";
455 xasprintf (&output, " - No disks were found for provided parameters;"); 451 xasprintf (&output, " - No disks were found for provided parameters");
456 } 452 }
457 453
458 printf ("DISK %s%s%s%s%s|%s\n", state_text (result), ((erronly && result==STATE_OK)) ? "" : preamble, output, (strcmp(ignored, "") == 0) ? "" : ignored_preamble, ignored, perf); 454 printf ("DISK %s%s%s%s%s|%s\n", state_text (result), ((erronly && result==STATE_OK)) ? "" : preamble, output, (strcmp(ignored, "") == 0) ? "" : ignored_preamble, ignored, perf);
@@ -462,24 +458,8 @@ main (int argc, char **argv)
462 458
463double calculate_percent(uintmax_t value, uintmax_t total) { 459double calculate_percent(uintmax_t value, uintmax_t total) {
464 double pct = -1; 460 double pct = -1;
465 /* I don't understand the below, but it is taken from coreutils' df */ 461 if(value <= DBL_MAX && total != 0) {
466 /* Seems to be calculating pct, in the best possible way */ 462 pct = (double)value / total * 100.0;
467 if (value <= TYPE_MAXIMUM(uintmax_t) / 100
468 && total != 0) {
469 uintmax_t u100 = value * 100;
470 pct = u100 / total + (u100 % total != 0);
471 } else {
472 /* Possible rounding errors - see coreutils' df for more explanation */
473 double u = value;
474 double t = total;
475 if (t) {
476 long int lipct = pct = u * 100 / t;
477 double ipct = lipct;
478
479 /* Like 'pct = ceil (dpct);', but without ceil - from coreutils again */
480 if (ipct - 1 < pct && pct <= ipct + 1)
481 pct = ipct + (ipct < pct);
482 }
483 } 463 }
484 return pct; 464 return pct;
485} 465}
@@ -524,7 +504,7 @@ process_arguments (int argc, char **argv)
524 {"ignore-ereg-partition", required_argument, 0, 'i'}, 504 {"ignore-ereg-partition", required_argument, 0, 'i'},
525 {"ignore-eregi-path", required_argument, 0, 'I'}, 505 {"ignore-eregi-path", required_argument, 0, 'I'},
526 {"ignore-eregi-partition", required_argument, 0, 'I'}, 506 {"ignore-eregi-partition", required_argument, 0, 'I'},
527 {"ignore-missing", no_argument, 0, IGNORE_MISSING}, 507 {"ignore-missing", no_argument, 0, 'n'},
528 {"local", no_argument, 0, 'l'}, 508 {"local", no_argument, 0, 'l'},
529 {"stat-remote-fs", no_argument, 0, 'L'}, 509 {"stat-remote-fs", no_argument, 0, 'L'},
530 {"iperfdata", no_argument, 0, 'P'}, 510 {"iperfdata", no_argument, 0, 'P'},
@@ -543,14 +523,14 @@ process_arguments (int argc, char **argv)
543 if (argc < 2) 523 if (argc < 2)
544 return ERROR; 524 return ERROR;
545 525
546 np_add_name(&fs_exclude_list, "iso9660"); 526 np_add_regex(&fs_exclude_list, "iso9660", REG_EXTENDED);
547 527
548 for (c = 1; c < argc; c++) 528 for (c = 1; c < argc; c++)
549 if (strcmp ("-to", argv[c]) == 0) 529 if (strcmp ("-to", argv[c]) == 0)
550 strcpy (argv[c], "-t"); 530 strcpy (argv[c], "-t");
551 531
552 while (1) { 532 while (1) {
553 c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLPg:R:r:i:I:MEA", longopts, &option); 533 c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLPg:R:r:i:I:MEAn", longopts, &option);
554 534
555 if (c == -1 || c == EOF) 535 if (c == -1 || c == EOF)
556 break; 536 break;
@@ -567,6 +547,10 @@ process_arguments (int argc, char **argv)
567 547
568 /* See comments for 'c' */ 548 /* See comments for 'c' */
569 case 'w': /* warning threshold */ 549 case 'w': /* warning threshold */
550 if (!is_percentage_expression(optarg) && !is_numeric(optarg)) {
551 die(STATE_UNKNOWN, "Argument for --warning invalid or missing: %s\n", optarg);
552 }
553
570 if (strstr(optarg, "%")) { 554 if (strstr(optarg, "%")) {
571 if (*optarg == '@') { 555 if (*optarg == '@') {
572 warn_freespace_percent = optarg; 556 warn_freespace_percent = optarg;
@@ -588,6 +572,10 @@ process_arguments (int argc, char **argv)
588 force @ at the beginning of the range, so that it is backwards compatible 572 force @ at the beginning of the range, so that it is backwards compatible
589 */ 573 */
590 case 'c': /* critical threshold */ 574 case 'c': /* critical threshold */
575 if (!is_percentage_expression(optarg) && !is_numeric(optarg)) {
576 die(STATE_UNKNOWN, "Argument for --critical invalid or missing: %s\n", optarg);
577 }
578
591 if (strstr(optarg, "%")) { 579 if (strstr(optarg, "%")) {
592 if (*optarg == '@') { 580 if (*optarg == '@') {
593 crit_freespace_percent = optarg; 581 crit_freespace_percent = optarg;
@@ -710,34 +698,42 @@ process_arguments (int argc, char **argv)
710 mount_list = read_file_system_list (0); 698 mount_list = read_file_system_list (0);
711 np_set_best_match(se, mount_list, exact_match); 699 np_set_best_match(se, mount_list, exact_match);
712 700
713 path_selected = TRUE; 701 path_selected = true;
714 break; 702 break;
715 case 'x': /* exclude path or partition */ 703 case 'x': /* exclude path or partition */
716 np_add_name(&dp_exclude_list, optarg); 704 np_add_name(&dp_exclude_list, optarg);
717 break; 705 break;
718 case 'X': /* exclude file system type */ 706 case 'X': /* exclude file system type */
719 np_add_name(&fs_exclude_list, optarg); 707 err = np_add_regex(&fs_exclude_list, optarg, REG_EXTENDED);
708 if (err != 0) {
709 regerror (err, &fs_exclude_list->regex, errbuf, MAX_INPUT_BUFFER);
710 die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), _("Could not compile regular expression"), errbuf);
711 }
720 break; 712 break;
721 case 'N': /* include file system type */ 713 case 'N': /* include file system type */
722 np_add_name(&fs_include_list, optarg); 714 err = np_add_regex(&fs_include_list, optarg, REG_EXTENDED);
715 if (err != 0) {
716 regerror (err, &fs_exclude_list->regex, errbuf, MAX_INPUT_BUFFER);
717 die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), _("Could not compile regular expression"), errbuf);
718 }
723 break; 719 break;
724 case 'v': /* verbose */ 720 case 'v': /* verbose */
725 verbose++; 721 verbose++;
726 break; 722 break;
727 case 'q': /* TODO: this function should eventually go away (removed 2007-09-20) */ 723 case 'q': /* TODO: this function should eventually go away (removed 2007-09-20) */
728 /* verbose--; **replaced by line below**. -q was only a broken way of implementing -e */ 724 /* verbose--; **replaced by line below**. -q was only a broken way of implementing -e */
729 erronly = TRUE; 725 erronly = true;
730 break; 726 break;
731 case 'e': 727 case 'e':
732 erronly = TRUE; 728 erronly = true;
733 break; 729 break;
734 case 'E': 730 case 'E':
735 if (path_selected) 731 if (path_selected)
736 die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set -E before selecting paths\n")); 732 die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set -E before selecting paths\n"));
737 exact_match = TRUE; 733 exact_match = true;
738 break; 734 break;
739 case 'f': 735 case 'f':
740 freespace_ignore_reserved = TRUE; 736 freespace_ignore_reserved = true;
741 break; 737 break;
742 case 'g': 738 case 'g':
743 if (path_selected) 739 if (path_selected)
@@ -784,7 +780,7 @@ process_arguments (int argc, char **argv)
784 cflags = default_cflags; 780 cflags = default_cflags;
785 break; 781 break;
786 782
787 case IGNORE_MISSING: 783 case 'n':
788 ignore_missing = true; 784 ignore_missing = true;
789 break; 785 break;
790 case 'A': 786 case 'A':
@@ -798,7 +794,7 @@ process_arguments (int argc, char **argv)
798 crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || 794 crit_freespace_percent || warn_usedspace_units || crit_usedspace_units ||
799 warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || 795 warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent ||
800 crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { 796 crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) {
801 die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set a threshold value before using -r/-R\n")); 797 die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set a threshold value before using -r/-R/-A (--ereg-path/--eregi-path/--all)\n"));
802 } 798 }
803 799
804 err = regcomp(&re, optarg, cflags); 800 err = regcomp(&re, optarg, cflags);
@@ -809,7 +805,7 @@ process_arguments (int argc, char **argv)
809 805
810 for (me = mount_list; me; me = me->me_next) { 806 for (me = mount_list; me; me = me->me_next) {
811 if (np_regex_match_mount_entry(me, &re)) { 807 if (np_regex_match_mount_entry(me, &re)) {
812 fnd = TRUE; 808 fnd = true;
813 if (verbose >= 3) 809 if (verbose >= 3)
814 printf("%s %s matching expression %s\n", me->me_devname, me->me_mountdir, optarg); 810 printf("%s %s matching expression %s\n", me->me_devname, me->me_mountdir, optarg);
815 811
@@ -824,24 +820,24 @@ process_arguments (int argc, char **argv)
824 820
825 if (!fnd && ignore_missing == true) { 821 if (!fnd && ignore_missing == true) {
826 path_ignored = true; 822 path_ignored = true;
827 /* path_selected = TRUE;*/ 823 path_selected = true;
828 break; 824 break;
829 } else if (!fnd) 825 } else if (!fnd)
830 die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), 826 die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"),
831 _("Regular expression did not match any path or disk"), optarg); 827 _("Regular expression did not match any path or disk"), optarg);
832 828
833 fnd = FALSE; 829 fnd = false;
834 path_selected = TRUE; 830 path_selected = true;
835 np_set_best_match(path_select_list, mount_list, exact_match); 831 np_set_best_match(path_select_list, mount_list, exact_match);
836 cflags = default_cflags; 832 cflags = default_cflags;
837 833
838 break; 834 break;
839 case 'M': /* display mountpoint */ 835 case 'M': /* display mountpoint */
840 display_mntp = TRUE; 836 display_mntp = true;
841 break; 837 break;
842 case 'C': 838 case 'C':
843 /* add all mount entries to path_select list if no partitions have been explicitly defined using -p */ 839 /* add all mount entries to path_select list if no partitions have been explicitly defined using -p */
844 if (path_selected == FALSE) { 840 if (path_selected == false) {
845 struct parameter_list *path; 841 struct parameter_list *path;
846 for (me = mount_list; me; me = me->me_next) { 842 for (me = mount_list; me; me = me->me_next) {
847 if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) 843 if (! (path = np_find_parameter(path_select_list, me->me_mountdir)))
@@ -864,7 +860,7 @@ process_arguments (int argc, char **argv)
864 warn_freeinodes_percent = NULL; 860 warn_freeinodes_percent = NULL;
865 crit_freeinodes_percent = NULL; 861 crit_freeinodes_percent = NULL;
866 862
867 path_selected = FALSE; 863 path_selected = false;
868 group = NULL; 864 group = NULL;
869 break; 865 break;
870 case 'V': /* version */ 866 case 'V': /* version */
@@ -888,7 +884,7 @@ process_arguments (int argc, char **argv)
888 884
889 if (argc > c) { 885 if (argc > c) {
890 se = np_add_parameter(&path_select_list, strdup(argv[c++])); 886 se = np_add_parameter(&path_select_list, strdup(argv[c++]));
891 path_selected = TRUE; 887 path_selected = true;
892 set_all_thresholds(se); 888 set_all_thresholds(se);
893 } 889 }
894 890
@@ -897,21 +893,9 @@ process_arguments (int argc, char **argv)
897 mult = (uintmax_t)1024 * 1024; 893 mult = (uintmax_t)1024 * 1024;
898 } 894 }
899 895
900 return TRUE; 896 return true;
901}
902
903
904
905void
906print_path (const char *mypath)
907{
908 if (mypath == NULL)
909 printf ("\n");
910 else
911 printf (_(" for %s\n"), mypath);
912} 897}
913 898
914
915void 899void
916set_all_thresholds (struct parameter_list *path) 900set_all_thresholds (struct parameter_list *path)
917{ 901{
@@ -996,25 +980,33 @@ print_help (void)
996 printf (" %s\n", _("Regular expression to ignore selected path/partition (case insensitive) (may be repeated)")); 980 printf (" %s\n", _("Regular expression to ignore selected path/partition (case insensitive) (may be repeated)"));
997 printf (" %s\n", "-i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION"); 981 printf (" %s\n", "-i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION");
998 printf (" %s\n", _("Regular expression to ignore selected path or partition (may be repeated)")); 982 printf (" %s\n", _("Regular expression to ignore selected path or partition (may be repeated)"));
999 printf (" %s\n", "--ignore-missing"); 983 printf (" %s\n", "-n, --ignore-missing");
1000 printf (" %s\n", _("Return OK if no filesystem matches, filesystem does not exist or is inaccessible.")); 984 printf (" %s\n", _("Return OK if no filesystem matches, filesystem does not exist or is inaccessible."));
1001 printf (" %s\n", _("(Provide this option before -p / -r / --ereg-path if used)")); 985 printf (" %s\n", _("(Provide this option before -p / -r / --ereg-path if used)"));
1002 printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); 986 printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
1003 printf (" %s\n", "-u, --units=STRING"); 987 printf (" %s\n", "-u, --units=STRING");
1004 printf (" %s\n", _("Choose bytes, kB, MB, GB, TB (default: MB)")); 988 printf (" %s\n", _("Choose bytes, kB, MB, GB, TB (default: MB)"));
1005 printf (UT_VERBOSE); 989 printf (UT_VERBOSE);
1006 printf (" %s\n", "-X, --exclude-type=TYPE"); 990 printf (" %s\n", "-X, --exclude-type=TYPE_REGEX");
1007 printf (" %s\n", _("Ignore all filesystems of indicated type (may be repeated)")); 991 printf (" %s\n", _("Ignore all filesystems of types matching given regex(7) (may be repeated)"));
1008 printf (" %s\n", "-N, --include-type=TYPE"); 992 printf (" %s\n", "-N, --include-type=TYPE_REGEX");
1009 printf (" %s\n", _("Check only filesystems of indicated type (may be repeated)")); 993 printf (" %s\n", _("Check only filesystems where the type matches this given regex(7) (may be repeated)"));
994
995 printf ("\n");
996 printf ("%s\n", _("General usage hints:"));
997 printf (" %s\n", _("- Arguments are positional! \"-w 5 -c 1 -p /foo -w6 -c2 -p /bar\" is not the same as"));
998 printf (" %s\n", _("\"-w 5 -c 1 -p /bar w6 -c2 -p /foo\"."));
999 printf (" %s\n", _("- The syntax is broadly: \"{thresholds a} {paths a} -C {thresholds b} {thresholds b} ...\""));
1000
1001
1010 1002
1011 printf ("\n"); 1003 printf ("\n");
1012 printf ("%s\n", _("Examples:")); 1004 printf ("%s\n", _("Examples:"));
1013 printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /"); 1005 printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /");
1014 printf (" %s\n", _("Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB")); 1006 printf (" %s\n\n", _("Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"));
1015 printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -g sidDATA -r '^/oracle/SID/data.*$'"); 1007 printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -g sidDATA -r '^/oracle/SID/data.*$'");
1016 printf (" %s\n", _("Checks all filesystems not matching -r at 100M and 50M. The fs matching the -r regex")); 1008 printf (" %s\n", _("Checks all filesystems not matching -r at 100M and 50M. The fs matching the -r regex"));
1017 printf (" %s\n", _("are grouped which means the freespace thresholds are applied to all disks together")); 1009 printf (" %s\n\n", _("are grouped which means the freespace thresholds are applied to all disks together"));
1018 printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -p /foo -C -w 5% -c 3% -p /bar"); 1010 printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -p /foo -C -w 5% -c 3% -p /bar");
1019 printf (" %s\n", _("Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use 100M/50M")); 1011 printf (" %s\n", _("Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use 100M/50M"));
1020 1012
@@ -1027,9 +1019,9 @@ void
1027print_usage (void) 1019print_usage (void)
1028{ 1020{
1029 printf ("%s\n", _("Usage:")); 1021 printf ("%s\n", _("Usage:"));
1030 printf (" %s {-w absolute_limit |-w percentage_limit% | -W inode_percentage_limit } {-c absolute_limit|-c percentage_limit% | -K inode_percentage_limit } {-p path | -x device}\n", progname); 1022 printf (" %s {-w absolute_limit |-w percentage_limit%% | -W inode_percentage_limit } {-c absolute_limit|-c percentage_limit%% | -K inode_percentage_limit } {-p path | -x device}\n", progname);
1031 printf ("[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n"); 1023 printf ("[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n");
1032 printf ("[-t timeout] [-u unit] [-v] [-X type] [-N type]\n"); 1024 printf ("[-t timeout] [-u unit] [-v] [-X type_regex] [-N type]\n");
1033} 1025}
1034 1026
1035bool 1027bool
@@ -1115,7 +1107,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) {
1115 } 1107 }
1116 /* finally calculate percentages for either plain FS or summed up group */ 1108 /* finally calculate percentages for either plain FS or summed up group */
1117 p->dused_pct = calculate_percent( p->used, p->used + p->available ); /* used + available can never be > uintmax */ 1109 p->dused_pct = calculate_percent( p->used, p->used + p->available ); /* used + available can never be > uintmax */
1118 p->dfree_pct = 100 - p->dused_pct; 1110 p->dfree_pct = 100.0 - p->dused_pct;
1119 p->dused_inodes_percent = calculate_percent(p->inodes_total - p->inodes_free, p->inodes_total); 1111 p->dused_inodes_percent = calculate_percent(p->inodes_total - p->inodes_free, p->inodes_total);
1120 p->dfree_inodes_percent = 100 - p->dused_inodes_percent; 1112 p->dfree_inodes_percent = 100 - p->dused_inodes_percent;
1121 1113
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 7ffce98..468bc95 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -41,8 +41,8 @@ const char *email = "devel@monitoring-plugins.org";
41 41
42int process_arguments (int, char **); 42int process_arguments (int, char **);
43int validate_arguments (void); 43int validate_arguments (void);
44int error_scan (char *, int *); 44int error_scan (char *, bool *);
45int ip_match_cidr(const char *, const char *); 45bool ip_match_cidr(const char *, const char *);
46unsigned long ip2long(const char *); 46unsigned long ip2long(const char *);
47void print_help (void); 47void print_help (void);
48void print_usage (void); 48void print_usage (void);
@@ -51,13 +51,13 @@ void print_usage (void);
51char query_address[ADDRESS_LENGTH] = ""; 51char query_address[ADDRESS_LENGTH] = "";
52char dns_server[ADDRESS_LENGTH] = ""; 52char dns_server[ADDRESS_LENGTH] = "";
53char ptr_server[ADDRESS_LENGTH] = ""; 53char ptr_server[ADDRESS_LENGTH] = "";
54int verbose = FALSE; 54bool verbose = false;
55char **expected_address = NULL; 55char **expected_address = NULL;
56int expected_address_cnt = 0; 56int expected_address_cnt = 0;
57int expect_nxdomain = FALSE; 57bool expect_nxdomain = false;
58 58
59int expect_authority = FALSE; 59bool expect_authority = false;
60int all_match = FALSE; 60bool all_match = false;
61thresholds *time_thresholds = NULL; 61thresholds *time_thresholds = NULL;
62 62
63static int 63static int
@@ -80,15 +80,14 @@ main (int argc, char **argv)
80 int n_addresses = 0; 80 int n_addresses = 0;
81 char *msg = NULL; 81 char *msg = NULL;
82 char *temp_buffer = NULL; 82 char *temp_buffer = NULL;
83 int non_authoritative = FALSE; 83 bool non_authoritative = false;
84 int result = STATE_UNKNOWN; 84 int result = STATE_UNKNOWN;
85 double elapsed_time; 85 double elapsed_time;
86 long microsec; 86 long microsec;
87 struct timeval tv; 87 struct timeval tv;
88 int parse_address = FALSE; /* This flag scans for Address: but only after Name: */ 88 bool parse_address = false; /* This flag scans for Address: but only after Name: */
89 output chld_out, chld_err; 89 output chld_out, chld_err;
90 size_t i; 90 bool is_nxdomain = false;
91 int is_nxdomain = FALSE;
92 91
93 setlocale (LC_ALL, ""); 92 setlocale (LC_ALL, "");
94 bindtextdomain (PACKAGE, LOCALEDIR); 93 bindtextdomain (PACKAGE, LOCALEDIR);
@@ -122,7 +121,7 @@ main (int argc, char **argv)
122 } 121 }
123 122
124 /* scan stdout */ 123 /* scan stdout */
125 for(i = 0; i < chld_out.lines; i++) { 124 for(size_t i = 0; i < chld_out.lines; i++) {
126 if (addresses == NULL) 125 if (addresses == NULL)
127 addresses = malloc(sizeof(*addresses)*10); 126 addresses = malloc(sizeof(*addresses)*10);
128 else if (!(n_addresses % 10)) 127 else if (!(n_addresses % 10))
@@ -164,8 +163,8 @@ main (int argc, char **argv)
164 163
165 /* the server is responding, we just got the host name... */ 164 /* the server is responding, we just got the host name... */
166 if (strstr (chld_out.line[i], "Name:")) 165 if (strstr (chld_out.line[i], "Name:"))
167 parse_address = TRUE; 166 parse_address = true;
168 else if (parse_address == TRUE && (strstr (chld_out.line[i], "Address:") || 167 else if (parse_address && (strstr (chld_out.line[i], "Address:") ||
169 strstr (chld_out.line[i], "Addresses:"))) { 168 strstr (chld_out.line[i], "Addresses:"))) {
170 temp_buffer = index (chld_out.line[i], ':'); 169 temp_buffer = index (chld_out.line[i], ':');
171 temp_buffer++; 170 temp_buffer++;
@@ -184,7 +183,7 @@ main (int argc, char **argv)
184 addresses[n_addresses++] = strdup(temp_buffer); 183 addresses[n_addresses++] = strdup(temp_buffer);
185 } 184 }
186 else if (strstr (chld_out.line[i], _("Non-authoritative answer:"))) { 185 else if (strstr (chld_out.line[i], _("Non-authoritative answer:"))) {
187 non_authoritative = TRUE; 186 non_authoritative = true;
188 } 187 }
189 188
190 189
@@ -197,7 +196,7 @@ main (int argc, char **argv)
197 } 196 }
198 197
199 /* scan stderr */ 198 /* scan stderr */
200 for(i = 0; i < chld_err.lines; i++) { 199 for(size_t i = 0; i < chld_err.lines; i++) {
201 if (verbose) 200 if (verbose)
202 puts(chld_err.line[i]); 201 puts(chld_err.line[i]);
203 202
@@ -241,7 +240,7 @@ main (int argc, char **argv)
241 unsigned long expect_match = (1 << expected_address_cnt) - 1; 240 unsigned long expect_match = (1 << expected_address_cnt) - 1;
242 unsigned long addr_match = (1 << n_addresses) - 1; 241 unsigned long addr_match = (1 << n_addresses) - 1;
243 242
244 for (i=0; i<expected_address_cnt; i++) { 243 for (int i=0; i<expected_address_cnt; i++) {
245 int j; 244 int j;
246 /* check if we get a match on 'raw' ip or cidr */ 245 /* check if we get a match on 'raw' ip or cidr */
247 for (j=0; j<n_addresses; j++) { 246 for (j=0; j<n_addresses; j++) {
@@ -298,21 +297,21 @@ main (int argc, char **argv)
298 printf (_(". %s returns %s"), query_address, address); 297 printf (_(". %s returns %s"), query_address, address);
299 if ((time_thresholds->warning != NULL) && (time_thresholds->critical != NULL)) { 298 if ((time_thresholds->warning != NULL) && (time_thresholds->critical != NULL)) {
300 printf ("|%s\n", fperfdata ("time", elapsed_time, "s", 299 printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
301 TRUE, time_thresholds->warning->end, 300 true, time_thresholds->warning->end,
302 TRUE, time_thresholds->critical->end, 301 true, time_thresholds->critical->end,
303 TRUE, 0, FALSE, 0)); 302 true, 0, false, 0));
304 } else if ((time_thresholds->warning == NULL) && (time_thresholds->critical != NULL)) { 303 } else if ((time_thresholds->warning == NULL) && (time_thresholds->critical != NULL)) {
305 printf ("|%s\n", fperfdata ("time", elapsed_time, "s", 304 printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
306 FALSE, 0, 305 false, 0,
307 TRUE, time_thresholds->critical->end, 306 true, time_thresholds->critical->end,
308 TRUE, 0, FALSE, 0)); 307 true, 0, false, 0));
309 } else if ((time_thresholds->warning != NULL) && (time_thresholds->critical == NULL)) { 308 } else if ((time_thresholds->warning != NULL) && (time_thresholds->critical == NULL)) {
310 printf ("|%s\n", fperfdata ("time", elapsed_time, "s", 309 printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
311 TRUE, time_thresholds->warning->end, 310 true, time_thresholds->warning->end,
312 FALSE, 0, 311 false, 0,
313 TRUE, 0, FALSE, 0)); 312 true, 0, false, 0));
314 } else 313 } else
315 printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0)); 314 printf ("|%s\n", fperfdata ("time", elapsed_time, "s", false, 0, false, 0, true, 0, false, 0));
316 } 315 }
317 else if (result == STATE_WARNING) 316 else if (result == STATE_WARNING)
318 printf (_("DNS WARNING - %s\n"), 317 printf (_("DNS WARNING - %s\n"),
@@ -327,15 +326,14 @@ main (int argc, char **argv)
327 return result; 326 return result;
328} 327}
329 328
330int 329bool ip_match_cidr(const char *addr, const char *cidr_ro) {
331ip_match_cidr(const char *addr, const char *cidr_ro)
332{
333 char *subnet, *mask_c, *cidr = strdup(cidr_ro); 330 char *subnet, *mask_c, *cidr = strdup(cidr_ro);
334 int mask; 331 int mask;
335 subnet = strtok(cidr, "/"); 332 subnet = strtok(cidr, "/");
336 mask_c = strtok(NULL, "\0"); 333 mask_c = strtok(NULL, "\0");
337 if (!subnet || !mask_c) 334 if (!subnet || !mask_c) {
338 return FALSE; 335 return false;
336 }
339 mask = atoi(mask_c); 337 mask = atoi(mask_c);
340 338
341 /* https://www.cryptobells.com/verifying-ips-in-a-subnet-in-php/ */ 339 /* https://www.cryptobells.com/verifying-ips-in-a-subnet-in-php/ */
@@ -355,14 +353,14 @@ ip2long(const char* src) {
355} 353}
356 354
357int 355int
358error_scan (char *input_buffer, int *is_nxdomain) 356error_scan (char *input_buffer, bool *is_nxdomain)
359{ 357{
360 358
361 const int nxdomain = strstr (input_buffer, "Non-existent") || 359 const int nxdomain = strstr (input_buffer, "Non-existent") ||
362 strstr (input_buffer, "** server can't find") || 360 strstr (input_buffer, "** server can't find") ||
363 strstr (input_buffer, "** Can't find") || 361 strstr (input_buffer, "** Can't find") ||
364 strstr (input_buffer, "NXDOMAIN"); 362 strstr (input_buffer, "NXDOMAIN");
365 if (nxdomain) *is_nxdomain = TRUE; 363 if (nxdomain) *is_nxdomain = true;
366 364
367 /* the DNS lookup timed out */ 365 /* the DNS lookup timed out */
368 if (strstr (input_buffer, _("Note: nslookup is deprecated and may be removed from future releases.")) || 366 if (strstr (input_buffer, _("Note: nslookup is deprecated and may be removed from future releases.")) ||
@@ -461,7 +459,7 @@ process_arguments (int argc, char **argv)
461 print_revision (progname, NP_VERSION); 459 print_revision (progname, NP_VERSION);
462 exit (STATE_UNKNOWN); 460 exit (STATE_UNKNOWN);
463 case 'v': /* version */ 461 case 'v': /* version */
464 verbose = TRUE; 462 verbose = true;
465 break; 463 break;
466 case 't': /* timeout period */ 464 case 't': /* timeout period */
467 timeout_interval = atoi (optarg); 465 timeout_interval = atoi (optarg);
@@ -508,13 +506,13 @@ process_arguments (int argc, char **argv)
508 } 506 }
509 break; 507 break;
510 case 'n': /* expect NXDOMAIN */ 508 case 'n': /* expect NXDOMAIN */
511 expect_nxdomain = TRUE; 509 expect_nxdomain = true;
512 break; 510 break;
513 case 'A': /* expect authority */ 511 case 'A': /* expect authority */
514 expect_authority = TRUE; 512 expect_authority = true;
515 break; 513 break;
516 case 'L': /* all must match */ 514 case 'L': /* all must match */
517 all_match = TRUE; 515 all_match = true;
518 break; 516 break;
519 case 'w': 517 case 'w':
520 warning = optarg; 518 warning = optarg;
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 23a9e99..70d6f9f 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -59,16 +59,16 @@ int packet_size = PACKET_SIZE;
59int packet_count = PACKET_COUNT; 59int packet_count = PACKET_COUNT;
60int target_timeout = 0; 60int target_timeout = 0;
61int packet_interval = 0; 61int packet_interval = 0;
62int verbose = FALSE; 62bool verbose = false;
63int cpl; 63int cpl;
64int wpl; 64int wpl;
65double crta; 65double crta;
66double wrta; 66double wrta;
67int cpl_p = FALSE; 67bool cpl_p = false;
68int wpl_p = FALSE; 68bool wpl_p = false;
69bool alive_p = FALSE; 69bool alive_p = false;
70int crta_p = FALSE; 70bool crta_p = false;
71int wrta_p = FALSE; 71bool wrta_p = false;
72 72
73int 73int
74main (int argc, char **argv) 74main (int argc, char **argv)
@@ -194,8 +194,8 @@ int textscan (char *buf) {
194 _("FPING %s - %s (rta=%f ms)|%s\n"), 194 _("FPING %s - %s (rta=%f ms)|%s\n"),
195 state_text (STATE_OK), server_name,rta, 195 state_text (STATE_OK), server_name,rta,
196 /* No loss since we only waited for the first reply 196 /* No loss since we only waited for the first reply
197 perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100), */ 197 perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, true, 0, true, 100), */
198 fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, TRUE, 0, FALSE, 0)); 198 fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, true, 0, false, 0));
199 } 199 }
200 200
201 if (strstr (buf, "not found")) { 201 if (strstr (buf, "not found")) {
@@ -228,21 +228,21 @@ int textscan (char *buf) {
228 rtastr = 1 + index (rtastr, '/'); 228 rtastr = 1 + index (rtastr, '/');
229 loss = strtod (losstr, NULL); 229 loss = strtod (losstr, NULL);
230 rta = strtod (rtastr, NULL); 230 rta = strtod (rtastr, NULL);
231 if (cpl_p == TRUE && loss > cpl) 231 if (cpl_p && loss > cpl)
232 status = STATE_CRITICAL; 232 status = STATE_CRITICAL;
233 else if (crta_p == TRUE && rta > crta) 233 else if (crta_p && rta > crta)
234 status = STATE_CRITICAL; 234 status = STATE_CRITICAL;
235 else if (wpl_p == TRUE && loss > wpl) 235 else if (wpl_p && loss > wpl)
236 status = STATE_WARNING; 236 status = STATE_WARNING;
237 else if (wrta_p == TRUE && rta > wrta) 237 else if (wrta_p && rta > wrta)
238 status = STATE_WARNING; 238 status = STATE_WARNING;
239 else 239 else
240 status = STATE_OK; 240 status = STATE_OK;
241 die (status, 241 die (status,
242 _("FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"), 242 _("FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"),
243 state_text (status), server_name, loss, rta, 243 state_text (status), server_name, loss, rta,
244 perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100), 244 perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, true, 0, true, 100),
245 fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, TRUE, 0, FALSE, 0)); 245 fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, true, 0, false, 0));
246 246
247 } 247 }
248 else if(strstr (buf, "xmt/rcv/%loss") ) { 248 else if(strstr (buf, "xmt/rcv/%loss") ) {
@@ -258,16 +258,16 @@ int textscan (char *buf) {
258 loss = strtod (losstr, NULL); 258 loss = strtod (losstr, NULL);
259 if (atoi(losstr) == 100) 259 if (atoi(losstr) == 100)
260 status = STATE_CRITICAL; 260 status = STATE_CRITICAL;
261 else if (cpl_p == TRUE && loss > cpl) 261 else if (cpl_p && loss > cpl)
262 status = STATE_CRITICAL; 262 status = STATE_CRITICAL;
263 else if (wpl_p == TRUE && loss > wpl) 263 else if (wpl_p && loss > wpl)
264 status = STATE_WARNING; 264 status = STATE_WARNING;
265 else 265 else
266 status = STATE_OK; 266 status = STATE_OK;
267 /* loss=%.0f%%;%d;%d;0;100 */ 267 /* loss=%.0f%%;%d;%d;0;100 */
268 die (status, _("FPING %s - %s (loss=%.0f%% )|%s\n"), 268 die (status, _("FPING %s - %s (loss=%.0f%% )|%s\n"),
269 state_text (status), server_name, loss , 269 state_text (status), server_name, loss ,
270 perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100)); 270 perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, true, 0, true, 100));
271 271
272 } 272 }
273 else { 273 else {
@@ -329,7 +329,7 @@ process_arguments (int argc, char **argv)
329 case '?': /* print short usage statement if args not parsable */ 329 case '?': /* print short usage statement if args not parsable */
330 usage5 (); 330 usage5 ();
331 case 'a': /* host alive mode */ 331 case 'a': /* host alive mode */
332 alive_p = TRUE; 332 alive_p = true;
333 break; 333 break;
334 case 'h': /* help */ 334 case 'h': /* help */
335 print_help (); 335 print_help ();
@@ -338,16 +338,16 @@ process_arguments (int argc, char **argv)
338 print_revision (progname, NP_VERSION); 338 print_revision (progname, NP_VERSION);
339 exit (STATE_UNKNOWN); 339 exit (STATE_UNKNOWN);
340 case 'v': /* verbose mode */ 340 case 'v': /* verbose mode */
341 verbose = TRUE; 341 verbose = true;
342 break; 342 break;
343 case 'H': /* hostname */ 343 case 'H': /* hostname */
344 if (is_host (optarg) == FALSE) { 344 if (is_host (optarg) == false) {
345 usage2 (_("Invalid hostname/address"), optarg); 345 usage2 (_("Invalid hostname/address"), optarg);
346 } 346 }
347 server_name = strscpy (server_name, optarg); 347 server_name = strscpy (server_name, optarg);
348 break; 348 break;
349 case 'S': /* sourceip */ 349 case 'S': /* sourceip */
350 if (is_host (optarg) == FALSE) { 350 if (is_host (optarg) == false) {
351 usage2 (_("Invalid hostname/address"), optarg); 351 usage2 (_("Invalid hostname/address"), optarg);
352 } 352 }
353 sourceip = strscpy (sourceip, optarg); 353 sourceip = strscpy (sourceip, optarg);
@@ -369,12 +369,12 @@ process_arguments (int argc, char **argv)
369 get_threshold (optarg, rv); 369 get_threshold (optarg, rv);
370 if (rv[RTA]) { 370 if (rv[RTA]) {
371 crta = strtod (rv[RTA], NULL); 371 crta = strtod (rv[RTA], NULL);
372 crta_p = TRUE; 372 crta_p = true;
373 rv[RTA] = NULL; 373 rv[RTA] = NULL;
374 } 374 }
375 if (rv[PL]) { 375 if (rv[PL]) {
376 cpl = atoi (rv[PL]); 376 cpl = atoi (rv[PL]);
377 cpl_p = TRUE; 377 cpl_p = true;
378 rv[PL] = NULL; 378 rv[PL] = NULL;
379 } 379 }
380 break; 380 break;
@@ -382,12 +382,12 @@ process_arguments (int argc, char **argv)
382 get_threshold (optarg, rv); 382 get_threshold (optarg, rv);
383 if (rv[RTA]) { 383 if (rv[RTA]) {
384 wrta = strtod (rv[RTA], NULL); 384 wrta = strtod (rv[RTA], NULL);
385 wrta_p = TRUE; 385 wrta_p = true;
386 rv[RTA] = NULL; 386 rv[RTA] = NULL;
387 } 387 }
388 if (rv[PL]) { 388 if (rv[PL]) {
389 wpl = atoi (rv[PL]); 389 wpl = atoi (rv[PL]);
390 wpl_p = TRUE; 390 wpl_p = true;
391 rv[PL] = NULL; 391 rv[PL] = NULL;
392 } 392 }
393 break; 393 break;
diff --git a/plugins/check_game.c b/plugins/check_game.c
index a534b69..ca12697 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -53,7 +53,7 @@ char *server_ip;
53char *game_type; 53char *game_type;
54int port = 0; 54int port = 0;
55 55
56int verbose; 56bool verbose = false;
57 57
58int qstat_game_players_max = -1; 58int qstat_game_players_max = -1;
59int qstat_game_players = -1; 59int qstat_game_players = -1;
@@ -90,7 +90,7 @@ main (int argc, char **argv)
90 if (port) 90 if (port)
91 xasprintf (&command_line, "%s:%-d", command_line, port); 91 xasprintf (&command_line, "%s:%-d", command_line, port);
92 92
93 if (verbose > 0) 93 if (verbose)
94 printf ("%s\n", command_line); 94 printf ("%s\n", command_line);
95 95
96 /* run the command. historically, this plugin ignores output on stderr, 96 /* run the command. historically, this plugin ignores output on stderr,
@@ -142,11 +142,11 @@ main (int argc, char **argv)
142 ret[qstat_map_field], 142 ret[qstat_map_field],
143 ret[qstat_ping_field], 143 ret[qstat_ping_field],
144 perfdata ("players", atol(ret[qstat_game_players]), "", 144 perfdata ("players", atol(ret[qstat_game_players]), "",
145 FALSE, 0, FALSE, 0, 145 false, 0, false, 0,
146 TRUE, 0, TRUE, atol(ret[qstat_game_players_max])), 146 true, 0, true, atol(ret[qstat_game_players_max])),
147 fperfdata ("ping", strtod(ret[qstat_ping_field], NULL), "", 147 fperfdata ("ping", strtod(ret[qstat_ping_field], NULL), "",
148 FALSE, 0, FALSE, 0, 148 false, 0, false, 0,
149 TRUE, 0, FALSE, 0)); 149 true, 0, false, 0));
150 } 150 }
151 151
152 return result; 152 return result;
@@ -201,7 +201,7 @@ process_arguments (int argc, char **argv)
201 print_revision (progname, NP_VERSION); 201 print_revision (progname, NP_VERSION);
202 exit (STATE_UNKNOWN); 202 exit (STATE_UNKNOWN);
203 case 'v': /* version */ 203 case 'v': /* version */
204 verbose = TRUE; 204 verbose = true;
205 break; 205 break;
206 case 't': /* timeout period */ 206 case 't': /* timeout period */
207 timeout_interval = atoi (optarg); 207 timeout_interval = atoi (optarg);
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 718c8ee..cdf768c 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -85,6 +85,7 @@ char errbuf[MAX_INPUT_BUFFER];
85int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE; 85int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE;
86int errcode; 86int errcode;
87int invert_regex = 0; 87int invert_regex = 0;
88int state_regex = STATE_CRITICAL;
88 89
89struct timeval tv; 90struct timeval tv;
90struct timeval tv_temp; 91struct timeval tv_temp;
@@ -210,7 +211,8 @@ bool process_arguments (int argc, char **argv)
210 INVERT_REGEX = CHAR_MAX + 1, 211 INVERT_REGEX = CHAR_MAX + 1,
211 SNI_OPTION, 212 SNI_OPTION,
212 MAX_REDIRS_OPTION, 213 MAX_REDIRS_OPTION,
213 CONTINUE_AFTER_CHECK_CERT 214 CONTINUE_AFTER_CHECK_CERT,
215 STATE_REGEX
214 }; 216 };
215 217
216 int option = 0; 218 int option = 0;
@@ -246,6 +248,7 @@ bool process_arguments (int argc, char **argv)
246 {"content-type", required_argument, 0, 'T'}, 248 {"content-type", required_argument, 0, 'T'},
247 {"pagesize", required_argument, 0, 'm'}, 249 {"pagesize", required_argument, 0, 'm'},
248 {"invert-regex", no_argument, NULL, INVERT_REGEX}, 250 {"invert-regex", no_argument, NULL, INVERT_REGEX},
251 {"state-regex", required_argument, 0, STATE_REGEX},
249 {"use-ipv4", no_argument, 0, '4'}, 252 {"use-ipv4", no_argument, 0, '4'},
250 {"use-ipv6", no_argument, 0, '6'}, 253 {"use-ipv6", no_argument, 0, '6'},
251 {"extended-perfdata", no_argument, 0, 'E'}, 254 {"extended-perfdata", no_argument, 0, 'E'},
@@ -471,10 +474,9 @@ bool process_arguments (int argc, char **argv)
471 free(http_method); 474 free(http_method);
472 http_method = strdup (optarg); 475 http_method = strdup (optarg);
473 char *tmp; 476 char *tmp;
474 if ((tmp = strstr(http_method, ":")) > 0) { 477 if ((tmp = strstr(http_method, ":")) != NULL) {
475 tmp[0] = '\0'; 478 tmp[0] = '\0'; // set the ":" in the middle to 0
476 http_method = http_method; 479 http_method_proxy = ++tmp; // this points to the second part
477 http_method_proxy = ++tmp;
478 } 480 }
479 break; 481 break;
480 case 'd': /* string or substring */ 482 case 'd': /* string or substring */
@@ -512,6 +514,13 @@ bool process_arguments (int argc, char **argv)
512 case INVERT_REGEX: 514 case INVERT_REGEX:
513 invert_regex = 1; 515 invert_regex = 1;
514 break; 516 break;
517 case STATE_REGEX:
518 if (!strcmp (optarg, "critical"))
519 state_regex = STATE_CRITICAL;
520 else if (!strcmp (optarg, "warning"))
521 state_regex = STATE_WARNING;
522 else usage2 (_("Invalid state-regex option"), optarg);
523 break;
515 case '4': 524 case '4':
516 address_family = AF_INET; 525 address_family = AF_INET;
517 break; 526 break;
@@ -1094,7 +1103,7 @@ check_http (void)
1094 microsec_firstbyte = deltime (tv_temp); 1103 microsec_firstbyte = deltime (tv_temp);
1095 elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6; 1104 elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6;
1096 } 1105 }
1097 while (pos = memchr(buffer, '\0', i)) { 1106 while ((pos = memchr(buffer, '\0', i))) {
1098 /* replace nul character with a blank */ 1107 /* replace nul character with a blank */
1099 *pos = ' '; 1108 *pos = ' ';
1100 } 1109 }
@@ -1318,7 +1327,7 @@ check_http (void)
1318 xasprintf (&msg, _("%spattern not found, "), msg); 1327 xasprintf (&msg, _("%spattern not found, "), msg);
1319 else 1328 else
1320 xasprintf (&msg, _("%spattern found, "), msg); 1329 xasprintf (&msg, _("%spattern found, "), msg);
1321 result = STATE_CRITICAL; 1330 result = state_regex;
1322 } 1331 }
1323 else { 1332 else {
1324 /* FIXME: Shouldn't that be UNKNOWN? */ 1333 /* FIXME: Shouldn't that be UNKNOWN? */
@@ -1775,7 +1784,7 @@ print_help (void)
1775 printf (" %s\n", "-u, --url=PATH"); 1784 printf (" %s\n", "-u, --url=PATH");
1776 printf (" %s\n", _("URL to GET or POST (default: /)")); 1785 printf (" %s\n", _("URL to GET or POST (default: /)"));
1777 printf (" %s\n", "-P, --post=STRING"); 1786 printf (" %s\n", "-P, --post=STRING");
1778 printf (" %s\n", _("URL encoded http POST data")); 1787 printf (" %s\n", _("URL decoded http POST data"));
1779 printf (" %s\n", "-j, --method=STRING (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT, CONNECT:POST)"); 1788 printf (" %s\n", "-j, --method=STRING (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT, CONNECT:POST)");
1780 printf (" %s\n", _("Set HTTP method.")); 1789 printf (" %s\n", _("Set HTTP method."));
1781 printf (" %s\n", "-N, --no-body"); 1790 printf (" %s\n", "-N, --no-body");
@@ -1794,7 +1803,10 @@ print_help (void)
1794 printf (" %s\n", "-R, --eregi=STRING"); 1803 printf (" %s\n", "-R, --eregi=STRING");
1795 printf (" %s\n", _("Search page for case-insensitive regex STRING")); 1804 printf (" %s\n", _("Search page for case-insensitive regex STRING"));
1796 printf (" %s\n", "--invert-regex"); 1805 printf (" %s\n", "--invert-regex");
1797 printf (" %s\n", _("Return CRITICAL if found, OK if not\n")); 1806 printf (" %s\n", _("Return STATE if found, OK if not (STATE is CRITICAL, per default)"));
1807 printf (" %s\n", _("can be changed with --state--regex)"));
1808 printf (" %s\n", "--regex-state=STATE");
1809 printf (" %s\n", _("Return STATE if regex is found, OK if not\n"));
1798 1810
1799 printf (" %s\n", "-a, --authorization=AUTH_PAIR"); 1811 printf (" %s\n", "-a, --authorization=AUTH_PAIR");
1800 printf (" %s\n", _("Username:password on sites with basic authentication")); 1812 printf (" %s\n", _("Username:password on sites with basic authentication"));
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index 0160d98..3872e34 100644
--- a/plugins/check_ide_smart.c
+++ b/plugins/check_ide_smart.c
@@ -73,10 +73,6 @@ void print_usage (void);
73 73
74#define NR_ATTRIBUTES 30 74#define NR_ATTRIBUTES 30
75 75
76#ifndef TRUE
77#define TRUE 1
78#endif /* */
79
80#define PREFAILURE 2 76#define PREFAILURE 2
81#define ADVISORY 1 77#define ADVISORY 1
82#define OPERATIONAL 0 78#define OPERATIONAL 0
@@ -169,9 +165,9 @@ int smart_read_values (int, values_t *);
169int nagios (values_t *, thresholds_t *); 165int nagios (values_t *, thresholds_t *);
170void print_value (value_t *, threshold_t *); 166void print_value (value_t *, threshold_t *);
171void print_values (values_t *, thresholds_t *); 167void print_values (values_t *, thresholds_t *);
172int smart_cmd_simple (int, enum SmartCommand, __u8, char); 168int smart_cmd_simple (int, enum SmartCommand, __u8, bool);
173int smart_read_thresholds (int, thresholds_t *); 169int smart_read_thresholds (int, thresholds_t *);
174int verbose = FALSE; 170bool verbose = false;
175 171
176int 172int
177main (int argc, char *argv[]) 173main (int argc, char *argv[])
@@ -203,7 +199,7 @@ main (int argc, char *argv[])
203 bindtextdomain (PACKAGE, LOCALEDIR); 199 bindtextdomain (PACKAGE, LOCALEDIR);
204 textdomain (PACKAGE); 200 textdomain (PACKAGE);
205 201
206 while (1) { 202 while (true) {
207 203
208 o = getopt_long (argc, argv, "+d:iq10nhVv", longopts, &longindex); 204 o = getopt_long (argc, argv, "+d:iq10nhVv", longopts, &longindex);
209 205
@@ -229,7 +225,7 @@ main (int argc, char *argv[])
229 fprintf (stderr, "%s\n", _("default and will be removed from future releases.")); 225 fprintf (stderr, "%s\n", _("default and will be removed from future releases."));
230 break; 226 break;
231 case 'v': /* verbose */ 227 case 'v': /* verbose */
232 verbose = TRUE; 228 verbose = true;
233 break; 229 break;
234 case 'h': 230 case 'h':
235 print_help (); 231 print_help ();
@@ -258,7 +254,7 @@ main (int argc, char *argv[])
258 return STATE_CRITICAL; 254 return STATE_CRITICAL;
259 } 255 }
260 256
261 if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, FALSE)) { 257 if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, false)) {
262 printf (_("CRITICAL - SMART_CMD_ENABLE\n")); 258 printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
263 return STATE_CRITICAL; 259 return STATE_CRITICAL;
264 } 260 }
@@ -447,9 +443,7 @@ print_values (values_t * p, thresholds_t * t)
447} 443}
448 444
449 445
450int 446int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, bool show_error) {
451smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error)
452{
453 int e = STATE_UNKNOWN; 447 int e = STATE_UNKNOWN;
454#ifdef __linux__ 448#ifdef __linux__
455 __u8 args[4]; 449 __u8 args[4];
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index a1bfe1b..868ffc1 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -71,9 +71,9 @@ thresholds *entries_thresholds = NULL;
71struct timeval tv; 71struct timeval tv;
72char* warn_entries = NULL; 72char* warn_entries = NULL;
73char* crit_entries = NULL; 73char* crit_entries = NULL;
74int starttls = FALSE; 74bool starttls = false;
75int ssl_on_connect = FALSE; 75bool ssl_on_connect = false;
76int verbose = 0; 76bool verbose = false;
77 77
78/* for ldap tls */ 78/* for ldap tls */
79 79
@@ -97,9 +97,6 @@ main (int argc, char *argv[])
97 int tls; 97 int tls;
98 int version=3; 98 int version=3;
99 99
100 /* for entry counting */
101
102 LDAPMessage *next_entry;
103 int status_entries = STATE_OK; 100 int status_entries = STATE_OK;
104 int num_entries = 0; 101 int num_entries = 0;
105 102
@@ -118,7 +115,7 @@ main (int argc, char *argv[])
118 usage4 (_("Could not parse arguments")); 115 usage4 (_("Could not parse arguments"));
119 116
120 if (strstr(argv[0],"check_ldaps") && ! starttls && ! ssl_on_connect) 117 if (strstr(argv[0],"check_ldaps") && ! starttls && ! ssl_on_connect)
121 starttls = TRUE; 118 starttls = true;
122 119
123 /* initialize alarm signal handling */ 120 /* initialize alarm signal handling */
124 signal (SIGALRM, socket_timeout_alarm_handler); 121 signal (SIGALRM, socket_timeout_alarm_handler);
@@ -256,11 +253,11 @@ main (int argc, char *argv[])
256 fperfdata ("time", elapsed_time, "s", 253 fperfdata ("time", elapsed_time, "s",
257 (int)warn_time, warn_time, 254 (int)warn_time, warn_time,
258 (int)crit_time, crit_time, 255 (int)crit_time, crit_time,
259 TRUE, 0, FALSE, 0), 256 true, 0, false, 0),
260 sperfdata ("entries", (double)num_entries, "", 257 sperfdata ("entries", (double)num_entries, "",
261 warn_entries, 258 warn_entries,
262 crit_entries, 259 crit_entries,
263 TRUE, 0.0, FALSE, 0.0)); 260 true, 0.0, false, 0.0));
264 } else { 261 } else {
265 printf (_("LDAP %s - %.3f seconds response time|%s\n"), 262 printf (_("LDAP %s - %.3f seconds response time|%s\n"),
266 state_text (status), 263 state_text (status),
@@ -268,7 +265,7 @@ main (int argc, char *argv[])
268 fperfdata ("time", elapsed_time, "s", 265 fperfdata ("time", elapsed_time, "s",
269 (int)warn_time, warn_time, 266 (int)warn_time, warn_time,
270 (int)crit_time, crit_time, 267 (int)crit_time, crit_time,
271 TRUE, 0, FALSE, 0)); 268 true, 0, false, 0));
272 } 269 }
273 270
274 return status; 271 return status;
@@ -316,7 +313,7 @@ process_arguments (int argc, char **argv)
316 strcpy (argv[c], "-t"); 313 strcpy (argv[c], "-t");
317 } 314 }
318 315
319 while (1) { 316 while (true) {
320 c = getopt_long (argc, argv, "hvV234TS6t:c:w:H:b:p:a:D:P:C:W:", longopts, &option); 317 c = getopt_long (argc, argv, "hvV234TS6t:c:w:H:b:p:a:D:P:C:W:", longopts, &option);
321 318
322 if (c == -1 || c == EOF) 319 if (c == -1 || c == EOF)
@@ -377,17 +374,17 @@ process_arguments (int argc, char **argv)
377 address_family = AF_INET; 374 address_family = AF_INET;
378 break; 375 break;
379 case 'v': 376 case 'v':
380 verbose++; 377 verbose = true;
381 break; 378 break;
382 case 'T': 379 case 'T':
383 if (! ssl_on_connect) 380 if (! ssl_on_connect)
384 starttls = TRUE; 381 starttls = true;
385 else 382 else
386 usage_va(_("%s cannot be combined with %s"), "-T/--starttls", "-S/--ssl"); 383 usage_va(_("%s cannot be combined with %s"), "-T/--starttls", "-S/--ssl");
387 break; 384 break;
388 case 'S': 385 case 'S':
389 if (! starttls) { 386 if (! starttls) {
390 ssl_on_connect = TRUE; 387 ssl_on_connect = true;
391 if (ld_port == -1) 388 if (ld_port == -1)
392 ld_port = LDAPS_PORT; 389 ld_port = LDAPS_PORT;
393 } else 390 } else
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 313df8a..1431d13 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -110,10 +110,6 @@ main (int argc, char **argv)
110 double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about uninitialized arrays */ 110 double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about uninitialized arrays */
111#ifndef HAVE_GETLOADAVG 111#ifndef HAVE_GETLOADAVG
112 char input_buffer[MAX_INPUT_BUFFER]; 112 char input_buffer[MAX_INPUT_BUFFER];
113# ifdef HAVE_PROC_LOADAVG
114 FILE *fp;
115 char *str, *next;
116# endif
117#endif 113#endif
118 114
119 setlocale (LC_ALL, ""); 115 setlocale (LC_ALL, "");
@@ -132,23 +128,6 @@ main (int argc, char **argv)
132 if (result != 3) 128 if (result != 3)
133 return STATE_UNKNOWN; 129 return STATE_UNKNOWN;
134#else 130#else
135# ifdef HAVE_PROC_LOADAVG
136 fp = fopen (PROC_LOADAVG, "r");
137 if (fp == NULL) {
138 printf (_("Error opening %s\n"), PROC_LOADAVG);
139 return STATE_UNKNOWN;
140 }
141
142 while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
143 str = (char *)input_buffer;
144 for(i = 0; i < 3; i++) {
145 la[i] = strtod(str, &next);
146 str = next;
147 }
148 }
149
150 fclose (fp);
151# else
152 child_process = spopen (PATH_TO_UPTIME); 131 child_process = spopen (PATH_TO_UPTIME);
153 if (child_process == NULL) { 132 if (child_process == NULL) {
154 printf (_("Error opening %s\n"), PATH_TO_UPTIME); 133 printf (_("Error opening %s\n"), PATH_TO_UPTIME);
@@ -175,18 +154,13 @@ main (int argc, char **argv)
175 printf (_("Error code %d returned in %s\n"), result, PATH_TO_UPTIME); 154 printf (_("Error code %d returned in %s\n"), result, PATH_TO_UPTIME);
176 return STATE_UNKNOWN; 155 return STATE_UNKNOWN;
177 } 156 }
178# endif
179#endif 157#endif
180 158
181 if ((la[0] < 0.0) || (la[1] < 0.0) || (la[2] < 0.0)) { 159 if ((la[0] < 0.0) || (la[1] < 0.0) || (la[2] < 0.0)) {
182#ifdef HAVE_GETLOADAVG 160#ifdef HAVE_GETLOADAVG
183 printf (_("Error in getloadavg()\n")); 161 printf (_("Error in getloadavg()\n"));
184#else 162#else
185# ifdef HAVE_PROC_LOADAVG
186 printf (_("Error processing %s\n"), PROC_LOADAVG);
187# else
188 printf (_("Error processing %s\n"), PATH_TO_UPTIME); 163 printf (_("Error processing %s\n"), PATH_TO_UPTIME);
189# endif
190#endif 164#endif
191 return STATE_UNKNOWN; 165 return STATE_UNKNOWN;
192 } 166 }
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index 1fda549..826b77e 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -43,7 +43,7 @@ void print_usage (void);
43 43
44char *log_file = NULL; 44char *log_file = NULL;
45int expire_minutes = 0; 45int expire_minutes = 0;
46int use_average = TRUE; 46bool use_average = true;
47int variable_number = -1; 47int variable_number = -1;
48unsigned long value_warning_threshold = 0L; 48unsigned long value_warning_threshold = 0L;
49unsigned long value_critical_threshold = 0L; 49unsigned long value_critical_threshold = 0L;
@@ -138,7 +138,7 @@ main (int argc, char **argv)
138 } 138 }
139 139
140 /* else check the incoming/outgoing rates */ 140 /* else check the incoming/outgoing rates */
141 if (use_average == TRUE) 141 if (use_average)
142 rate = average_value_rate; 142 rate = average_value_rate;
143 else 143 else
144 rate = maximum_value_rate; 144 rate = maximum_value_rate;
@@ -149,7 +149,7 @@ main (int argc, char **argv)
149 result = STATE_WARNING; 149 result = STATE_WARNING;
150 150
151 printf("%s. %s = %lu %s|%s\n", 151 printf("%s. %s = %lu %s|%s\n",
152 (use_average == TRUE) ? _("Avg") : _("Max"), 152 (use_average) ? _("Avg") : _("Max"),
153 label, rate, units, 153 label, rate, units,
154 perfdata(label, (long) rate, units, 154 perfdata(label, (long) rate, units,
155 (int) value_warning_threshold, (long) value_warning_threshold, 155 (int) value_warning_threshold, (long) value_warning_threshold,
@@ -211,9 +211,9 @@ process_arguments (int argc, char **argv)
211 break; 211 break;
212 case 'a': /* port */ 212 case 'a': /* port */
213 if (!strcmp (optarg, "MAX")) 213 if (!strcmp (optarg, "MAX"))
214 use_average = FALSE; 214 use_average = false;
215 else 215 else
216 use_average = TRUE; 216 use_average = true;
217 break; 217 break;
218 case 'v': 218 case 'v':
219 variable_number = atoi (optarg); 219 variable_number = atoi (optarg);
@@ -258,11 +258,11 @@ process_arguments (int argc, char **argv)
258 } 258 }
259 259
260 if (argc > c && strcmp (argv[c], "MAX") == 0) { 260 if (argc > c && strcmp (argv[c], "MAX") == 0) {
261 use_average = FALSE; 261 use_average = false;
262 c++; 262 c++;
263 } 263 }
264 else if (argc > c && strcmp (argv[c], "AVG") == 0) { 264 else if (argc > c && strcmp (argv[c], "AVG") == 0) {
265 use_average = TRUE; 265 use_average = true;
266 c++; 266 c++;
267 } 267 }
268 268
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index eb66f62..bd25d47 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -43,7 +43,7 @@ void print_usage(void);
43 43
44char *log_file = NULL; 44char *log_file = NULL;
45int expire_minutes = -1; 45int expire_minutes = -1;
46int use_average = TRUE; 46bool use_average = true;
47unsigned long incoming_warning_threshold = 0L; 47unsigned long incoming_warning_threshold = 0L;
48unsigned long incoming_critical_threshold = 0L; 48unsigned long incoming_critical_threshold = 0L;
49unsigned long outgoing_warning_threshold = 0L; 49unsigned long outgoing_warning_threshold = 0L;
@@ -137,7 +137,7 @@ main (int argc, char **argv)
137 (int) ((current_time - timestamp) / 60)); 137 (int) ((current_time - timestamp) / 60));
138 138
139 /* else check the incoming/outgoing rates */ 139 /* else check the incoming/outgoing rates */
140 if (use_average == TRUE) { 140 if (use_average) {
141 incoming_rate = average_incoming_rate; 141 incoming_rate = average_incoming_rate;
142 outgoing_rate = average_outgoing_rate; 142 outgoing_rate = average_outgoing_rate;
143 } 143 }
@@ -192,17 +192,17 @@ main (int argc, char **argv)
192 } 192 }
193 193
194 xasprintf (&error_message, _("%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"), 194 xasprintf (&error_message, _("%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"),
195 (use_average == TRUE) ? _("Avg") : _("Max"), adjusted_incoming_rate, 195 (use_average) ? _("Avg") : _("Max"), adjusted_incoming_rate,
196 incoming_speed_rating, (use_average == TRUE) ? _("Avg") : _("Max"), 196 incoming_speed_rating, (use_average) ? _("Avg") : _("Max"),
197 adjusted_outgoing_rate, outgoing_speed_rating, 197 adjusted_outgoing_rate, outgoing_speed_rating,
198 fperfdata("in", adjusted_incoming_rate, incoming_speed_rating, 198 fperfdata("in", adjusted_incoming_rate, incoming_speed_rating,
199 (int)incoming_warning_threshold, incoming_warning_threshold, 199 (int)incoming_warning_threshold, incoming_warning_threshold,
200 (int)incoming_critical_threshold, incoming_critical_threshold, 200 (int)incoming_critical_threshold, incoming_critical_threshold,
201 TRUE, 0, FALSE, 0), 201 true, 0, false, 0),
202 fperfdata("out", adjusted_outgoing_rate, outgoing_speed_rating, 202 fperfdata("out", adjusted_outgoing_rate, outgoing_speed_rating,
203 (int)outgoing_warning_threshold, outgoing_warning_threshold, 203 (int)outgoing_warning_threshold, outgoing_warning_threshold,
204 (int)outgoing_critical_threshold, outgoing_critical_threshold, 204 (int)outgoing_critical_threshold, outgoing_critical_threshold,
205 TRUE, 0, FALSE, 0)); 205 true, 0, false, 0));
206 206
207 printf (_("Traffic %s - %s\n"), state_text(result), error_message); 207 printf (_("Traffic %s - %s\n"), state_text(result), error_message);
208 208
@@ -256,9 +256,9 @@ process_arguments (int argc, char **argv)
256 break; 256 break;
257 case 'a': /* aggregation (AVE or MAX) */ 257 case 'a': /* aggregation (AVE or MAX) */
258 if (!strcmp (optarg, "MAX")) 258 if (!strcmp (optarg, "MAX"))
259 use_average = FALSE; 259 use_average = false;
260 else 260 else
261 use_average = TRUE; 261 use_average = true;
262 break; 262 break;
263 case 'c': /* warning threshold */ 263 case 'c': /* warning threshold */
264 sscanf (optarg, "%lu,%lu", &incoming_critical_threshold, 264 sscanf (optarg, "%lu,%lu", &incoming_critical_threshold,
@@ -289,11 +289,11 @@ process_arguments (int argc, char **argv)
289 } 289 }
290 290
291 if (argc > c && strcmp (argv[c], "MAX") == 0) { 291 if (argc > c && strcmp (argv[c], "MAX") == 0) {
292 use_average = FALSE; 292 use_average = false;
293 c++; 293 c++;
294 } 294 }
295 else if (argc > c && strcmp (argv[c], "AVG") == 0) { 295 else if (argc > c && strcmp (argv[c], "AVG") == 0) {
296 use_average = TRUE; 296 use_average = true;
297 c++; 297 c++;
298 } 298 }
299 299
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 7d85554..15ec04c 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -59,8 +59,8 @@ bool ssl = false;
59char *opt_file = NULL; 59char *opt_file = NULL;
60char *opt_group = NULL; 60char *opt_group = NULL;
61unsigned int db_port = MYSQL_PORT; 61unsigned int db_port = MYSQL_PORT;
62int check_slave = 0, warn_sec = 0, crit_sec = 0; 62bool check_slave = false;
63int ignore_auth = 0; 63bool ignore_auth = false;
64int verbose = 0; 64int verbose = 0;
65 65
66static double warning_time = 0; 66static double warning_time = 0;
@@ -113,7 +113,7 @@ main (int argc, char **argv)
113 char slaveresult[SLAVERESULTSIZE] = { 0 }; 113 char slaveresult[SLAVERESULTSIZE] = { 0 };
114 char* perf; 114 char* perf;
115 115
116 perf = strdup (""); 116 perf = strdup ("");
117 117
118 setlocale (LC_ALL, ""); 118 setlocale (LC_ALL, "");
119 bindtextdomain (PACKAGE, LOCALEDIR); 119 bindtextdomain (PACKAGE, LOCALEDIR);
@@ -193,14 +193,14 @@ main (int argc, char **argv)
193 for(i = 0; i < LENGTH_METRIC_UNIT; i++) { 193 for(i = 0; i < LENGTH_METRIC_UNIT; i++) {
194 if (strcmp(row[0], metric_unit[i]) == 0) { 194 if (strcmp(row[0], metric_unit[i]) == 0) {
195 xasprintf(&perf, "%s%s ", perf, perfdata(metric_unit[i], 195 xasprintf(&perf, "%s%s ", perf, perfdata(metric_unit[i],
196 atol(row[1]), "", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0)); 196 atol(row[1]), "", false, 0, false, 0, false, 0, false, 0));
197 continue; 197 continue;
198 } 198 }
199 } 199 }
200 for(i = 0; i < LENGTH_METRIC_COUNTER; i++) { 200 for(i = 0; i < LENGTH_METRIC_COUNTER; i++) {
201 if (strcmp(row[0], metric_counter[i]) == 0) { 201 if (strcmp(row[0], metric_counter[i]) == 0) {
202 xasprintf(&perf, "%s%s ", perf, perfdata(metric_counter[i], 202 xasprintf(&perf, "%s%s ", perf, perfdata(metric_counter[i],
203 atol(row[1]), "c", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0)); 203 atol(row[1]), "c", false, 0, false, 0, false, 0, false, 0));
204 continue; 204 continue;
205 } 205 }
206 } 206 }
@@ -322,10 +322,10 @@ main (int argc, char **argv)
322 status = get_status(value, my_threshold); 322 status = get_status(value, my_threshold);
323 323
324 xasprintf (&perf, "%s %s", perf, fperfdata ("seconds behind master", value, "s", 324 xasprintf (&perf, "%s %s", perf, fperfdata ("seconds behind master", value, "s",
325 TRUE, (double) warning_time, 325 true, (double) warning_time,
326 TRUE, (double) critical_time, 326 true, (double) critical_time,
327 FALSE, 0, 327 false, 0,
328 FALSE, 0)); 328 false, 0));
329 329
330 if (status == STATE_WARNING) { 330 if (status == STATE_WARNING) {
331 printf("SLOW_SLAVE %s: %s|%s\n", _("WARNING"), slaveresult, perf); 331 printf("SLOW_SLAVE %s: %s|%s\n", _("WARNING"), slaveresult, perf);
@@ -456,10 +456,10 @@ process_arguments (int argc, char **argv)
456 db_port = atoi (optarg); 456 db_port = atoi (optarg);
457 break; 457 break;
458 case 'S': 458 case 'S':
459 check_slave = 1; /* check-slave */ 459 check_slave = true; /* check-slave */
460 break; 460 break;
461 case 'n': 461 case 'n':
462 ignore_auth = 1; /* ignore-auth */ 462 ignore_auth = true; /* ignore-auth */
463 break; 463 break;
464 case 'w': 464 case 'w':
465 warning = optarg; 465 warning = optarg;
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
index ac2fb15..842b7a2 100644
--- a/plugins/check_mysql_query.c
+++ b/plugins/check_mysql_query.c
@@ -162,10 +162,10 @@ main (int argc, char **argv)
162 } 162 }
163 printf(_("'%s' returned %f | %s"), sql_query, value, 163 printf(_("'%s' returned %f | %s"), sql_query, value,
164 fperfdata("result", value, "", 164 fperfdata("result", value, "",
165 my_thresholds->warning?TRUE:FALSE, my_thresholds->warning?my_thresholds->warning->end:0, 165 my_thresholds->warning?true:false, my_thresholds->warning?my_thresholds->warning->end:0,
166 my_thresholds->critical?TRUE:FALSE, my_thresholds->critical?my_thresholds->critical->end:0, 166 my_thresholds->critical?true:false, my_thresholds->critical?my_thresholds->critical->end:0,
167 FALSE, 0, 167 false, 0,
168 FALSE, 0) 168 false, 0)
169 ); 169 );
170 printf("\n"); 170 printf("\n");
171 171
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index d73d83c..19c050d 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -67,17 +67,17 @@ char *req_password=NULL;
67unsigned long lvalue_list[MAX_VALUE_LIST]; 67unsigned long lvalue_list[MAX_VALUE_LIST];
68unsigned long warning_value=0L; 68unsigned long warning_value=0L;
69unsigned long critical_value=0L; 69unsigned long critical_value=0L;
70int check_warning_value=FALSE; 70bool check_warning_value=false;
71int check_critical_value=FALSE; 71bool check_critical_value=false;
72enum checkvars vars_to_check = CHECK_NONE; 72enum checkvars vars_to_check = CHECK_NONE;
73int show_all=FALSE; 73bool show_all = false;
74 74
75char recv_buffer[MAX_INPUT_BUFFER]; 75char recv_buffer[MAX_INPUT_BUFFER];
76 76
77void fetch_data (const char* address, int port, const char* sendb); 77void fetch_data (const char* address, int port, const char* sendb);
78int process_arguments(int, char **); 78int process_arguments(int, char **);
79void preparelist(char *string); 79void preparelist(char *string);
80int strtoularray(unsigned long *array, char *string, const char *delim); 80bool strtoularray(unsigned long *array, char *string, const char *delim);
81void print_help(void); 81void print_help(void);
82void print_usage(void); 82void print_usage(void);
83 83
@@ -113,8 +113,8 @@ int main(int argc, char **argv){
113 int uphours=0; 113 int uphours=0;
114 int upminutes=0; 114 int upminutes=0;
115 115
116 int isPercent = FALSE; 116 bool isPercent = false;
117 int allRight = FALSE; 117 bool allRight = false;
118 118
119 setlocale (LC_ALL, ""); 119 setlocale (LC_ALL, "");
120 bindtextdomain (PACKAGE, LOCALEDIR); 120 bindtextdomain (PACKAGE, LOCALEDIR);
@@ -151,7 +151,7 @@ int main(int argc, char **argv){
151 151
152 if (value_list==NULL) 152 if (value_list==NULL)
153 output_message = strdup (_("missing -l parameters")); 153 output_message = strdup (_("missing -l parameters"));
154 else if (strtoularray(lvalue_list,value_list,",")==FALSE) 154 else if (! strtoularray(lvalue_list,value_list,","))
155 output_message = strdup (_("wrong -l parameter.")); 155 output_message = strdup (_("wrong -l parameter."));
156 else { 156 else {
157 /* -l parameters is present with only integers */ 157 /* -l parameters is present with only integers */
@@ -224,9 +224,9 @@ int main(int argc, char **argv){
224 224
225 xasprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"),updays, uphours, upminutes, uptime); 225 xasprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"),updays, uphours, upminutes, uptime);
226 226
227 if (check_critical_value==TRUE && uptime <= critical_value) 227 if (check_critical_value && uptime <= critical_value)
228 return_code=STATE_CRITICAL; 228 return_code=STATE_CRITICAL;
229 else if (check_warning_value==TRUE && uptime <= warning_value) 229 else if (check_warning_value && uptime <= warning_value)
230 return_code=STATE_WARNING; 230 return_code=STATE_WARNING;
231 else 231 else
232 return_code=STATE_OK; 232 return_code=STATE_OK;
@@ -261,9 +261,9 @@ int main(int argc, char **argv){
261 (total_disk_space - free_disk_space) / 1073741824, warning_used_space / 1073741824, 261 (total_disk_space - free_disk_space) / 1073741824, warning_used_space / 1073741824,
262 critical_used_space / 1073741824, total_disk_space / 1073741824); 262 critical_used_space / 1073741824, total_disk_space / 1073741824);
263 263
264 if(check_critical_value==TRUE && percent_used_space >= critical_value) 264 if(check_critical_value && percent_used_space >= critical_value)
265 return_code=STATE_CRITICAL; 265 return_code=STATE_CRITICAL;
266 else if (check_warning_value==TRUE && percent_used_space >= warning_value) 266 else if (check_warning_value && percent_used_space >= warning_value)
267 return_code=STATE_WARNING; 267 return_code=STATE_WARNING;
268 else 268 else
269 return_code=STATE_OK; 269 return_code=STATE_OK;
@@ -285,7 +285,7 @@ int main(int argc, char **argv){
285 else { 285 else {
286 preparelist(value_list); /* replace , between services with & to send the request */ 286 preparelist(value_list); /* replace , between services with & to send the request */
287 xasprintf(&send_buffer,"%s&%u&%s&%s", req_password,(vars_to_check==CHECK_SERVICESTATE)?5:6, 287 xasprintf(&send_buffer,"%s&%u&%s&%s", req_password,(vars_to_check==CHECK_SERVICESTATE)?5:6,
288 (show_all==TRUE) ? "ShowAll" : "ShowFail",value_list); 288 (show_all) ? "ShowAll" : "ShowFail",value_list);
289 fetch_data (server_address, server_port, send_buffer); 289 fetch_data (server_address, server_port, send_buffer);
290 numstr = strtok(recv_buffer,"&"); 290 numstr = strtok(recv_buffer,"&");
291 if (numstr == NULL) 291 if (numstr == NULL)
@@ -321,9 +321,9 @@ int main(int argc, char **argv){
321 warning_used_space / 1048567, critical_used_space / 1048567, mem_commitLimit / 1048567); 321 warning_used_space / 1048567, critical_used_space / 1048567, mem_commitLimit / 1048567);
322 322
323 return_code=STATE_OK; 323 return_code=STATE_OK;
324 if(check_critical_value==TRUE && percent_used_space >= critical_value) 324 if(check_critical_value && percent_used_space >= critical_value)
325 return_code=STATE_CRITICAL; 325 return_code=STATE_CRITICAL;
326 else if (check_warning_value==TRUE && percent_used_space >= warning_value) 326 else if (check_warning_value && percent_used_space >= warning_value)
327 return_code=STATE_WARNING; 327 return_code=STATE_WARNING;
328 328
329 break; 329 break;
@@ -371,7 +371,7 @@ int main(int argc, char **argv){
371 else if (isPercent) 371 else if (isPercent)
372 { 372 {
373 counter_unit = strdup ("%"); 373 counter_unit = strdup ("%");
374 allRight = TRUE; 374 allRight = true;
375 } 375 }
376 376
377 if ((counter_unit != NULL) && (!allRight)) 377 if ((counter_unit != NULL) && (!allRight))
@@ -391,7 +391,7 @@ int main(int argc, char **argv){
391 if ((fmaxval == 0) && (maxval == errcvt)) 391 if ((fmaxval == 0) && (maxval == errcvt))
392 output_message = strdup (_("Maximum value contains non-numbers")); 392 output_message = strdup (_("Maximum value contains non-numbers"));
393 else 393 else
394 allRight = TRUE; /* Everything is OK. */ 394 allRight = true; /* Everything is OK. */
395 395
396 } 396 }
397 } 397 }
@@ -418,9 +418,9 @@ int main(int argc, char **argv){
418 418
419 if (critical_value > warning_value) 419 if (critical_value > warning_value)
420 { /* Normal thresholds */ 420 { /* Normal thresholds */
421 if (check_critical_value == TRUE && counter_value >= critical_value) 421 if (check_critical_value && counter_value >= critical_value)
422 return_code = STATE_CRITICAL; 422 return_code = STATE_CRITICAL;
423 else if (check_warning_value == TRUE && counter_value >= warning_value) 423 else if (check_warning_value && counter_value >= warning_value)
424 return_code = STATE_WARNING; 424 return_code = STATE_WARNING;
425 else 425 else
426 return_code = STATE_OK; 426 return_code = STATE_OK;
@@ -428,9 +428,9 @@ int main(int argc, char **argv){
428 else 428 else
429 { /* inverse thresholds */ 429 { /* inverse thresholds */
430 return_code = STATE_OK; 430 return_code = STATE_OK;
431 if (check_critical_value == TRUE && counter_value <= critical_value) 431 if (check_critical_value && counter_value <= critical_value)
432 return_code = STATE_CRITICAL; 432 return_code = STATE_CRITICAL;
433 else if (check_warning_value == TRUE && counter_value <= warning_value) 433 else if (check_warning_value && counter_value <= warning_value)
434 return_code = STATE_WARNING; 434 return_code = STATE_WARNING;
435 } 435 }
436 break; 436 break;
@@ -448,17 +448,17 @@ int main(int argc, char **argv){
448 output_message = strdup (description); 448 output_message = strdup (description);
449 449
450 if (critical_value > warning_value) { /* Normal thresholds */ 450 if (critical_value > warning_value) { /* Normal thresholds */
451 if(check_critical_value==TRUE && age_in_minutes >= critical_value) 451 if(check_critical_value && age_in_minutes >= critical_value)
452 return_code=STATE_CRITICAL; 452 return_code=STATE_CRITICAL;
453 else if (check_warning_value==TRUE && age_in_minutes >= warning_value) 453 else if (check_warning_value && age_in_minutes >= warning_value)
454 return_code=STATE_WARNING; 454 return_code=STATE_WARNING;
455 else 455 else
456 return_code=STATE_OK; 456 return_code=STATE_OK;
457 } 457 }
458 else { /* inverse thresholds */ 458 else { /* inverse thresholds */
459 if(check_critical_value==TRUE && age_in_minutes <= critical_value) 459 if(check_critical_value && age_in_minutes <= critical_value)
460 return_code=STATE_CRITICAL; 460 return_code=STATE_CRITICAL;
461 else if (check_warning_value==TRUE && age_in_minutes <= warning_value) 461 else if (check_warning_value && age_in_minutes <= warning_value)
462 return_code=STATE_WARNING; 462 return_code=STATE_WARNING;
463 else 463 else
464 return_code=STATE_OK; 464 return_code=STATE_OK;
@@ -600,15 +600,15 @@ int process_arguments(int argc, char **argv){
600 break; 600 break;
601 case 'w': /* warning threshold */ 601 case 'w': /* warning threshold */
602 warning_value=strtoul(optarg,NULL,10); 602 warning_value=strtoul(optarg,NULL,10);
603 check_warning_value=TRUE; 603 check_warning_value=true;
604 break; 604 break;
605 case 'c': /* critical threshold */ 605 case 'c': /* critical threshold */
606 critical_value=strtoul(optarg,NULL,10); 606 critical_value=strtoul(optarg,NULL,10);
607 check_critical_value=TRUE; 607 check_critical_value=true;
608 break; 608 break;
609 case 'd': /* Display select for services */ 609 case 'd': /* Display select for services */
610 if (!strcmp(optarg,"SHOWALL")) 610 if (!strcmp(optarg,"SHOWALL"))
611 show_all = TRUE; 611 show_all = true;
612 break; 612 break;
613 case 'u': 613 case 'u':
614 socket_timeout_state=STATE_UNKNOWN; 614 socket_timeout_state=STATE_UNKNOWN;
@@ -646,7 +646,7 @@ void fetch_data (const char *address, int port, const char *sendb) {
646 die (STATE_UNKNOWN, "NSClient - %s\n",recv_buffer); 646 die (STATE_UNKNOWN, "NSClient - %s\n",recv_buffer);
647} 647}
648 648
649int strtoularray(unsigned long *array, char *string, const char *delim) { 649bool strtoularray(unsigned long *array, char *string, const char *delim) {
650 /* split a <delim> delimited string into a long array */ 650 /* split a <delim> delimited string into a long array */
651 int idx=0; 651 int idx=0;
652 char *t1; 652 char *t1;
@@ -660,9 +660,9 @@ int strtoularray(unsigned long *array, char *string, const char *delim) {
660 array[idx]=strtoul(t1,NULL,10); 660 array[idx]=strtoul(t1,NULL,10);
661 idx++; 661 idx++;
662 } else 662 } else
663 return FALSE; 663 return false;
664 } 664 }
665 return TRUE; 665 return true;
666} 666}
667 667
668void preparelist(char *string) { 668void preparelist(char *string) {
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 3614650..61b2d69 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -40,10 +40,10 @@ const char *email = "devel@monitoring-plugins.org";
40 40
41static char *server_address=NULL; 41static char *server_address=NULL;
42static int verbose=0; 42static int verbose=0;
43static short do_offset=0; 43static bool do_offset = false;
44static char *owarn="60"; 44static char *owarn="60";
45static char *ocrit="120"; 45static char *ocrit="120";
46static short do_jitter=0; 46static bool do_jitter = false;
47static char *jwarn="5000"; 47static char *jwarn="5000";
48static char *jcrit="10000"; 48static char *jcrit="10000";
49 49
@@ -486,7 +486,7 @@ double offset_request(const char *host, int *status){
486 } 486 }
487 487
488 /* cleanup */ 488 /* cleanup */
489 /* FIXME: Not closing the socket to avoid re-use of the local port 489 /* FIXME: Not closing the socket to avoid reuse of the local port
490 * which can cause old NTP packets to be read instead of NTP control 490 * which can cause old NTP packets to be read instead of NTP control
491 * packets in jitter_request(). THERE MUST BE ANOTHER WAY... 491 * packets in jitter_request(). THERE MUST BE ANOTHER WAY...
492 * for(j=0; j<num_hosts; j++){ close(socklist[j]); } */ 492 * for(j=0; j<num_hosts; j++){ close(socklist[j]); } */
@@ -513,7 +513,8 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
513 513
514/* XXX handle responses with the error bit set */ 514/* XXX handle responses with the error bit set */
515double jitter_request(int *status){ 515double jitter_request(int *status){
516 int conn=-1, i, npeers=0, num_candidates=0, syncsource_found=0; 516 int conn=-1, i, npeers=0, num_candidates=0;
517 bool syncsource_found = false;
517 int run=0, min_peer_sel=PEER_INCLUDED, num_selected=0, num_valid=0; 518 int run=0, min_peer_sel=PEER_INCLUDED, num_selected=0, num_valid=0;
518 int peers_size=0, peer_offset=0; 519 int peers_size=0, peer_offset=0;
519 ntp_assoc_status_pair *peers=NULL; 520 ntp_assoc_status_pair *peers=NULL;
@@ -570,7 +571,7 @@ double jitter_request(int *status){
570 if (PEER_SEL(peers[i].status) >= PEER_INCLUDED){ 571 if (PEER_SEL(peers[i].status) >= PEER_INCLUDED){
571 num_candidates++; 572 num_candidates++;
572 if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){ 573 if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){
573 syncsource_found=1; 574 syncsource_found = true;
574 min_peer_sel=PEER_SYNCSOURCE; 575 min_peer_sel=PEER_SYNCSOURCE;
575 } 576 }
576 } 577 }
@@ -699,23 +700,23 @@ int process_arguments(int argc, char **argv){
699 verbose++; 700 verbose++;
700 break; 701 break;
701 case 'w': 702 case 'w':
702 do_offset=1; 703 do_offset = true;
703 owarn = optarg; 704 owarn = optarg;
704 break; 705 break;
705 case 'c': 706 case 'c':
706 do_offset=1; 707 do_offset = true;
707 ocrit = optarg; 708 ocrit = optarg;
708 break; 709 break;
709 case 'j': 710 case 'j':
710 do_jitter=1; 711 do_jitter = true;
711 jwarn = optarg; 712 jwarn = optarg;
712 break; 713 break;
713 case 'k': 714 case 'k':
714 do_jitter=1; 715 do_jitter = true;
715 jcrit = optarg; 716 jcrit = optarg;
716 break; 717 break;
717 case 'H': 718 case 'H':
718 if(is_host(optarg) == FALSE) 719 if(!is_host(optarg))
719 usage2(_("Invalid hostname/address"), optarg); 720 usage2(_("Invalid hostname/address"), optarg);
720 server_address = strdup(optarg); 721 server_address = strdup(optarg);
721 break; 722 break;
@@ -749,9 +750,9 @@ int process_arguments(int argc, char **argv){
749char *perfd_offset (double offset) 750char *perfd_offset (double offset)
750{ 751{
751 return fperfdata ("offset", offset, "s", 752 return fperfdata ("offset", offset, "s",
752 TRUE, offset_thresholds->warning->end, 753 true, offset_thresholds->warning->end,
753 TRUE, offset_thresholds->critical->end, 754 true, offset_thresholds->critical->end,
754 FALSE, 0, FALSE, 0); 755 false, 0, false, 0);
755} 756}
756 757
757char *perfd_jitter (double jitter) 758char *perfd_jitter (double jitter)
@@ -759,7 +760,7 @@ char *perfd_jitter (double jitter)
759 return fperfdata ("jitter", jitter, "s", 760 return fperfdata ("jitter", jitter, "s",
760 do_jitter, jitter_thresholds->warning->end, 761 do_jitter, jitter_thresholds->warning->end,
761 do_jitter, jitter_thresholds->critical->end, 762 do_jitter, jitter_thresholds->critical->end,
762 TRUE, 0, FALSE, 0); 763 true, 0, false, 0);
763} 764}
764 765
765int main(int argc, char *argv[]){ 766int main(int argc, char *argv[]){
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c
index 49cb100..464a9e1 100644
--- a/plugins/check_ntp_peer.c
+++ b/plugins/check_ntp_peer.c
@@ -46,21 +46,20 @@ const char *email = "devel@monitoring-plugins.org";
46static char *server_address=NULL; 46static char *server_address=NULL;
47static int port=123; 47static int port=123;
48static int verbose=0; 48static int verbose=0;
49static int quiet=0; 49static bool quiet = false;
50static short do_offset=0;
51static char *owarn="60"; 50static char *owarn="60";
52static char *ocrit="120"; 51static char *ocrit="120";
53static short do_stratum=0; 52static bool do_stratum = false;
54static char *swarn="-1:16"; 53static char *swarn="-1:16";
55static char *scrit="-1:16"; 54static char *scrit="-1:16";
56static short do_jitter=0; 55static bool do_jitter = false;
57static char *jwarn="-1:5000"; 56static char *jwarn="-1:5000";
58static char *jcrit="-1:10000"; 57static char *jcrit="-1:10000";
59static short do_truechimers=0; 58static bool do_truechimers = false;
60static char *twarn="0:"; 59static char *twarn="0:";
61static char *tcrit="0:"; 60static char *tcrit="0:";
62static int syncsource_found=0; 61static bool syncsource_found = false;
63static int li_alarm=0; 62static bool li_alarm = false;
64 63
65int process_arguments (int, char **); 64int process_arguments (int, char **);
66thresholds *offset_thresholds = NULL; 65thresholds *offset_thresholds = NULL;
@@ -254,7 +253,7 @@ int ntp_request(double *offset, int *offset_result, double *jitter, int *stratum
254 die(STATE_CRITICAL, "NTP CRITICAL: Invalid packet received from NTP server\n"); 253 die(STATE_CRITICAL, "NTP CRITICAL: Invalid packet received from NTP server\n");
255 } while (!(req.op&OP_READSTAT && ntohs(req.seq) == 1)); 254 } while (!(req.op&OP_READSTAT && ntohs(req.seq) == 1));
256 255
257 if (LI(req.flags) == LI_ALARM) li_alarm = 1; 256 if (LI(req.flags) == LI_ALARM) li_alarm = true;
258 /* Each peer identifier is 4 bytes in the data section, which 257 /* Each peer identifier is 4 bytes in the data section, which
259 * we represent as a ntp_assoc_status_pair datatype. 258 * we represent as a ntp_assoc_status_pair datatype.
260 */ 259 */
@@ -276,7 +275,7 @@ int ntp_request(double *offset, int *offset_result, double *jitter, int *stratum
276 if(PEER_SEL(peers[i].status) >= PEER_INCLUDED){ 275 if(PEER_SEL(peers[i].status) >= PEER_INCLUDED){
277 num_candidates++; 276 num_candidates++;
278 if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){ 277 if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){
279 syncsource_found=1; 278 syncsource_found = true;
280 min_peer_sel=PEER_SYNCSOURCE; 279 min_peer_sel=PEER_SYNCSOURCE;
281 } 280 }
282 } 281 }
@@ -440,7 +439,7 @@ int process_arguments(int argc, char **argv){
440 if (argc < 2) 439 if (argc < 2)
441 usage ("\n"); 440 usage ("\n");
442 441
443 while (1) { 442 while (true) {
444 c = getopt_long (argc, argv, "Vhv46qw:c:W:C:j:k:m:n:t:H:p:", longopts, &option); 443 c = getopt_long (argc, argv, "Vhv46qw:c:W:C:j:k:m:n:t:H:p:", longopts, &option);
445 if (c == -1 || c == EOF || c == 1) 444 if (c == -1 || c == EOF || c == 1)
446 break; 445 break;
@@ -458,42 +457,40 @@ int process_arguments(int argc, char **argv){
458 verbose++; 457 verbose++;
459 break; 458 break;
460 case 'q': 459 case 'q':
461 quiet = 1; 460 quiet = true;
462 break; 461 break;
463 case 'w': 462 case 'w':
464 do_offset=1;
465 owarn = optarg; 463 owarn = optarg;
466 break; 464 break;
467 case 'c': 465 case 'c':
468 do_offset=1;
469 ocrit = optarg; 466 ocrit = optarg;
470 break; 467 break;
471 case 'W': 468 case 'W':
472 do_stratum=1; 469 do_stratum = true;
473 swarn = optarg; 470 swarn = optarg;
474 break; 471 break;
475 case 'C': 472 case 'C':
476 do_stratum=1; 473 do_stratum = true;
477 scrit = optarg; 474 scrit = optarg;
478 break; 475 break;
479 case 'j': 476 case 'j':
480 do_jitter=1; 477 do_jitter = true;
481 jwarn = optarg; 478 jwarn = optarg;
482 break; 479 break;
483 case 'k': 480 case 'k':
484 do_jitter=1; 481 do_jitter = true;
485 jcrit = optarg; 482 jcrit = optarg;
486 break; 483 break;
487 case 'm': 484 case 'm':
488 do_truechimers=1; 485 do_truechimers = true;
489 twarn = optarg; 486 twarn = optarg;
490 break; 487 break;
491 case 'n': 488 case 'n':
492 do_truechimers=1; 489 do_truechimers = true;
493 tcrit = optarg; 490 tcrit = optarg;
494 break; 491 break;
495 case 'H': 492 case 'H':
496 if(is_host(optarg) == FALSE) 493 if(!is_host(optarg))
497 usage2(_("Invalid hostname/address"), optarg); 494 usage2(_("Invalid hostname/address"), optarg);
498 server_address = strdup(optarg); 495 server_address = strdup(optarg);
499 break; 496 break;
@@ -530,9 +527,9 @@ int process_arguments(int argc, char **argv){
530char *perfd_offset (double offset) 527char *perfd_offset (double offset)
531{ 528{
532 return fperfdata ("offset", offset, "s", 529 return fperfdata ("offset", offset, "s",
533 TRUE, offset_thresholds->warning->end, 530 true, offset_thresholds->warning->end,
534 TRUE, offset_thresholds->critical->end, 531 true, offset_thresholds->critical->end,
535 FALSE, 0, FALSE, 0); 532 false, 0, false, 0);
536} 533}
537 534
538char *perfd_jitter (double jitter) 535char *perfd_jitter (double jitter)
@@ -540,7 +537,7 @@ char *perfd_jitter (double jitter)
540 return fperfdata ("jitter", jitter, "", 537 return fperfdata ("jitter", jitter, "",
541 do_jitter, jitter_thresholds->warning->end, 538 do_jitter, jitter_thresholds->warning->end,
542 do_jitter, jitter_thresholds->critical->end, 539 do_jitter, jitter_thresholds->critical->end,
543 TRUE, 0, FALSE, 0); 540 true, 0, false, 0);
544} 541}
545 542
546char *perfd_stratum (int stratum) 543char *perfd_stratum (int stratum)
@@ -548,7 +545,7 @@ char *perfd_stratum (int stratum)
548 return perfdata ("stratum", stratum, "", 545 return perfdata ("stratum", stratum, "",
549 do_stratum, (int)stratum_thresholds->warning->end, 546 do_stratum, (int)stratum_thresholds->warning->end,
550 do_stratum, (int)stratum_thresholds->critical->end, 547 do_stratum, (int)stratum_thresholds->critical->end,
551 TRUE, 0, TRUE, 16); 548 true, 0, true, 16);
552} 549}
553 550
554char *perfd_truechimers (int num_truechimers) 551char *perfd_truechimers (int num_truechimers)
@@ -556,11 +553,11 @@ char *perfd_truechimers (int num_truechimers)
556 return perfdata ("truechimers", num_truechimers, "", 553 return perfdata ("truechimers", num_truechimers, "",
557 do_truechimers, (int)truechimer_thresholds->warning->end, 554 do_truechimers, (int)truechimer_thresholds->warning->end,
558 do_truechimers, (int)truechimer_thresholds->critical->end, 555 do_truechimers, (int)truechimer_thresholds->critical->end,
559 TRUE, 0, FALSE, 0); 556 true, 0, false, 0);
560} 557}
561 558
562int main(int argc, char *argv[]){ 559int main(int argc, char *argv[]){
563 int result, offset_result, stratum, num_truechimers, oresult, jresult, sresult, tresult; 560 int result, offset_result, stratum, num_truechimers;
564 double offset=0, jitter=0; 561 double offset=0, jitter=0;
565 char *result_line, *perfdata_line; 562 char *result_line, *perfdata_line;
566 563
@@ -590,25 +587,35 @@ int main(int argc, char *argv[]){
590 587
591 if(offset_result == STATE_UNKNOWN) { 588 if(offset_result == STATE_UNKNOWN) {
592 /* if there's no sync peer (this overrides ntp_request output): */ 589 /* if there's no sync peer (this overrides ntp_request output): */
593 result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL); 590 result = (quiet ? STATE_UNKNOWN : STATE_CRITICAL);
594 } else { 591 } else {
595 /* Be quiet if there's no candidates either */ 592 /* Be quiet if there's no candidates either */
596 if (quiet == 1 && result == STATE_WARNING) 593 if (quiet && result == STATE_WARNING)
597 result = STATE_UNKNOWN; 594 result = STATE_UNKNOWN;
598 result = max_state_alt(result, get_status(fabs(offset), offset_thresholds)); 595 result = max_state_alt(result, get_status(fabs(offset), offset_thresholds));
599 } 596 }
600 oresult = result; 597
598 int oresult = result;
599
600
601 int tresult = STATE_UNKNOWN;
601 602
602 if(do_truechimers) { 603 if(do_truechimers) {
603 tresult = get_status(num_truechimers, truechimer_thresholds); 604 tresult = get_status(num_truechimers, truechimer_thresholds);
604 result = max_state_alt(result, tresult); 605 result = max_state_alt(result, tresult);
605 } 606 }
606 607
608
609 int sresult = STATE_UNKNOWN;
610
607 if(do_stratum) { 611 if(do_stratum) {
608 sresult = get_status(stratum, stratum_thresholds); 612 sresult = get_status(stratum, stratum_thresholds);
609 result = max_state_alt(result, sresult); 613 result = max_state_alt(result, sresult);
610 } 614 }
611 615
616
617 int jresult = STATE_UNKNOWN;
618
612 if(do_jitter) { 619 if(do_jitter) {
613 jresult = get_status(jitter, jitter_thresholds); 620 jresult = get_status(jitter, jitter_thresholds);
614 result = max_state_alt(result, jresult); 621 result = max_state_alt(result, jresult);
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index 46cc604..b2e1655 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -45,7 +45,7 @@ const char *email = "devel@monitoring-plugins.org";
45static char *server_address=NULL; 45static char *server_address=NULL;
46static char *port="123"; 46static char *port="123";
47static int verbose=0; 47static int verbose=0;
48static int quiet=0; 48static bool quiet = false;
49static char *owarn="60"; 49static char *owarn="60";
50static char *ocrit="120"; 50static char *ocrit="120";
51static int time_offset=0; 51static int time_offset=0;
@@ -485,7 +485,7 @@ int process_arguments(int argc, char **argv){
485 verbose++; 485 verbose++;
486 break; 486 break;
487 case 'q': 487 case 'q':
488 quiet = 1; 488 quiet = true;
489 break; 489 break;
490 case 'w': 490 case 'w':
491 owarn = optarg; 491 owarn = optarg;
@@ -494,7 +494,7 @@ int process_arguments(int argc, char **argv){
494 ocrit = optarg; 494 ocrit = optarg;
495 break; 495 break;
496 case 'H': 496 case 'H':
497 if(is_host(optarg) == FALSE) 497 if(!is_host(optarg))
498 usage2(_("Invalid hostname/address"), optarg); 498 usage2(_("Invalid hostname/address"), optarg);
499 server_address = strdup(optarg); 499 server_address = strdup(optarg);
500 break; 500 break;
@@ -531,12 +531,11 @@ int process_arguments(int argc, char **argv){
531 return 0; 531 return 0;
532} 532}
533 533
534char *perfd_offset (double offset) 534char *perfd_offset (double offset) {
535{
536 return fperfdata ("offset", offset, "s", 535 return fperfdata ("offset", offset, "s",
537 TRUE, offset_thresholds->warning->end, 536 true, offset_thresholds->warning->end,
538 TRUE, offset_thresholds->critical->end, 537 true, offset_thresholds->critical->end,
539 FALSE, 0, FALSE, 0); 538 false, 0, false, 0);
540} 539}
541 540
542int main(int argc, char *argv[]){ 541int main(int argc, char *argv[]){
@@ -566,7 +565,7 @@ int main(int argc, char *argv[]){
566 565
567 offset = offset_request(server_address, &offset_result); 566 offset = offset_request(server_address, &offset_result);
568 if (offset_result == STATE_UNKNOWN) { 567 if (offset_result == STATE_UNKNOWN) {
569 result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL); 568 result = ( (!quiet) ? STATE_UNKNOWN : STATE_CRITICAL);
570 } else { 569 } else {
571 result = get_status(fabs(offset), offset_thresholds); 570 result = get_status(fabs(offset), offset_thresholds);
572 } 571 }
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 3c9d23e..10c493b 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -46,6 +46,7 @@ enum checkvar {
46 VPF, /* check % free space on volume */ 46 VPF, /* check % free space on volume */
47 VMF, /* check MB free space on volume */ 47 VMF, /* check MB free space on volume */
48 VMU, /* check MB used space on volume */ 48 VMU, /* check MB used space on volume */
49 VPU, /* check % used space on volume */
49 VMP, /* check MB purgeable space on volume */ 50 VMP, /* check MB purgeable space on volume */
50 VKF, /* check KB free space on volume */ 51 VKF, /* check KB free space on volume */
51 LTCH, /* check long-term cache hit percentage */ 52 LTCH, /* check long-term cache hit percentage */
@@ -104,9 +105,9 @@ char *nss7_name=NULL;
104int server_port=PORT; 105int server_port=PORT;
105unsigned long warning_value=0L; 106unsigned long warning_value=0L;
106unsigned long critical_value=0L; 107unsigned long critical_value=0L;
107int check_warning_value=FALSE; 108bool check_warning_value = false;
108int check_critical_value=FALSE; 109bool check_critical_value = false;
109int check_netware_version=FALSE; 110bool check_netware_version = false;
110enum checkvar vars_to_check = NONE; 111enum checkvar vars_to_check = NONE;
111int sap_number=-1; 112int sap_number=-1;
112 113
@@ -146,6 +147,8 @@ main(int argc, char **argv) {
146 unsigned long nss6_value=0L; 147 unsigned long nss6_value=0L;
147 unsigned long nss7_value=0L; 148 unsigned long nss7_value=0L;
148 unsigned long total_disk_space=0L; 149 unsigned long total_disk_space=0L;
150 unsigned long used_disk_space=0L;
151 unsigned long percent_used_disk_space=0L;
149 unsigned long purgeable_disk_space=0L; 152 unsigned long purgeable_disk_space=0L;
150 unsigned long non_purgeable_disk_space=0L; 153 unsigned long non_purgeable_disk_space=0L;
151 unsigned long percent_free_space=0; 154 unsigned long percent_free_space=0;
@@ -182,7 +185,7 @@ main(int argc, char **argv) {
182 my_tcp_connect (server_address, server_port, &sd); 185 my_tcp_connect (server_address, server_port, &sd);
183 186
184 /* get OS version string */ 187 /* get OS version string */
185 if (check_netware_version==TRUE) { 188 if (check_netware_version) {
186 send_buffer = strdup ("S19\r\n"); 189 send_buffer = strdup ("S19\r\n");
187 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer)); 190 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
188 if (result!=STATE_OK) 191 if (result!=STATE_OK)
@@ -231,9 +234,9 @@ main(int argc, char **argv) {
231 recv_buffer[strlen(recv_buffer)-1]=0; 234 recv_buffer[strlen(recv_buffer)-1]=0;
232 sprintf(uptime,_("Up %s,"),recv_buffer); 235 sprintf(uptime,_("Up %s,"),recv_buffer);
233 236
234 if (check_critical_value==TRUE && utilization >= critical_value) 237 if (check_critical_value && utilization >= critical_value)
235 result=STATE_CRITICAL; 238 result=STATE_CRITICAL;
236 else if (check_warning_value==TRUE && utilization >= warning_value) 239 else if (check_warning_value && utilization >= warning_value)
237 result=STATE_WARNING; 240 result=STATE_WARNING;
238 241
239 xasprintf (&output_message, 242 xasprintf (&output_message,
@@ -259,9 +262,9 @@ main(int argc, char **argv) {
259 return result; 262 return result;
260 current_connections=strtoul(recv_buffer,NULL,10); 263 current_connections=strtoul(recv_buffer,NULL,10);
261 264
262 if (check_critical_value==TRUE && current_connections >= critical_value) 265 if (check_critical_value && current_connections >= critical_value)
263 result=STATE_CRITICAL; 266 result=STATE_CRITICAL;
264 else if (check_warning_value==TRUE && current_connections >= warning_value) 267 else if (check_warning_value && current_connections >= warning_value)
265 result=STATE_WARNING; 268 result=STATE_WARNING;
266 269
267 xasprintf (&output_message, 270 xasprintf (&output_message,
@@ -284,9 +287,9 @@ main(int argc, char **argv) {
284 return result; 287 return result;
285 cache_hits=atoi(recv_buffer); 288 cache_hits=atoi(recv_buffer);
286 289
287 if (check_critical_value==TRUE && cache_hits <= critical_value) 290 if (check_critical_value && cache_hits <= critical_value)
288 result=STATE_CRITICAL; 291 result=STATE_CRITICAL;
289 else if (check_warning_value==TRUE && cache_hits <= warning_value) 292 else if (check_warning_value && cache_hits <= warning_value)
290 result=STATE_WARNING; 293 result=STATE_WARNING;
291 294
292 xasprintf (&output_message, 295 xasprintf (&output_message,
@@ -306,9 +309,9 @@ main(int argc, char **argv) {
306 return result; 309 return result;
307 cache_buffers=strtoul(recv_buffer,NULL,10); 310 cache_buffers=strtoul(recv_buffer,NULL,10);
308 311
309 if (check_critical_value==TRUE && cache_buffers <= critical_value) 312 if (check_critical_value && cache_buffers <= critical_value)
310 result=STATE_CRITICAL; 313 result=STATE_CRITICAL;
311 else if (check_warning_value==TRUE && cache_buffers <= warning_value) 314 else if (check_warning_value && cache_buffers <= warning_value)
312 result=STATE_WARNING; 315 result=STATE_WARNING;
313 316
314 xasprintf (&output_message, 317 xasprintf (&output_message,
@@ -331,9 +334,9 @@ main(int argc, char **argv) {
331 return result; 334 return result;
332 cache_buffers=strtoul(recv_buffer,NULL,10); 335 cache_buffers=strtoul(recv_buffer,NULL,10);
333 336
334 if (check_critical_value==TRUE && cache_buffers >= critical_value) 337 if (check_critical_value && cache_buffers >= critical_value)
335 result=STATE_CRITICAL; 338 result=STATE_CRITICAL;
336 else if (check_warning_value==TRUE && cache_buffers >= warning_value) 339 else if (check_warning_value && cache_buffers >= warning_value)
337 result=STATE_WARNING; 340 result=STATE_WARNING;
338 341
339 xasprintf (&output_message, 342 xasprintf (&output_message,
@@ -356,9 +359,9 @@ main(int argc, char **argv) {
356 return result; 359 return result;
357 lru_time=strtoul(recv_buffer,NULL,10); 360 lru_time=strtoul(recv_buffer,NULL,10);
358 361
359 if (check_critical_value==TRUE && lru_time <= critical_value) 362 if (check_critical_value && lru_time <= critical_value)
360 result=STATE_CRITICAL; 363 result=STATE_CRITICAL;
361 else if (check_warning_value==TRUE && lru_time <= warning_value) 364 else if (check_warning_value && lru_time <= warning_value)
362 result=STATE_WARNING; 365 result=STATE_WARNING;
363 366
364 xasprintf (&output_message, 367 xasprintf (&output_message,
@@ -383,9 +386,9 @@ main(int argc, char **argv) {
383 result=STATE_CRITICAL; 386 result=STATE_CRITICAL;
384 } else { 387 } else {
385 free_disk_space=strtoul(recv_buffer,NULL,10); 388 free_disk_space=strtoul(recv_buffer,NULL,10);
386 if (check_critical_value==TRUE && free_disk_space <= critical_value) 389 if (check_critical_value && free_disk_space <= critical_value)
387 result=STATE_CRITICAL; 390 result=STATE_CRITICAL;
388 else if (check_warning_value==TRUE && free_disk_space <= warning_value) 391 else if (check_warning_value && free_disk_space <= warning_value)
389 result=STATE_WARNING; 392 result=STATE_WARNING;
390 xasprintf (&output_message, 393 xasprintf (&output_message,
391 _("%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"), 394 _("%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"),
@@ -411,9 +414,9 @@ main(int argc, char **argv) {
411 result=STATE_CRITICAL; 414 result=STATE_CRITICAL;
412 } else { 415 } else {
413 free_disk_space=strtoul(recv_buffer,NULL,10); 416 free_disk_space=strtoul(recv_buffer,NULL,10);
414 if (check_critical_value==TRUE && free_disk_space <= critical_value) 417 if (check_critical_value && free_disk_space <= critical_value)
415 result=STATE_CRITICAL; 418 result=STATE_CRITICAL;
416 else if (check_warning_value==TRUE && free_disk_space <= warning_value) 419 else if (check_warning_value && free_disk_space <= warning_value)
417 result=STATE_WARNING; 420 result=STATE_WARNING;
418 xasprintf (&output_message, 421 xasprintf (&output_message,
419 _("%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"), 422 _("%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"),
@@ -438,9 +441,9 @@ main(int argc, char **argv) {
438 result=STATE_CRITICAL; 441 result=STATE_CRITICAL;
439 } else { 442 } else {
440 free_disk_space=strtoul(recv_buffer,NULL,10); 443 free_disk_space=strtoul(recv_buffer,NULL,10);
441 if (check_critical_value==TRUE && free_disk_space <= critical_value) 444 if (check_critical_value && free_disk_space <= critical_value)
442 result=STATE_CRITICAL; 445 result=STATE_CRITICAL;
443 else if (check_warning_value==TRUE && free_disk_space <= warning_value) 446 else if (check_warning_value && free_disk_space <= warning_value)
444 result=STATE_WARNING; 447 result=STATE_WARNING;
445 xasprintf (&output_message, 448 xasprintf (&output_message,
446 _("%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"), 449 _("%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"),
@@ -452,7 +455,50 @@ main(int argc, char **argv) {
452 warning_value, 455 warning_value,
453 critical_value); 456 critical_value);
454 } 457 }
458 /* check % used space on volume */
459 } else if (vars_to_check==VPU) {
460 close(sd);
461 my_tcp_connect (server_address, server_port, &sd);
462
463 asprintf (&send_buffer,"VMU%s\r\n",volume_name);
464 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
465
466 if (result!=STATE_OK)
467 return result;
468
469 if (!strcmp(recv_buffer,"-1\n")) {
470 asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
471 result=STATE_CRITICAL;
472
473 } else {
474 used_disk_space=strtoul(recv_buffer,NULL,10);
475 close(sd);
476 my_tcp_connect (server_address, server_port, &sd);
477 /* get total volume in MB */
478 asprintf (&send_buffer,"VMS%s\r\n",volume_name);
479 result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
480 if (result!=STATE_OK)
481 return result;
482 total_disk_space=strtoul(recv_buffer,NULL,10);
483 /* calculate percent used on volume */
484 percent_used_disk_space=(unsigned long)(((double)used_disk_space/(double)total_disk_space)*100.0);
455 485
486 if (check_critical_value && percent_used_disk_space >= critical_value)
487 result=STATE_CRITICAL;
488 else if (check_warning_value && percent_used_disk_space >= warning_value)
489 result=STATE_WARNING;
490
491 asprintf (&output_message,_("%lu MB (%lu%%) used on volume %s - total %lu MB|Used space in percent on %s=%lu;%lu;%lu;0;100"),
492 used_disk_space,
493 percent_used_disk_space,
494 volume_name,
495 total_disk_space,
496 volume_name,
497 percent_used_disk_space,
498 warning_value,
499 critical_value
500 );
501 }
456 502
457 /* check % free space on volume */ 503 /* check % free space on volume */
458 } else if (vars_to_check==VPF) { 504 } else if (vars_to_check==VPF) {
@@ -485,9 +531,9 @@ main(int argc, char **argv) {
485 531
486 percent_free_space=(unsigned long)(((double)free_disk_space/(double)total_disk_space)*100.0); 532 percent_free_space=(unsigned long)(((double)free_disk_space/(double)total_disk_space)*100.0);
487 533
488 if (check_critical_value==TRUE && percent_free_space <= critical_value) 534 if (check_critical_value && percent_free_space <= critical_value)
489 result=STATE_CRITICAL; 535 result=STATE_CRITICAL;
490 else if (check_warning_value==TRUE && percent_free_space <= warning_value) 536 else if (check_warning_value && percent_free_space <= warning_value)
491 result=STATE_WARNING; 537 result=STATE_WARNING;
492 free_disk_space/=1024; 538 free_disk_space/=1024;
493 total_disk_space/=1024; 539 total_disk_space/=1024;
@@ -596,14 +642,14 @@ main(int argc, char **argv) {
596 percent_used_packet_receive_buffers=(unsigned long)(((double)used_packet_receive_buffers/(double)max_packet_receive_buffers)*100.0); 642 percent_used_packet_receive_buffers=(unsigned long)(((double)used_packet_receive_buffers/(double)max_packet_receive_buffers)*100.0);
597 643
598 if (vars_to_check==UPRB) { 644 if (vars_to_check==UPRB) {
599 if (check_critical_value==TRUE && used_packet_receive_buffers >= critical_value) 645 if (check_critical_value && used_packet_receive_buffers >= critical_value)
600 result=STATE_CRITICAL; 646 result=STATE_CRITICAL;
601 else if (check_warning_value==TRUE && used_packet_receive_buffers >= warning_value) 647 else if (check_warning_value && used_packet_receive_buffers >= warning_value)
602 result=STATE_WARNING; 648 result=STATE_WARNING;
603 } else { 649 } else {
604 if (check_critical_value==TRUE && percent_used_packet_receive_buffers >= critical_value) 650 if (check_critical_value && percent_used_packet_receive_buffers >= critical_value)
605 result=STATE_CRITICAL; 651 result=STATE_CRITICAL;
606 else if (check_warning_value==TRUE && percent_used_packet_receive_buffers >= warning_value) 652 else if (check_warning_value && percent_used_packet_receive_buffers >= warning_value)
607 result=STATE_WARNING; 653 result=STATE_WARNING;
608 } 654 }
609 655
@@ -625,9 +671,9 @@ main(int argc, char **argv) {
625 671
626 sap_entries=atoi(recv_buffer); 672 sap_entries=atoi(recv_buffer);
627 673
628 if (check_critical_value==TRUE && sap_entries >= critical_value) 674 if (check_critical_value && sap_entries >= critical_value)
629 result=STATE_CRITICAL; 675 result=STATE_CRITICAL;
630 else if (check_warning_value==TRUE && sap_entries >= warning_value) 676 else if (check_warning_value && sap_entries >= warning_value)
631 result=STATE_WARNING; 677 result=STATE_WARNING;
632 678
633 if (sap_number==-1) 679 if (sap_number==-1)
@@ -651,9 +697,9 @@ main(int argc, char **argv) {
651 result=STATE_CRITICAL; 697 result=STATE_CRITICAL;
652 } else { 698 } else {
653 purgeable_disk_space=strtoul(recv_buffer,NULL,10); 699 purgeable_disk_space=strtoul(recv_buffer,NULL,10);
654 if (check_critical_value==TRUE && purgeable_disk_space >= critical_value) 700 if (check_critical_value && purgeable_disk_space >= critical_value)
655 result=STATE_CRITICAL; 701 result=STATE_CRITICAL;
656 else if (check_warning_value==TRUE && purgeable_disk_space >= warning_value) 702 else if (check_warning_value && purgeable_disk_space >= warning_value)
657 result=STATE_WARNING; 703 result=STATE_WARNING;
658 xasprintf (&output_message,_("%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"), 704 xasprintf (&output_message,_("%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"),
659 (result==STATE_OK)?"":_("Only "), 705 (result==STATE_OK)?"":_("Only "),
@@ -677,9 +723,9 @@ main(int argc, char **argv) {
677 result=STATE_CRITICAL; 723 result=STATE_CRITICAL;
678 } else { 724 } else {
679 purgeable_disk_space=strtoul(recv_buffer,NULL,10); 725 purgeable_disk_space=strtoul(recv_buffer,NULL,10);
680 if (check_critical_value==TRUE && purgeable_disk_space >= critical_value) 726 if (check_critical_value && purgeable_disk_space >= critical_value)
681 result=STATE_CRITICAL; 727 result=STATE_CRITICAL;
682 else if (check_warning_value==TRUE && purgeable_disk_space >= warning_value) 728 else if (check_warning_value && purgeable_disk_space >= warning_value)
683 result=STATE_WARNING; 729 result=STATE_WARNING;
684 xasprintf (&output_message,_("%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"), 730 xasprintf (&output_message,_("%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"),
685 (result==STATE_OK)?"":_("Only "), 731 (result==STATE_OK)?"":_("Only "),
@@ -722,9 +768,9 @@ main(int argc, char **argv) {
722 768
723 percent_purgeable_space=(unsigned long)(((double)purgeable_disk_space/(double)total_disk_space)*100.0); 769 percent_purgeable_space=(unsigned long)(((double)purgeable_disk_space/(double)total_disk_space)*100.0);
724 770
725 if (check_critical_value==TRUE && percent_purgeable_space >= critical_value) 771 if (check_critical_value && percent_purgeable_space >= critical_value)
726 result=STATE_CRITICAL; 772 result=STATE_CRITICAL;
727 else if (check_warning_value==TRUE && percent_purgeable_space >= warning_value) 773 else if (check_warning_value && percent_purgeable_space >= warning_value)
728 result=STATE_WARNING; 774 result=STATE_WARNING;
729 purgeable_disk_space/=1024; 775 purgeable_disk_space/=1024;
730 xasprintf (&output_message,_("%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"), 776 xasprintf (&output_message,_("%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"),
@@ -754,9 +800,9 @@ main(int argc, char **argv) {
754 result=STATE_CRITICAL; 800 result=STATE_CRITICAL;
755 } else { 801 } else {
756 non_purgeable_disk_space=strtoul(recv_buffer,NULL,10); 802 non_purgeable_disk_space=strtoul(recv_buffer,NULL,10);
757 if (check_critical_value==TRUE && non_purgeable_disk_space >= critical_value) 803 if (check_critical_value && non_purgeable_disk_space >= critical_value)
758 result=STATE_CRITICAL; 804 result=STATE_CRITICAL;
759 else if (check_warning_value==TRUE && non_purgeable_disk_space >= warning_value) 805 else if (check_warning_value && non_purgeable_disk_space >= warning_value)
760 result=STATE_WARNING; 806 result=STATE_WARNING;
761 xasprintf (&output_message,_("%s%lu KB not yet purgeable on volume %s"),(result==STATE_OK)?"":_("Only "),non_purgeable_disk_space,volume_name); 807 xasprintf (&output_message,_("%s%lu KB not yet purgeable on volume %s"),(result==STATE_OK)?"":_("Only "),non_purgeable_disk_space,volume_name);
762 } 808 }
@@ -792,9 +838,9 @@ main(int argc, char **argv) {
792 838
793 percent_non_purgeable_space=(unsigned long)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0); 839 percent_non_purgeable_space=(unsigned long)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0);
794 840
795 if (check_critical_value==TRUE && percent_non_purgeable_space >= critical_value) 841 if (check_critical_value && percent_non_purgeable_space >= critical_value)
796 result=STATE_CRITICAL; 842 result=STATE_CRITICAL;
797 else if (check_warning_value==TRUE && percent_non_purgeable_space >= warning_value) 843 else if (check_warning_value && percent_non_purgeable_space >= warning_value)
798 result=STATE_WARNING; 844 result=STATE_WARNING;
799 purgeable_disk_space/=1024; 845 purgeable_disk_space/=1024;
800 xasprintf (&output_message,_("%lu MB (%lu%%) not yet purgeable on volume %s"),non_purgeable_disk_space,percent_non_purgeable_space,volume_name); 846 xasprintf (&output_message,_("%lu MB (%lu%%) not yet purgeable on volume %s"),non_purgeable_disk_space,percent_non_purgeable_space,volume_name);
@@ -813,9 +859,9 @@ main(int argc, char **argv) {
813 859
814 open_files=atoi(recv_buffer); 860 open_files=atoi(recv_buffer);
815 861
816 if (check_critical_value==TRUE && open_files >= critical_value) 862 if (check_critical_value && open_files >= critical_value)
817 result=STATE_CRITICAL; 863 result=STATE_CRITICAL;
818 else if (check_warning_value==TRUE && open_files >= warning_value) 864 else if (check_warning_value && open_files >= warning_value)
819 result=STATE_WARNING; 865 result=STATE_WARNING;
820 866
821 xasprintf (&output_message,_("%lu open files|Openfiles=%lu;%lu;%lu;0,0"), 867 xasprintf (&output_message,_("%lu open files|Openfiles=%lu;%lu;%lu;0,0"),
@@ -838,9 +884,9 @@ main(int argc, char **argv) {
838 884
839 abended_threads=atoi(recv_buffer); 885 abended_threads=atoi(recv_buffer);
840 886
841 if (check_critical_value==TRUE && abended_threads >= critical_value) 887 if (check_critical_value && abended_threads >= critical_value)
842 result=STATE_CRITICAL; 888 result=STATE_CRITICAL;
843 else if (check_warning_value==TRUE && abended_threads >= warning_value) 889 else if (check_warning_value && abended_threads >= warning_value)
844 result=STATE_WARNING; 890 result=STATE_WARNING;
845 891
846 xasprintf (&output_message,_("%lu abended threads|Abends=%lu;%lu;%lu;;"), 892 xasprintf (&output_message,_("%lu abended threads|Abends=%lu;%lu;%lu;;"),
@@ -872,9 +918,9 @@ main(int argc, char **argv) {
872 918
873 current_service_processes=atoi(recv_buffer); 919 current_service_processes=atoi(recv_buffer);
874 920
875 if (check_critical_value==TRUE && current_service_processes >= critical_value) 921 if (check_critical_value && current_service_processes >= critical_value)
876 result=STATE_CRITICAL; 922 result=STATE_CRITICAL;
877 else if (check_warning_value==TRUE && current_service_processes >= warning_value) 923 else if (check_warning_value && current_service_processes >= warning_value)
878 result=STATE_WARNING; 924 result=STATE_WARNING;
879 925
880 xasprintf (&output_message, 926 xasprintf (&output_message,
@@ -923,9 +969,9 @@ main(int argc, char **argv) {
923 return result; 969 return result;
924 lru_time=strtoul(recv_buffer,NULL,10); 970 lru_time=strtoul(recv_buffer,NULL,10);
925 971
926 if (check_critical_value==TRUE && lru_time <= critical_value) 972 if (check_critical_value && lru_time <= critical_value)
927 result=STATE_CRITICAL; 973 result=STATE_CRITICAL;
928 else if (check_warning_value==TRUE && lru_time <= warning_value) 974 else if (check_warning_value && lru_time <= warning_value)
929 result=STATE_WARNING; 975 result=STATE_WARNING;
930 xasprintf (&output_message,_("LRU sitting time = %lu seconds"),lru_time); 976 xasprintf (&output_message,_("LRU sitting time = %lu seconds"),lru_time);
931 977
@@ -942,9 +988,9 @@ main(int argc, char **argv) {
942 return result; 988 return result;
943 dirty_cache_buffers=atoi(recv_buffer); 989 dirty_cache_buffers=atoi(recv_buffer);
944 990
945 if (check_critical_value==TRUE && dirty_cache_buffers <= critical_value) 991 if (check_critical_value && dirty_cache_buffers <= critical_value)
946 result=STATE_CRITICAL; 992 result=STATE_CRITICAL;
947 else if (check_warning_value==TRUE && dirty_cache_buffers <= warning_value) 993 else if (check_warning_value && dirty_cache_buffers <= warning_value)
948 result=STATE_WARNING; 994 result=STATE_WARNING;
949 xasprintf (&output_message,_("Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"), 995 xasprintf (&output_message,_("Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"),
950 dirty_cache_buffers, 996 dirty_cache_buffers,
@@ -964,9 +1010,9 @@ main(int argc, char **argv) {
964 return result; 1010 return result;
965 total_cache_buffers=atoi(recv_buffer); 1011 total_cache_buffers=atoi(recv_buffer);
966 1012
967 if (check_critical_value==TRUE && total_cache_buffers <= critical_value) 1013 if (check_critical_value && total_cache_buffers <= critical_value)
968 result=STATE_CRITICAL; 1014 result=STATE_CRITICAL;
969 else if (check_warning_value==TRUE && total_cache_buffers <= warning_value) 1015 else if (check_warning_value && total_cache_buffers <= warning_value)
970 result=STATE_WARNING; 1016 result=STATE_WARNING;
971 xasprintf (&output_message,_("Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"), 1017 xasprintf (&output_message,_("Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"),
972 total_cache_buffers, 1018 total_cache_buffers,
@@ -1034,9 +1080,9 @@ main(int argc, char **argv) {
1034 result=STATE_CRITICAL; 1080 result=STATE_CRITICAL;
1035 } else { 1081 } else {
1036 nrmp_value=strtoul(recv_buffer,NULL,10); 1082 nrmp_value=strtoul(recv_buffer,NULL,10);
1037 if (check_critical_value==TRUE && nrmp_value <= critical_value) 1083 if (check_critical_value && nrmp_value <= critical_value)
1038 result=STATE_CRITICAL; 1084 result=STATE_CRITICAL;
1039 else if (check_warning_value==TRUE && nrmp_value <= warning_value) 1085 else if (check_warning_value && nrmp_value <= warning_value)
1040 result=STATE_WARNING; 1086 result=STATE_WARNING;
1041 xasprintf (&output_message, 1087 xasprintf (&output_message,
1042 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1088 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1060,9 +1106,9 @@ main(int argc, char **argv) {
1060 result=STATE_CRITICAL; 1106 result=STATE_CRITICAL;
1061 } else { 1107 } else {
1062 nrmm_value=strtoul(recv_buffer,NULL,10); 1108 nrmm_value=strtoul(recv_buffer,NULL,10);
1063 if (check_critical_value==TRUE && nrmm_value <= critical_value) 1109 if (check_critical_value && nrmm_value <= critical_value)
1064 result=STATE_CRITICAL; 1110 result=STATE_CRITICAL;
1065 else if (check_warning_value==TRUE && nrmm_value <= warning_value) 1111 else if (check_warning_value && nrmm_value <= warning_value)
1066 result=STATE_WARNING; 1112 result=STATE_WARNING;
1067 xasprintf (&output_message, 1113 xasprintf (&output_message,
1068 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1114 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1086,9 +1132,9 @@ main(int argc, char **argv) {
1086 result=STATE_CRITICAL; 1132 result=STATE_CRITICAL;
1087 } else { 1133 } else {
1088 nrms_value=strtoul(recv_buffer,NULL,10); 1134 nrms_value=strtoul(recv_buffer,NULL,10);
1089 if (check_critical_value==TRUE && nrms_value >= critical_value) 1135 if (check_critical_value && nrms_value >= critical_value)
1090 result=STATE_CRITICAL; 1136 result=STATE_CRITICAL;
1091 else if (check_warning_value==TRUE && nrms_value >= warning_value) 1137 else if (check_warning_value && nrms_value >= warning_value)
1092 result=STATE_WARNING; 1138 result=STATE_WARNING;
1093 xasprintf (&output_message, 1139 xasprintf (&output_message,
1094 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1140 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1112,9 +1158,9 @@ main(int argc, char **argv) {
1112 result=STATE_CRITICAL; 1158 result=STATE_CRITICAL;
1113 } else { 1159 } else {
1114 nss1_value=strtoul(recv_buffer,NULL,10); 1160 nss1_value=strtoul(recv_buffer,NULL,10);
1115 if (check_critical_value==TRUE && nss1_value >= critical_value) 1161 if (check_critical_value && nss1_value >= critical_value)
1116 result=STATE_CRITICAL; 1162 result=STATE_CRITICAL;
1117 else if (check_warning_value==TRUE && nss1_value >= warning_value) 1163 else if (check_warning_value && nss1_value >= warning_value)
1118 result=STATE_WARNING; 1164 result=STATE_WARNING;
1119 xasprintf (&output_message, 1165 xasprintf (&output_message,
1120 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1166 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1138,9 +1184,9 @@ main(int argc, char **argv) {
1138 result=STATE_CRITICAL; 1184 result=STATE_CRITICAL;
1139 } else { 1185 } else {
1140 nss2_value=strtoul(recv_buffer,NULL,10); 1186 nss2_value=strtoul(recv_buffer,NULL,10);
1141 if (check_critical_value==TRUE && nss2_value >= critical_value) 1187 if (check_critical_value && nss2_value >= critical_value)
1142 result=STATE_CRITICAL; 1188 result=STATE_CRITICAL;
1143 else if (check_warning_value==TRUE && nss2_value >= warning_value) 1189 else if (check_warning_value && nss2_value >= warning_value)
1144 result=STATE_WARNING; 1190 result=STATE_WARNING;
1145 xasprintf (&output_message, 1191 xasprintf (&output_message,
1146 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1192 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1164,9 +1210,9 @@ main(int argc, char **argv) {
1164 result=STATE_CRITICAL; 1210 result=STATE_CRITICAL;
1165 } else { 1211 } else {
1166 nss3_value=strtoul(recv_buffer,NULL,10); 1212 nss3_value=strtoul(recv_buffer,NULL,10);
1167 if (check_critical_value==TRUE && nss3_value >= critical_value) 1213 if (check_critical_value && nss3_value >= critical_value)
1168 result=STATE_CRITICAL; 1214 result=STATE_CRITICAL;
1169 else if (check_warning_value==TRUE && nss3_value >= warning_value) 1215 else if (check_warning_value && nss3_value >= warning_value)
1170 result=STATE_WARNING; 1216 result=STATE_WARNING;
1171 xasprintf (&output_message, 1217 xasprintf (&output_message,
1172 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1218 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1190,9 +1236,9 @@ main(int argc, char **argv) {
1190 result=STATE_CRITICAL; 1236 result=STATE_CRITICAL;
1191 } else { 1237 } else {
1192 nss4_value=strtoul(recv_buffer,NULL,10); 1238 nss4_value=strtoul(recv_buffer,NULL,10);
1193 if (check_critical_value==TRUE && nss4_value >= critical_value) 1239 if (check_critical_value && nss4_value >= critical_value)
1194 result=STATE_CRITICAL; 1240 result=STATE_CRITICAL;
1195 else if (check_warning_value==TRUE && nss4_value >= warning_value) 1241 else if (check_warning_value && nss4_value >= warning_value)
1196 result=STATE_WARNING; 1242 result=STATE_WARNING;
1197 xasprintf (&output_message, 1243 xasprintf (&output_message,
1198 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1244 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1216,9 +1262,9 @@ main(int argc, char **argv) {
1216 result=STATE_CRITICAL; 1262 result=STATE_CRITICAL;
1217 } else { 1263 } else {
1218 nss5_value=strtoul(recv_buffer,NULL,10); 1264 nss5_value=strtoul(recv_buffer,NULL,10);
1219 if (check_critical_value==TRUE && nss5_value >= critical_value) 1265 if (check_critical_value && nss5_value >= critical_value)
1220 result=STATE_CRITICAL; 1266 result=STATE_CRITICAL;
1221 else if (check_warning_value==TRUE && nss5_value >= warning_value) 1267 else if (check_warning_value && nss5_value >= warning_value)
1222 result=STATE_WARNING; 1268 result=STATE_WARNING;
1223 xasprintf (&output_message, 1269 xasprintf (&output_message,
1224 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1270 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1242,9 +1288,9 @@ main(int argc, char **argv) {
1242 result=STATE_CRITICAL; 1288 result=STATE_CRITICAL;
1243 } else { 1289 } else {
1244 nss6_value=strtoul(recv_buffer,NULL,10); 1290 nss6_value=strtoul(recv_buffer,NULL,10);
1245 if (check_critical_value==TRUE && nss6_value >= critical_value) 1291 if (check_critical_value && nss6_value >= critical_value)
1246 result=STATE_CRITICAL; 1292 result=STATE_CRITICAL;
1247 else if (check_warning_value==TRUE && nss6_value >= warning_value) 1293 else if (check_warning_value && nss6_value >= warning_value)
1248 result=STATE_WARNING; 1294 result=STATE_WARNING;
1249 xasprintf (&output_message, 1295 xasprintf (&output_message,
1250 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1296 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1268,9 +1314,9 @@ main(int argc, char **argv) {
1268 result=STATE_CRITICAL; 1314 result=STATE_CRITICAL;
1269 } else { 1315 } else {
1270 nss7_value=strtoul(recv_buffer,NULL,10); 1316 nss7_value=strtoul(recv_buffer,NULL,10);
1271 if (check_critical_value==TRUE && nss7_value >= critical_value) 1317 if (check_critical_value && nss7_value >= critical_value)
1272 result=STATE_CRITICAL; 1318 result=STATE_CRITICAL;
1273 else if (check_warning_value==TRUE && nss7_value >= warning_value) 1319 else if (check_warning_value && nss7_value >= warning_value)
1274 result=STATE_WARNING; 1320 result=STATE_WARNING;
1275 xasprintf (&output_message, 1321 xasprintf (&output_message,
1276 _("%s is %lu|%s=%lu;%lu;%lu;;"), 1322 _("%s is %lu|%s=%lu;%lu;%lu;;"),
@@ -1362,7 +1408,7 @@ int process_arguments(int argc, char **argv) {
1362 server_address=optarg; 1408 server_address=optarg;
1363 break; 1409 break;
1364 case 'o': /* display nos version */ 1410 case 'o': /* display nos version */
1365 check_netware_version=TRUE; 1411 check_netware_version = true;
1366 break; 1412 break;
1367 case 'p': /* port */ 1413 case 'p': /* port */
1368 if (is_intnonneg(optarg)) 1414 if (is_intnonneg(optarg))
@@ -1450,6 +1496,12 @@ int process_arguments(int argc, char **argv) {
1450 if (!strcmp(volume_name,"")) 1496 if (!strcmp(volume_name,""))
1451 volume_name = strdup ("SYS"); 1497 volume_name = strdup ("SYS");
1452 } 1498 }
1499 else if (strncmp(optarg,"VPU",3)==0) {
1500 vars_to_check=VPU;
1501 volume_name = strdup (optarg+3);
1502 if (!strcmp(volume_name,""))
1503 volume_name = strdup ("SYS");
1504 }
1453 else if (strncmp(optarg,"VPP",3)==0) { 1505 else if (strncmp(optarg,"VPP",3)==0) {
1454 vars_to_check=VPP; 1506 vars_to_check=VPP;
1455 volume_name = strdup (optarg+3); 1507 volume_name = strdup (optarg+3);
@@ -1569,11 +1621,11 @@ int process_arguments(int argc, char **argv) {
1569 break; 1621 break;
1570 case 'w': /* warning threshold */ 1622 case 'w': /* warning threshold */
1571 warning_value=strtoul(optarg,NULL,10); 1623 warning_value=strtoul(optarg,NULL,10);
1572 check_warning_value=TRUE; 1624 check_warning_value = true;
1573 break; 1625 break;
1574 case 'c': /* critical threshold */ 1626 case 'c': /* critical threshold */
1575 critical_value=strtoul(optarg,NULL,10); 1627 critical_value=strtoul(optarg,NULL,10);
1576 check_critical_value=TRUE; 1628 check_critical_value = true;
1577 break; 1629 break;
1578 case 't': /* timeout */ 1630 case 't': /* timeout */
1579 socket_timeout=atoi(optarg); 1631 socket_timeout=atoi(optarg);
@@ -1626,6 +1678,7 @@ void print_help(void)
1626 printf (" %s\n", _("OFILES = number of open files")); 1678 printf (" %s\n", _("OFILES = number of open files"));
1627 printf (" %s\n", _(" VMF<vol> = MB of free space on Volume <vol>")); 1679 printf (" %s\n", _(" VMF<vol> = MB of free space on Volume <vol>"));
1628 printf (" %s\n", _(" VMU<vol> = MB used space on Volume <vol>")); 1680 printf (" %s\n", _(" VMU<vol> = MB used space on Volume <vol>"));
1681 printf (" %s\n", _(" VPU<vol> = percent used space on Volume <vol>"));
1629 printf (" %s\n", _(" VMP<vol> = MB of purgeable space on Volume <vol>")); 1682 printf (" %s\n", _(" VMP<vol> = MB of purgeable space on Volume <vol>"));
1630 printf (" %s\n", _(" VPF<vol> = percent free space on volume <vol>")); 1683 printf (" %s\n", _(" VPF<vol> = percent free space on volume <vol>"));
1631 printf (" %s\n", _(" VKF<vol> = KB of free space on volume <vol>")); 1684 printf (" %s\n", _(" VKF<vol> = KB of free space on volume <vol>"));
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 9a4d25f..5165c82 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -56,15 +56,15 @@ char *server_address = NULL;
56int server_port = PORT; 56int server_port = PORT;
57double warning_value = 0L; 57double warning_value = 0L;
58double critical_value = 0L; 58double critical_value = 0L;
59int check_warning_value = FALSE; 59bool check_warning_value = false;
60int check_critical_value = FALSE; 60bool check_critical_value = false;
61enum checkvar vars_to_check = NONE; 61enum checkvar vars_to_check = NONE;
62int cmd_timeout = 1; 62int cmd_timeout = 1;
63 63
64int netstat_port = 0; 64int netstat_port = 0;
65char *disk_name = NULL; 65char *disk_name = NULL;
66char *process_name = NULL; 66char *process_name = NULL;
67 char send_buffer[MAX_INPUT_BUFFER]; 67char send_buffer[MAX_INPUT_BUFFER];
68 68
69int process_arguments (int, char **); 69int process_arguments (int, char **);
70void print_usage (void); 70void print_usage (void);
@@ -77,7 +77,7 @@ main (int argc, char **argv)
77 char recv_buffer[MAX_INPUT_BUFFER]; 77 char recv_buffer[MAX_INPUT_BUFFER];
78 char temp_buffer[MAX_INPUT_BUFFER]; 78 char temp_buffer[MAX_INPUT_BUFFER];
79 char *temp_ptr = NULL; 79 char *temp_ptr = NULL;
80 int found_disk = FALSE; 80 bool found_disk = false;
81 unsigned long percent_used_disk_space = 100; 81 unsigned long percent_used_disk_space = 100;
82 double load; 82 double load;
83 double load_1min; 83 double load_1min;
@@ -155,9 +155,9 @@ main (int argc, char **argv)
155 break; 155 break;
156 } 156 }
157 157
158 if (check_critical_value == TRUE && (load >= critical_value)) 158 if (check_critical_value && (load >= critical_value))
159 result = STATE_CRITICAL; 159 result = STATE_CRITICAL;
160 else if (check_warning_value == TRUE && (load >= warning_value)) 160 else if (check_warning_value && (load >= warning_value))
161 result = STATE_WARNING; 161 result = STATE_WARNING;
162 162
163 die (result, 163 die (result,
@@ -178,7 +178,7 @@ main (int argc, char **argv)
178 temp_ptr = (char *) strtok (NULL, " ")) { 178 temp_ptr = (char *) strtok (NULL, " ")) {
179 179
180 if (!strcmp (temp_ptr, disk_name)) { 180 if (!strcmp (temp_ptr, disk_name)) {
181 found_disk = TRUE; 181 found_disk = true;
182 temp_ptr = (char *) strtok (NULL, "%"); 182 temp_ptr = (char *) strtok (NULL, "%");
183 if (temp_ptr == NULL) 183 if (temp_ptr == NULL)
184 die (STATE_CRITICAL, _("Invalid response from server\n")); 184 die (STATE_CRITICAL, _("Invalid response from server\n"));
@@ -191,14 +191,14 @@ main (int argc, char **argv)
191 } 191 }
192 192
193 /* error if we couldn't find the info for the disk */ 193 /* error if we couldn't find the info for the disk */
194 if (found_disk == FALSE) 194 if (!found_disk)
195 die (STATE_CRITICAL, 195 die (STATE_CRITICAL,
196 "CRITICAL - Disk '%s' non-existent or not mounted", 196 "CRITICAL - Disk '%s' non-existent or not mounted",
197 disk_name); 197 disk_name);
198 198
199 if (check_critical_value == TRUE && (percent_used_disk_space >= critical_value)) 199 if (check_critical_value && (percent_used_disk_space >= critical_value))
200 result = STATE_CRITICAL; 200 result = STATE_CRITICAL;
201 else if (check_warning_value == TRUE && (percent_used_disk_space >= warning_value)) 201 else if (check_warning_value && (percent_used_disk_space >= warning_value))
202 result = STATE_WARNING; 202 result = STATE_WARNING;
203 203
204 die (result, "Disk %s - %lu%% used on %s", state_text(result), percent_used_disk_space, disk_name); 204 die (result, "Disk %s - %lu%% used on %s", state_text(result), percent_used_disk_space, disk_name);
@@ -212,9 +212,9 @@ main (int argc, char **argv)
212 else 212 else
213 port_connections = strtod (recv_buffer, NULL); 213 port_connections = strtod (recv_buffer, NULL);
214 214
215 if (check_critical_value == TRUE && (port_connections >= critical_value)) 215 if (check_critical_value && (port_connections >= critical_value))
216 result = STATE_CRITICAL; 216 result = STATE_CRITICAL;
217 else if (check_warning_value == TRUE && (port_connections >= warning_value)) 217 else if (check_warning_value && (port_connections >= warning_value))
218 result = STATE_WARNING; 218 result = STATE_WARNING;
219 219
220 die (result, 220 die (result,
@@ -241,9 +241,9 @@ main (int argc, char **argv)
241 else 241 else
242 processes = strtod (temp_ptr, NULL); 242 processes = strtod (temp_ptr, NULL);
243 243
244 if (check_critical_value == TRUE && (processes >= critical_value)) 244 if (check_critical_value && (processes >= critical_value))
245 result = STATE_CRITICAL; 245 result = STATE_CRITICAL;
246 else if (check_warning_value == TRUE && (processes >= warning_value)) 246 else if (check_warning_value && (processes >= warning_value))
247 result = STATE_WARNING; 247 result = STATE_WARNING;
248 248
249 die (result, 249 die (result,
@@ -262,9 +262,9 @@ main (int argc, char **argv)
262 uptime_raw_hours = strtod (recv_buffer, NULL); 262 uptime_raw_hours = strtod (recv_buffer, NULL);
263 uptime_raw_minutes = (unsigned long) (uptime_raw_hours * 60.0); 263 uptime_raw_minutes = (unsigned long) (uptime_raw_hours * 60.0);
264 264
265 if (check_critical_value == TRUE && (uptime_raw_minutes <= critical_value)) 265 if (check_critical_value && (uptime_raw_minutes <= critical_value))
266 result = STATE_CRITICAL; 266 result = STATE_CRITICAL;
267 else if (check_warning_value == TRUE && (uptime_raw_minutes <= warning_value)) 267 else if (check_warning_value && (uptime_raw_minutes <= warning_value))
268 result = STATE_WARNING; 268 result = STATE_WARNING;
269 269
270 uptime_days = uptime_raw_minutes / 1440; 270 uptime_days = uptime_raw_minutes / 1440;
@@ -388,11 +388,11 @@ process_arguments (int argc, char **argv)
388 break; 388 break;
389 case 'w': /* warning threshold */ 389 case 'w': /* warning threshold */
390 warning_value = strtoul (optarg, NULL, 10); 390 warning_value = strtoul (optarg, NULL, 10);
391 check_warning_value = TRUE; 391 check_warning_value = true;
392 break; 392 break;
393 case 'c': /* critical threshold */ 393 case 'c': /* critical threshold */
394 critical_value = strtoul (optarg, NULL, 10); 394 critical_value = strtoul (optarg, NULL, 10);
395 check_critical_value = TRUE; 395 check_critical_value = true;
396 break; 396 break;
397 case 't': /* timeout */ 397 case 't': /* timeout */
398 socket_timeout = atoi (optarg); 398 socket_timeout = atoi (optarg);
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 6199033..94d589e 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -69,7 +69,7 @@ int process_arguments (int, char **);
69int validate_arguments (void); 69int validate_arguments (void);
70void print_usage (void); 70void print_usage (void);
71void print_help (void); 71void print_help (void);
72int is_pg_logname (char *); 72bool is_pg_logname (char *);
73int do_query (PGconn *, char *); 73int do_query (PGconn *, char *);
74 74
75char *pghost = NULL; /* host name of the backend server */ 75char *pghost = NULL; /* host name of the backend server */
@@ -252,7 +252,7 @@ main (int argc, char **argv)
252 printf (_(" %s - database %s (%f sec.)|%s\n"), 252 printf (_(" %s - database %s (%f sec.)|%s\n"),
253 state_text(status), dbName, elapsed_time, 253 state_text(status), dbName, elapsed_time,
254 fperfdata("time", elapsed_time, "s", 254 fperfdata("time", elapsed_time, "s",
255 !!(twarn > 0.0), twarn, !!(tcrit > 0.0), tcrit, TRUE, 0, FALSE,0)); 255 !!(twarn > 0.0), twarn, !!(tcrit > 0.0), tcrit, true, 0, false,0));
256 256
257 if (pgquery) 257 if (pgquery)
258 query_status = do_query (conn, pgquery); 258 query_status = do_query (conn, pgquery);
@@ -393,7 +393,7 @@ process_arguments (int argc, char **argv)
393 393
394<para>&PROTO_validate_arguments;</para> 394<para>&PROTO_validate_arguments;</para>
395 395
396<para>Given a database name, this function returns TRUE if the string 396<para>Given a database name, this function returns true if the string
397is a valid PostgreSQL database name, and returns false if it is 397is a valid PostgreSQL database name, and returns false if it is
398not.</para> 398not.</para>
399 399
@@ -424,7 +424,7 @@ function prototype
424 424
425<para>&PROTO_is_pg_logname;</para> 425<para>&PROTO_is_pg_logname;</para>
426 426
427<para>Given a username, this function returns TRUE if the string is a 427<para>Given a username, this function returns true if the string is a
428valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL 428valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL
429usernames are less than &NAMEDATALEN; characters long and consist of 429usernames are less than &NAMEDATALEN; characters long and consist of
430letters, numbers, dashes, and underscores, plus possibly some other 430letters, numbers, dashes, and underscores, plus possibly some other
@@ -439,12 +439,10 @@ should be added.</para>
439 439
440 440
441 441
442int 442bool is_pg_logname (char *username) {
443is_pg_logname (char *username)
444{
445 if (strlen (username) > NAMEDATALEN - 1) 443 if (strlen (username) > NAMEDATALEN - 1)
446 return (FALSE); 444 return (false);
447 return (TRUE); 445 return (true);
448} 446}
449 447
450/****************************************************************************** 448/******************************************************************************
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 741f732..6e162e6 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -55,7 +55,7 @@ int error_scan (char buf[MAX_INPUT_BUFFER], const char *addr);
55void print_usage (void); 55void print_usage (void);
56void print_help (void); 56void print_help (void);
57 57
58int display_html = FALSE; 58bool display_html = false;
59int wpl = UNKNOWN_PACKET_LOSS; 59int wpl = UNKNOWN_PACKET_LOSS;
60int cpl = UNKNOWN_PACKET_LOSS; 60int cpl = UNKNOWN_PACKET_LOSS;
61float wrta = UNKNOWN_TRIP_TIME; 61float wrta = UNKNOWN_TRIP_TIME;
@@ -153,7 +153,7 @@ main (int argc, char **argv)
153 if (n_addresses > 1 && this_result != STATE_UNKNOWN) 153 if (n_addresses > 1 && this_result != STATE_UNKNOWN)
154 die (STATE_OK, "%s is alive\n", addresses[i]); 154 die (STATE_OK, "%s is alive\n", addresses[i]);
155 155
156 if (display_html == TRUE) 156 if (display_html == true)
157 printf ("<A HREF='%s/traceroute.cgi?%s'>", CGIURL, addresses[i]); 157 printf ("<A HREF='%s/traceroute.cgi?%s'>", CGIURL, addresses[i]);
158 if (pl == 100) 158 if (pl == 100)
159 printf (_("PING %s - %sPacket loss = %d%%"), state_text (this_result), warn_text, 159 printf (_("PING %s - %sPacket loss = %d%%"), state_text (this_result), warn_text,
@@ -161,22 +161,22 @@ main (int argc, char **argv)
161 else 161 else
162 printf (_("PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"), 162 printf (_("PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"),
163 state_text (this_result), warn_text, pl, rta); 163 state_text (this_result), warn_text, pl, rta);
164 if (display_html == TRUE) 164 if (display_html == true)
165 printf ("</A>"); 165 printf ("</A>");
166 166
167 /* Print performance data */ 167 /* Print performance data */
168 if (pl != 100) { 168 if (pl != 100) {
169 printf("|%s", fperfdata ("rta", (double) rta, "ms", 169 printf("|%s", fperfdata ("rta", (double) rta, "ms",
170 wrta>0?TRUE:FALSE, wrta, 170 wrta>0?true:false, wrta,
171 crta>0?TRUE:FALSE, crta, 171 crta>0?true:false, crta,
172 TRUE, 0, FALSE, 0)); 172 true, 0, false, 0));
173 } else { 173 } else {
174 printf("| rta=U;%f;%f;;", wrta, crta); 174 printf("| rta=U;%f;%f;;", wrta, crta);
175 } 175 }
176 printf(" %s\n", perfdata ("pl", (long) pl, "%", 176 printf(" %s\n", perfdata ("pl", (long) pl, "%",
177 wpl>0?TRUE:FALSE, wpl, 177 wpl>0?true:false, wpl,
178 cpl>0?TRUE:FALSE, cpl, 178 cpl>0?true:false, cpl,
179 TRUE, 0, FALSE, 0)); 179 true, 0, false, 0));
180 180
181 if (verbose >= 2) 181 if (verbose >= 2)
182 printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl); 182 printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);
@@ -278,10 +278,10 @@ process_arguments (int argc, char **argv)
278 usage2 (_("<max_packets> (%s) must be a non-negative number\n"), optarg); 278 usage2 (_("<max_packets> (%s) must be a non-negative number\n"), optarg);
279 break; 279 break;
280 case 'n': /* no HTML */ 280 case 'n': /* no HTML */
281 display_html = FALSE; 281 display_html = false;
282 break; 282 break;
283 case 'L': /* show HTML */ 283 case 'L': /* show HTML */
284 display_html = TRUE; 284 display_html = true;
285 break; 285 break;
286 case 'c': 286 case 'c':
287 get_threshold (optarg, &crta, &cpl); 287 get_threshold (optarg, &crta, &cpl);
@@ -297,7 +297,7 @@ process_arguments (int argc, char **argv)
297 return validate_arguments (); 297 return validate_arguments ();
298 298
299 if (addresses[0] == NULL) { 299 if (addresses[0] == NULL) {
300 if (is_host (argv[c]) == FALSE) { 300 if (!is_host (argv[c])) {
301 usage2 (_("Invalid hostname/address"), argv[c]); 301 usage2 (_("Invalid hostname/address"), argv[c]);
302 } else { 302 } else {
303 addresses[0] = argv[c++]; 303 addresses[0] = argv[c++];
@@ -308,7 +308,7 @@ process_arguments (int argc, char **argv)
308 } 308 }
309 309
310 if (wpl == UNKNOWN_PACKET_LOSS) { 310 if (wpl == UNKNOWN_PACKET_LOSS) {
311 if (is_intpercent (argv[c]) == FALSE) { 311 if (!is_intpercent (argv[c])) {
312 printf (_("<wpl> (%s) must be an integer percentage\n"), argv[c]); 312 printf (_("<wpl> (%s) must be an integer percentage\n"), argv[c]);
313 return ERROR; 313 return ERROR;
314 } else { 314 } else {
@@ -319,7 +319,7 @@ process_arguments (int argc, char **argv)
319 } 319 }
320 320
321 if (cpl == UNKNOWN_PACKET_LOSS) { 321 if (cpl == UNKNOWN_PACKET_LOSS) {
322 if (is_intpercent (argv[c]) == FALSE) { 322 if (!is_intpercent (argv[c])) {
323 printf (_("<cpl> (%s) must be an integer percentage\n"), argv[c]); 323 printf (_("<cpl> (%s) must be an integer percentage\n"), argv[c]);
324 return ERROR; 324 return ERROR;
325 } else { 325 } else {
@@ -420,7 +420,7 @@ validate_arguments ()
420 timeout_interval = (int)max_seconds; 420 timeout_interval = (int)max_seconds;
421 421
422 for (i=0; i<n_addresses; i++) { 422 for (i=0; i<n_addresses; i++) {
423 if (is_host(addresses[i]) == FALSE) 423 if (!is_host(addresses[i]))
424 usage2 (_("Invalid hostname/address"), addresses[i]); 424 usage2 (_("Invalid hostname/address"), addresses[i]);
425 } 425 }
426 426
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index c17c699..1fcbd98 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -14,6 +14,9 @@
14* defaults to number of processes. Search filters can be applied to limit 14* defaults to number of processes. Search filters can be applied to limit
15* the processes to check. 15* the processes to check.
16* 16*
17* The parent process, check_procs itself and any child process of
18* check_procs (ps) are excluded from any checks to prevent false positives.
19*
17* 20*
18* This program is free software: you can redistribute it and/or modify 21* This program is free software: you can redistribute it and/or modify
19* it under the terms of the GNU General Public License as published by 22* it under the terms of the GNU General Public License as published by
@@ -153,7 +156,7 @@ main (int argc, char **argv)
153 int expected_cols = PS_COLS - 1; 156 int expected_cols = PS_COLS - 1;
154 int warn = 0; /* number of processes in warn state */ 157 int warn = 0; /* number of processes in warn state */
155 int crit = 0; /* number of processes in crit state */ 158 int crit = 0; /* number of processes in crit state */
156 int i = 0, j = 0; 159 int i = 0;
157 int result = STATE_UNKNOWN; 160 int result = STATE_UNKNOWN;
158 int ret = 0; 161 int ret = 0;
159 output chld_out, chld_err; 162 output chld_out, chld_err;
@@ -207,7 +210,7 @@ main (int argc, char **argv)
207 } 210 }
208 211
209 /* flush first line: j starts at 1 */ 212 /* flush first line: j starts at 1 */
210 for (j = 1; j < chld_out.lines; j++) { 213 for (size_t j = 1; j < chld_out.lines; j++) {
211 input_line = chld_out.line[j]; 214 input_line = chld_out.line[j];
212 215
213 if (verbose >= 3) 216 if (verbose >= 3)
@@ -241,8 +244,9 @@ main (int argc, char **argv)
241 244
242 /* Ignore self */ 245 /* Ignore self */
243 if ((usepid && mypid == procpid) || 246 if ((usepid && mypid == procpid) ||
244 (!usepid && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino) || 247 ( ((!usepid) && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino)) ||
245 (ret == -1 && errno == ENOENT))) { 248 (ret == -1 && errno == ENOENT))
249 ) {
246 if (verbose >= 3) 250 if (verbose >= 3)
247 printf("not considering - is myself or gone\n"); 251 printf("not considering - is myself or gone\n");
248 continue; 252 continue;
@@ -254,6 +258,13 @@ main (int argc, char **argv)
254 continue; 258 continue;
255 } 259 }
256 260
261 /* Ignore our own children */
262 if (procppid == mypid) {
263 if (verbose >= 3)
264 printf("not considering - is our child\n");
265 continue;
266 }
267
257 /* Ignore excluded processes by name */ 268 /* Ignore excluded processes by name */
258 if(options & EXCLUDE_PROGS) { 269 if(options & EXCLUDE_PROGS) {
259 int found = 0; 270 int found = 0;
@@ -727,18 +738,23 @@ convert_to_seconds(char *etime) {
727void 738void
728print_help (void) 739print_help (void)
729{ 740{
730 print_revision (progname, NP_VERSION); 741 print_revision (progname, NP_VERSION);
731 742
732 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); 743 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
733 printf (COPYRIGHT, copyright, email); 744 printf (COPYRIGHT, copyright, email);
734 745
735 printf ("%s\n", _("Checks all processes and generates WARNING or CRITICAL states if the specified")); 746 printf ("%s\n", _("Checks all processes and generates WARNING or CRITICAL states if the specified"));
736 printf ("%s\n", _("metric is outside the required threshold ranges. The metric defaults to number")); 747 printf ("%s\n", _("metric is outside the required threshold ranges. The metric defaults to number"));
737 printf ("%s\n", _("of processes. Search filters can be applied to limit the processes to check.")); 748 printf ("%s\n", _("of processes. Search filters can be applied to limit the processes to check."));
738 749
739 printf ("\n\n"); 750 printf ("\n\n");
740 751
741 print_usage (); 752 printf ("%s\n", _("The parent process, check_procs itself and any child process of check_procs (ps)"));
753 printf ("%s\n", _("are excluded from any checks to prevent false positives."));
754
755 printf ("\n\n");
756
757 print_usage ();
742 758
743 printf (UT_HELP_VRSN); 759 printf (UT_HELP_VRSN);
744 printf (UT_EXTRA_OPTS); 760 printf (UT_EXTRA_OPTS);
@@ -754,11 +770,11 @@ print_help (void)
754 printf (" %s\n", _("CPU - percentage CPU")); 770 printf (" %s\n", _("CPU - percentage CPU"));
755/* only linux etime is support currently */ 771/* only linux etime is support currently */
756#if defined( __linux__ ) 772#if defined( __linux__ )
757 printf (" %s\n", _("ELAPSED - time elapsed in seconds")); 773 printf (" %s\n", _("ELAPSED - time elapsed in seconds"));
758#endif /* defined(__linux__) */ 774#endif /* defined(__linux__) */
759 printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); 775 printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
760 776
761 printf (" %s\n", "-v, --verbose"); 777 printf (" %s\n", "-v, --verbose");
762 printf (" %s\n", _("Extra information. Up to 3 verbosity levels")); 778 printf (" %s\n", _("Extra information. Up to 3 verbosity levels"));
763 779
764 printf (" %s\n", "-T, --traditional"); 780 printf (" %s\n", "-T, --traditional");
@@ -776,7 +792,7 @@ print_help (void)
776 printf (" %s\n", _("Only scan for processes with VSZ higher than indicated.")); 792 printf (" %s\n", _("Only scan for processes with VSZ higher than indicated."));
777 printf (" %s\n", "-r, --rss=RSS"); 793 printf (" %s\n", "-r, --rss=RSS");
778 printf (" %s\n", _("Only scan for processes with RSS higher than indicated.")); 794 printf (" %s\n", _("Only scan for processes with RSS higher than indicated."));
779 printf (" %s\n", "-P, --pcpu=PCPU"); 795 printf (" %s\n", "-P, --pcpu=PCPU");
780 printf (" %s\n", _("Only scan for processes with PCPU higher than indicated.")); 796 printf (" %s\n", _("Only scan for processes with PCPU higher than indicated."));
781 printf (" %s\n", "-u, --user=USER"); 797 printf (" %s\n", "-u, --user=USER");
782 printf (" %s\n", _("Only scan for processes with user name or ID indicated.")); 798 printf (" %s\n", _("Only scan for processes with user name or ID indicated."));
@@ -791,19 +807,19 @@ print_help (void)
791 printf (" %s\n", "-k, --no-kthreads"); 807 printf (" %s\n", "-k, --no-kthreads");
792 printf (" %s\n", _("Only scan for non kernel threads (works on Linux only).")); 808 printf (" %s\n", _("Only scan for non kernel threads (works on Linux only)."));
793 809
794 printf(_("\n\ 810 printf(_("\n\
795RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n\ 811RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n\
796specified 'max:min', a warning status will be generated if the\n\ 812specified 'max:min', a warning status will be generated if the\n\
797count is inside the specified range\n\n")); 813count is inside the specified range\n\n"));
798 814
799 printf(_("\ 815 printf(_("\
800This plugin checks the number of currently running processes and\n\ 816This plugin checks the number of currently running processes and\n\
801generates WARNING or CRITICAL states if the process count is outside\n\ 817generates WARNING or CRITICAL states if the process count is outside\n\
802the specified threshold ranges. The process count can be filtered by\n\ 818the specified threshold ranges. The process count can be filtered by\n\
803process owner, parent process PID, current state (e.g., 'Z'), or may\n\ 819process owner, parent process PID, current state (e.g., 'Z'), or may\n\
804be the total number of running processes\n\n")); 820be the total number of running processes\n\n"));
805 821
806 printf ("%s\n", _("Examples:")); 822 printf ("%s\n", _("Examples:"));
807 printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry"); 823 printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry");
808 printf (" %s\n", _("Warning if not two processes with command name portsentry.")); 824 printf (" %s\n", _("Warning if not two processes with command name portsentry."));
809 printf (" %s\n\n", _("Critical if < 2 or > 1024 processes")); 825 printf (" %s\n\n", _("Critical if < 2 or > 1024 processes"));
@@ -820,14 +836,14 @@ be the total number of running processes\n\n"));
820 printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU"); 836 printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU");
821 printf (" %s\n", _("Alert if CPU of any processes over 10\% or 20\%")); 837 printf (" %s\n", _("Alert if CPU of any processes over 10\% or 20\%"));
822 838
823 printf (UT_SUPPORT); 839 printf (UT_SUPPORT);
824} 840}
825 841
826void 842void
827print_usage (void) 843print_usage (void)
828{ 844{
829 printf ("%s\n", _("Usage:")); 845 printf ("%s\n", _("Usage:"));
830 printf ("%s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n", progname); 846 printf ("%s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n", progname);
831 printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n"); 847 printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n");
832 printf (" [-C command] [-X process_to_exclude] [-k] [-t timeout] [-v]\n"); 848 printf (" [-C command] [-X process_to_exclude] [-k] [-t timeout] [-v]\n");
833} 849}
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index b1b4938..6b32710 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -93,7 +93,7 @@ char *expect = NULL;
93char *config_file = NULL; 93char *config_file = NULL;
94unsigned short port = PW_AUTH_UDP_PORT; 94unsigned short port = PW_AUTH_UDP_PORT;
95int retries = 1; 95int retries = 1;
96int verbose = FALSE; 96bool verbose = false;
97 97
98/****************************************************************************** 98/******************************************************************************
99 99
@@ -272,10 +272,10 @@ process_arguments (int argc, char **argv)
272 print_revision (progname, NP_VERSION); 272 print_revision (progname, NP_VERSION);
273 exit (STATE_UNKNOWN); 273 exit (STATE_UNKNOWN);
274 case 'v': /* verbose mode */ 274 case 'v': /* verbose mode */
275 verbose = TRUE; 275 verbose = true;
276 break; 276 break;
277 case 'H': /* hostname */ 277 case 'H': /* hostname */
278 if (is_host (optarg) == FALSE) { 278 if (!is_host (optarg)) {
279 usage2 (_("Invalid hostname/address"), optarg); 279 usage2 (_("Invalid hostname/address"), optarg);
280 } 280 }
281 server = optarg; 281 server = optarg;
diff --git a/plugins/check_real.c b/plugins/check_real.c
index fbdb70f..15e035b 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -54,10 +54,10 @@ char *host_name;
54char *server_url = NULL; 54char *server_url = NULL;
55char *server_expect; 55char *server_expect;
56int warning_time = 0; 56int warning_time = 0;
57int check_warning_time = FALSE; 57bool check_warning_time = false;
58int critical_time = 0; 58int critical_time = 0;
59int check_critical_time = FALSE; 59bool check_critical_time = false;
60int verbose = FALSE; 60bool verbose = false;
61 61
62 62
63 63
@@ -238,9 +238,9 @@ main (int argc, char **argv)
238 /* Return results */ 238 /* Return results */
239 if (result == STATE_OK) { 239 if (result == STATE_OK) {
240 240
241 if (check_critical_time == TRUE 241 if (check_critical_time
242 && (end_time - start_time) > critical_time) result = STATE_CRITICAL; 242 && (end_time - start_time) > critical_time) result = STATE_CRITICAL;
243 else if (check_warning_time == TRUE 243 else if (check_warning_time
244 && (end_time - start_time) > warning_time) result = 244 && (end_time - start_time) > warning_time) result =
245 STATE_WARNING; 245 STATE_WARNING;
246 246
@@ -331,7 +331,7 @@ process_arguments (int argc, char **argv)
331 case 'w': /* warning time threshold */ 331 case 'w': /* warning time threshold */
332 if (is_intnonneg (optarg)) { 332 if (is_intnonneg (optarg)) {
333 warning_time = atoi (optarg); 333 warning_time = atoi (optarg);
334 check_warning_time = TRUE; 334 check_warning_time = true;
335 } 335 }
336 else { 336 else {
337 usage4 (_("Warning time must be a positive integer")); 337 usage4 (_("Warning time must be a positive integer"));
@@ -340,14 +340,14 @@ process_arguments (int argc, char **argv)
340 case 'c': /* critical time threshold */ 340 case 'c': /* critical time threshold */
341 if (is_intnonneg (optarg)) { 341 if (is_intnonneg (optarg)) {
342 critical_time = atoi (optarg); 342 critical_time = atoi (optarg);
343 check_critical_time = TRUE; 343 check_critical_time = true;
344 } 344 }
345 else { 345 else {
346 usage4 (_("Critical time must be a positive integer")); 346 usage4 (_("Critical time must be a positive integer"));
347 } 347 }
348 break; 348 break;
349 case 'v': /* verbose */ 349 case 'v': /* verbose */
350 verbose = TRUE; 350 verbose = true;
351 break; 351 break;
352 case 't': /* timeout */ 352 case 't': /* timeout */
353 if (is_intnonneg (optarg)) { 353 if (is_intnonneg (optarg)) {
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index fc0ae2c..986c3e1 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -40,7 +40,7 @@ const char *email = "devel@monitoring-plugins.org";
40#include <ctype.h> 40#include <ctype.h>
41 41
42#ifdef HAVE_SSL 42#ifdef HAVE_SSL
43int check_cert = FALSE; 43bool check_cert = false;
44int days_till_exp_warn, days_till_exp_crit; 44int days_till_exp_warn, days_till_exp_crit;
45# define my_recv(buf, len) (((use_starttls || use_ssl) && ssl_established) ? np_net_ssl_read(buf, len) : read(sd, buf, len)) 45# define my_recv(buf, len) (((use_starttls || use_ssl) && ssl_established) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
46# define my_send(buf, len) (((use_starttls || use_ssl) && ssl_established) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0)) 46# define my_send(buf, len) (((use_starttls || use_ssl) && ssl_established) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
@@ -100,17 +100,17 @@ char *authtype = NULL;
100char *authuser = NULL; 100char *authuser = NULL;
101char *authpass = NULL; 101char *authpass = NULL;
102double warning_time = 0; 102double warning_time = 0;
103int check_warning_time = FALSE; 103bool check_warning_time = false;
104double critical_time = 0; 104double critical_time = 0;
105int check_critical_time = FALSE; 105bool check_critical_time = false;
106int verbose = 0; 106int verbose = 0;
107int use_ssl = FALSE; 107bool use_ssl = false;
108int use_starttls = FALSE; 108bool use_starttls = false;
109int use_sni = FALSE; 109bool use_sni = false;
110short use_proxy_prefix = FALSE; 110bool use_proxy_prefix = false;
111short use_ehlo = FALSE; 111bool use_ehlo = false;
112short use_lhlo = FALSE; 112bool use_lhlo = false;
113short ssl_established = 0; 113bool ssl_established = false;
114char *localhostname = NULL; 114char *localhostname = NULL;
115int sd; 115int sd;
116char buffer[MAX_INPUT_BUFFER]; 116char buffer[MAX_INPUT_BUFFER];
@@ -118,13 +118,13 @@ enum {
118 TCP_PROTOCOL = 1, 118 TCP_PROTOCOL = 1,
119 UDP_PROTOCOL = 2, 119 UDP_PROTOCOL = 2,
120}; 120};
121int ignore_send_quit_failure = FALSE; 121bool ignore_send_quit_failure = false;
122 122
123 123
124int 124int
125main (int argc, char **argv) 125main (int argc, char **argv)
126{ 126{
127 short supports_tls=FALSE; 127 bool supports_tls = false;
128 int n = 0; 128 int n = 0;
129 double elapsed_time; 129 double elapsed_time;
130 long microsec; 130 long microsec;
@@ -230,7 +230,7 @@ main (int argc, char **argv)
230 } else if(use_ehlo || use_lhlo){ 230 } else if(use_ehlo || use_lhlo){
231 if(strstr(buffer, "250 STARTTLS") != NULL || 231 if(strstr(buffer, "250 STARTTLS") != NULL ||
232 strstr(buffer, "250-STARTTLS") != NULL){ 232 strstr(buffer, "250-STARTTLS") != NULL){
233 supports_tls=TRUE; 233 supports_tls=true;
234 } 234 }
235 } 235 }
236 236
@@ -466,7 +466,7 @@ main (int argc, char **argv)
466 fperfdata ("time", elapsed_time, "s", 466 fperfdata ("time", elapsed_time, "s",
467 (int)check_warning_time, warning_time, 467 (int)check_warning_time, warning_time,
468 (int)check_critical_time, critical_time, 468 (int)check_critical_time, critical_time,
469 TRUE, 0, FALSE, 0)); 469 true, 0, false, 0));
470 470
471 return result; 471 return result;
472} 472}
@@ -480,6 +480,8 @@ process_arguments (int argc, char **argv)
480 int c; 480 int c;
481 char* temp; 481 char* temp;
482 482
483 bool implicit_tls = false;
484
483 enum { 485 enum {
484 SNI_OPTION 486 SNI_OPTION
485 }; 487 };
@@ -560,7 +562,7 @@ process_arguments (int argc, char **argv)
560 break; 562 break;
561 case 'A': 563 case 'A':
562 authtype = optarg; 564 authtype = optarg;
563 use_ehlo = TRUE; 565 use_ehlo = true;
564 break; 566 break;
565 case 'U': 567 case 'U':
566 authuser = optarg; 568 authuser = optarg;
@@ -600,7 +602,7 @@ process_arguments (int argc, char **argv)
600 usage4 (_("Critical time must be a positive")); 602 usage4 (_("Critical time must be a positive"));
601 else { 603 else {
602 critical_time = strtod (optarg, NULL); 604 critical_time = strtod (optarg, NULL);
603 check_critical_time = TRUE; 605 check_critical_time = true;
604 } 606 }
605 break; 607 break;
606 case 'w': /* warning time threshold */ 608 case 'w': /* warning time threshold */
@@ -608,14 +610,14 @@ process_arguments (int argc, char **argv)
608 usage4 (_("Warning time must be a positive")); 610 usage4 (_("Warning time must be a positive"));
609 else { 611 else {
610 warning_time = strtod (optarg, NULL); 612 warning_time = strtod (optarg, NULL);
611 check_warning_time = TRUE; 613 check_warning_time = true;
612 } 614 }
613 break; 615 break;
614 case 'v': /* verbose */ 616 case 'v': /* verbose */
615 verbose++; 617 verbose++;
616 break; 618 break;
617 case 'q': 619 case 'q':
618 ignore_send_quit_failure++; /* ignore problem sending QUIT */ 620 ignore_send_quit_failure = true; /* ignore problem sending QUIT */
619 break; 621 break;
620 case 't': /* timeout */ 622 case 't': /* timeout */
621 if (is_intnonneg (optarg)) { 623 if (is_intnonneg (optarg)) {
@@ -645,33 +647,35 @@ process_arguments (int argc, char **argv)
645 usage2 ("Invalid certificate expiration period", optarg); 647 usage2 ("Invalid certificate expiration period", optarg);
646 days_till_exp_warn = atoi (optarg); 648 days_till_exp_warn = atoi (optarg);
647 } 649 }
648 check_cert = TRUE; 650 check_cert = true;
649 ignore_send_quit_failure = TRUE; 651 ignore_send_quit_failure = true;
650#else 652#else
651 usage (_("SSL support not available - install OpenSSL and recompile")); 653 usage (_("SSL support not available - install OpenSSL and recompile"));
652#endif 654#endif
655 implicit_tls = true;
656 // fallthrough
653 case 's': 657 case 's':
654 /* ssl */ 658 /* ssl */
655 use_ssl = TRUE; 659 use_ssl = true;
656 server_port = SMTPS_PORT; 660 server_port = SMTPS_PORT;
657 break; 661 break;
658 case 'S': 662 case 'S':
659 /* starttls */ 663 /* starttls */
660 use_starttls = TRUE; 664 use_starttls = true;
661 use_ehlo = TRUE; 665 use_ehlo = true;
662 break; 666 break;
663 case SNI_OPTION: 667 case SNI_OPTION:
664#ifdef HAVE_SSL 668#ifdef HAVE_SSL
665 use_sni = TRUE; 669 use_sni = true;
666#else 670#else
667 usage (_("SSL support not available - install OpenSSL and recompile")); 671 usage (_("SSL support not available - install OpenSSL and recompile"));
668#endif 672#endif
669 break; 673 break;
670 case 'r': 674 case 'r':
671 use_proxy_prefix = TRUE; 675 use_proxy_prefix = true;
672 break; 676 break;
673 case 'L': 677 case 'L':
674 use_lhlo = TRUE; 678 use_lhlo = true;
675 break; 679 break;
676 case '4': 680 case '4':
677 address_family = AF_INET; 681 address_family = AF_INET;
@@ -717,7 +721,12 @@ process_arguments (int argc, char **argv)
717 from_arg = strdup(" "); 721 from_arg = strdup(" ");
718 722
719 if (use_starttls && use_ssl) { 723 if (use_starttls && use_ssl) {
720 usage4 (_("Set either -s/--ssl/--tls or -S/--starttls")); 724 if (implicit_tls) {
725 use_ssl = false;
726 server_port = SMTP_PORT;
727 } else {
728 usage4 (_("Set either -s/--ssl/--tls or -S/--starttls"));
729 }
721 } 730 }
722 731
723 if (server_port_option != 0) { 732 if (server_port_option != 0) {
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 56a586a..90a0402 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -55,8 +55,6 @@ const char *email = "devel@monitoring-plugins.org";
55#define CRIT_STRING 2 55#define CRIT_STRING 2
56#define CRIT_REGEX 4 56#define CRIT_REGEX 4
57#define WARN_PRESENT 8 57#define WARN_PRESENT 8
58#define WARN_STRING 16
59#define WARN_REGEX 32
60 58
61#define OID_COUNT_STEP 8 59#define OID_COUNT_STEP 8
62 60
@@ -86,82 +84,82 @@ const char *email = "devel@monitoring-plugins.org";
86 84
87 85
88 86
89int process_arguments (int, char **); 87static int process_arguments (int, char **);
90int validate_arguments (void); 88static int validate_arguments (void);
91char *thisarg (char *str); 89static char *thisarg (char *str);
92char *nextarg (char *str); 90static char *nextarg (char *str);
93void print_usage (void); 91void print_usage (void);
94void print_help (void); 92static void print_help (void);
95char *multiply (char *str); 93static char *multiply (char *str);
96 94
97#include "regex.h" 95#include "regex.h"
98char regex_expect[MAX_INPUT_BUFFER] = ""; 96static char regex_expect[MAX_INPUT_BUFFER] = "";
99regex_t preg; 97static regex_t preg;
100regmatch_t pmatch[10]; 98static regmatch_t pmatch[10];
101char errbuf[MAX_INPUT_BUFFER] = ""; 99static char errbuf[MAX_INPUT_BUFFER] = "";
102char perfstr[MAX_INPUT_BUFFER] = "| "; 100static char perfstr[MAX_INPUT_BUFFER] = "| ";
103int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; 101static int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
104int eflags = 0; 102static int eflags = 0;
105int errcode, excode; 103static int errcode, excode;
106 104
107char *server_address = NULL; 105static char *server_address = NULL;
108char *community = NULL; 106static char *community = NULL;
109char **contextargs = NULL; 107static char **contextargs = NULL;
110char *context = NULL; 108static char *context = NULL;
111char **authpriv = NULL; 109static char **authpriv = NULL;
112char *proto = NULL; 110static char *proto = NULL;
113char *seclevel = NULL; 111static char *seclevel = NULL;
114char *secname = NULL; 112static char *secname = NULL;
115char *authproto = NULL; 113static char *authproto = NULL;
116char *privproto = NULL; 114static char *privproto = NULL;
117char *authpasswd = NULL; 115static char *authpasswd = NULL;
118char *privpasswd = NULL; 116static char *privpasswd = NULL;
119int nulloid = STATE_UNKNOWN; 117static int nulloid = STATE_UNKNOWN;
120char **oids = NULL; 118static char **oids = NULL;
121size_t oids_size = 0; 119static size_t oids_size = 0;
122char *label; 120static char *label;
123char *units; 121static char *units;
124char *port; 122static char *port;
125char *snmpcmd; 123static char *snmpcmd;
126char string_value[MAX_INPUT_BUFFER] = ""; 124static char string_value[MAX_INPUT_BUFFER] = "";
127int invert_search=0; 125static int invert_search=0;
128char **labels = NULL; 126static char **labels = NULL;
129char **unitv = NULL; 127static char **unitv = NULL;
130size_t nlabels = 0; 128static size_t nlabels = 0;
131size_t labels_size = OID_COUNT_STEP; 129static size_t labels_size = OID_COUNT_STEP;
132size_t nunits = 0; 130static size_t nunits = 0;
133size_t unitv_size = OID_COUNT_STEP; 131static size_t unitv_size = OID_COUNT_STEP;
134int numoids = 0; 132static size_t numoids = 0;
135int numauthpriv = 0; 133static int numauthpriv = 0;
136int numcontext = 0; 134static int numcontext = 0;
137int verbose = 0; 135static int verbose = 0;
138int usesnmpgetnext = FALSE; 136static bool usesnmpgetnext = false;
139char *warning_thresholds = NULL; 137static char *warning_thresholds = NULL;
140char *critical_thresholds = NULL; 138static char *critical_thresholds = NULL;
141thresholds **thlds; 139static thresholds **thlds;
142size_t thlds_size = OID_COUNT_STEP; 140static size_t thlds_size = OID_COUNT_STEP;
143double *response_value; 141static double *response_value;
144size_t response_size = OID_COUNT_STEP; 142static size_t response_size = OID_COUNT_STEP;
145int retries = 0; 143static int retries = 0;
146int *eval_method; 144static int *eval_method;
147size_t eval_size = OID_COUNT_STEP; 145static size_t eval_size = OID_COUNT_STEP;
148char *delimiter; 146static char *delimiter;
149char *output_delim; 147static char *output_delim;
150char *miblist = NULL; 148static char *miblist = NULL;
151int needmibs = FALSE; 149static bool needmibs = false;
152int calculate_rate = 0; 150static int calculate_rate = 0;
153double offset = 0.0; 151static double offset = 0.0;
154int rate_multiplier = 1; 152static int rate_multiplier = 1;
155state_data *previous_state; 153static state_data *previous_state;
156double *previous_value; 154static double *previous_value;
157size_t previous_size = OID_COUNT_STEP; 155static size_t previous_size = OID_COUNT_STEP;
158int perf_labels = 1; 156static int perf_labels = 1;
159char* ip_version = ""; 157static char* ip_version = "";
160double multiplier = 1.0; 158static double multiplier = 1.0;
161char *fmtstr = ""; 159static char *fmtstr = "";
162bool fmtstr_set = false; 160static bool fmtstr_set = false;
163char buffer[DEFAULT_BUFFER_SIZE]; 161static char buffer[DEFAULT_BUFFER_SIZE];
164bool ignore_mib_parsing_errors = false; 162static bool ignore_mib_parsing_errors = false;
165 163
166static char *fix_snmp_range(char *th) 164static char *fix_snmp_range(char *th)
167{ 165{
@@ -187,7 +185,8 @@ static char *fix_snmp_range(char *th)
187int 185int
188main (int argc, char **argv) 186main (int argc, char **argv)
189{ 187{
190 int i, len, line, total_oids; 188 int len, total_oids;
189 size_t line;
191 unsigned int bk_count = 0, dq_count = 0; 190 unsigned int bk_count = 0, dq_count = 0;
192 int iresult = STATE_UNKNOWN; 191 int iresult = STATE_UNKNOWN;
193 int result = STATE_UNKNOWN; 192 int result = STATE_UNKNOWN;
@@ -253,14 +252,16 @@ main (int argc, char **argv)
253 if(calculate_rate) { 252 if(calculate_rate) {
254 if (!strcmp(label, "SNMP")) 253 if (!strcmp(label, "SNMP"))
255 label = strdup("SNMP RATE"); 254 label = strdup("SNMP RATE");
256 i=0; 255
256 size_t i = 0;
257
257 previous_state = np_state_read(); 258 previous_state = np_state_read();
258 if(previous_state!=NULL) { 259 if(previous_state!=NULL) {
259 /* Split colon separated values */ 260 /* Split colon separated values */
260 previous_string = strdup((char *) previous_state->data); 261 previous_string = strdup((char *) previous_state->data);
261 while((ap = strsep(&previous_string, ":")) != NULL) { 262 while((ap = strsep(&previous_string, ":")) != NULL) {
262 if(verbose>2) 263 if(verbose>2)
263 printf("State for %d=%s\n", i, ap); 264 printf("State for %zd=%s\n", i, ap);
264 while (i >= previous_size) { 265 while (i >= previous_size) {
265 previous_size += OID_COUNT_STEP; 266 previous_size += OID_COUNT_STEP;
266 previous_value = realloc(previous_value, previous_size * sizeof(*previous_value)); 267 previous_value = realloc(previous_value, previous_size * sizeof(*previous_value));
@@ -273,7 +274,7 @@ main (int argc, char **argv)
273 /* Populate the thresholds */ 274 /* Populate the thresholds */
274 th_warn=warning_thresholds; 275 th_warn=warning_thresholds;
275 th_crit=critical_thresholds; 276 th_crit=critical_thresholds;
276 for (i=0; i<numoids; i++) { 277 for (size_t i = 0; i < numoids; i++) {
277 char *w = th_warn ? strndup(th_warn, strcspn(th_warn, ",")) : NULL; 278 char *w = th_warn ? strndup(th_warn, strcspn(th_warn, ",")) : NULL;
278 char *c = th_crit ? strndup(th_crit, strcspn(th_crit, ",")) : NULL; 279 char *c = th_crit ? strndup(th_crit, strcspn(th_crit, ",")) : NULL;
279 /* translate "2:1" to "@1:2" for backwards compatibility */ 280 /* translate "2:1" to "@1:2" for backwards compatibility */
@@ -302,7 +303,7 @@ main (int argc, char **argv)
302 } 303 }
303 304
304 /* Create the command array to execute */ 305 /* Create the command array to execute */
305 if(usesnmpgetnext == TRUE) { 306 if(usesnmpgetnext) {
306 snmpcmd = strdup (PATH_TO_SNMPGETNEXT); 307 snmpcmd = strdup (PATH_TO_SNMPGETNEXT);
307 }else{ 308 }else{
308 snmpcmd = strdup (PATH_TO_SNMPGET); 309 snmpcmd = strdup (PATH_TO_SNMPGET);
@@ -333,11 +334,11 @@ main (int argc, char **argv)
333 } 334 }
334 335
335 336
336 for (i = 0; i < numcontext; i++) { 337 for (int i = 0; i < numcontext; i++) {
337 command_line[index++] = contextargs[i]; 338 command_line[index++] = contextargs[i];
338 } 339 }
339 340
340 for (i = 0; i < numauthpriv; i++) { 341 for (int i = 0; i < numauthpriv; i++) {
341 command_line[index++] = authpriv[i]; 342 command_line[index++] = authpriv[i];
342 } 343 }
343 344
@@ -348,7 +349,7 @@ main (int argc, char **argv)
348 server_address, 349 server_address,
349 port); 350 port);
350 351
351 for (i = 0; i < numoids; i++) { 352 for (size_t i = 0; i < numoids; i++) {
352 command_line[index++] = oids[i]; 353 command_line[index++] = oids[i];
353 xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]); 354 xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]);
354 } 355 }
@@ -382,7 +383,7 @@ main (int argc, char **argv)
382 if (external_error) { 383 if (external_error) {
383 if (chld_err.lines > 0) { 384 if (chld_err.lines > 0) {
384 printf (_("External command error: %s\n"), chld_err.line[0]); 385 printf (_("External command error: %s\n"), chld_err.line[0]);
385 for (i = 1; i < chld_err.lines; i++) { 386 for (size_t i = 1; i < chld_err.lines; i++) {
386 printf ("%s\n", chld_err.line[i]); 387 printf ("%s\n", chld_err.line[i]);
387 } 388 }
388 } else { 389 } else {
@@ -392,12 +393,14 @@ main (int argc, char **argv)
392 } 393 }
393 394
394 if (verbose) { 395 if (verbose) {
395 for (i = 0; i < chld_out.lines; i++) { 396 for (size_t i = 0; i < chld_out.lines; i++) {
396 printf ("%s\n", chld_out.line[i]); 397 printf ("%s\n", chld_out.line[i]);
397 } 398 }
398 } 399 }
399 400
400 for (line=0, i=0; line < chld_out.lines && i < numoids ; line++, i++) { 401 line = 0;
402 total_oids = 0;
403 for (size_t i = 0; line < chld_out.lines && i < numoids ; line++, i++, total_oids++) {
401 if(calculate_rate) 404 if(calculate_rate)
402 conv = "%.10g"; 405 conv = "%.10g";
403 else 406 else
@@ -410,7 +413,7 @@ main (int argc, char **argv)
410 break; 413 break;
411 414
412 if (verbose > 2) { 415 if (verbose > 2) {
413 printf("Processing oid %i (line %i)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response); 416 printf("Processing oid %zi (line %zi)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response);
414 } 417 }
415 418
416 /* Clean up type array - Sol10 does not necessarily zero it out */ 419 /* Clean up type array - Sol10 does not necessarily zero it out */
@@ -634,7 +637,6 @@ main (int argc, char **argv)
634 strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1); 637 strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
635 } 638 }
636 } 639 }
637 total_oids=i;
638 640
639 /* Save state data, as all data collected now */ 641 /* Save state data, as all data collected now */
640 if(calculate_rate) { 642 if(calculate_rate) {
@@ -644,7 +646,7 @@ main (int argc, char **argv)
644 die(STATE_UNKNOWN, _("Cannot malloc")); 646 die(STATE_UNKNOWN, _("Cannot malloc"));
645 647
646 current_length=0; 648 current_length=0;
647 for(i=0; i<total_oids; i++) { 649 for(int i = 0; i < total_oids; i++) {
648 xasprintf(&temp_string,"%.0f",response_value[i]); 650 xasprintf(&temp_string,"%.0f",response_value[i]);
649 if(temp_string==NULL) 651 if(temp_string==NULL)
650 die(STATE_UNKNOWN,_("Cannot asprintf()")); 652 die(STATE_UNKNOWN,_("Cannot asprintf()"));
@@ -687,7 +689,7 @@ process_arguments (int argc, char **argv)
687{ 689{
688 char *ptr; 690 char *ptr;
689 int c = 1; 691 int c = 1;
690 int j = 0, jj = 0, ii = 0; 692 size_t j = 0, jj = 0;
691 693
692 int option = 0; 694 int option = 0;
693 static struct option longopts[] = { 695 static struct option longopts[] = {
@@ -777,7 +779,7 @@ process_arguments (int argc, char **argv)
777 miblist = optarg; 779 miblist = optarg;
778 break; 780 break;
779 case 'n': /* usesnmpgetnext */ 781 case 'n': /* usesnmpgetnext */
780 usesnmpgetnext = TRUE; 782 usesnmpgetnext = true;
781 break; 783 break;
782 case 'P': /* SNMP protocol version */ 784 case 'P': /* SNMP protocol version */
783 proto = optarg; 785 proto = optarg;
@@ -831,7 +833,7 @@ process_arguments (int argc, char **argv)
831 * so we have a mib variable, rather than just an SNMP OID, 833 * so we have a mib variable, rather than just an SNMP OID,
832 * so we have to actually read the mib files 834 * so we have to actually read the mib files
833 */ 835 */
834 needmibs = TRUE; 836 needmibs = true;
835 } 837 }
836 for (ptr = strtok(optarg, ", "); ptr != NULL; ptr = strtok(NULL, ", "), j++) { 838 for (ptr = strtok(optarg, ", "); ptr != NULL; ptr = strtok(NULL, ", "), j++) {
837 while (j >= oids_size) { 839 while (j >= oids_size) {
@@ -843,7 +845,6 @@ process_arguments (int argc, char **argv)
843 numoids = j; 845 numoids = j;
844 if (c == 'E' || c == 'e') { 846 if (c == 'E' || c == 'e') {
845 jj++; 847 jj++;
846 ii++;
847 while (j+1 >= eval_size) { 848 while (j+1 >= eval_size) {
848 eval_size += OID_COUNT_STEP; 849 eval_size += OID_COUNT_STEP;
849 eval_method = realloc(eval_method, eval_size * sizeof(*eval_method)); 850 eval_method = realloc(eval_method, eval_size * sizeof(*eval_method));
@@ -870,7 +871,6 @@ process_arguments (int argc, char **argv)
870 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8); 871 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
871 } 872 }
872 eval_method[jj++] = CRIT_STRING; 873 eval_method[jj++] = CRIT_STRING;
873 ii++;
874 break; 874 break;
875 case 'R': /* regex */ 875 case 'R': /* regex */
876 cflags = REG_ICASE; 876 cflags = REG_ICASE;
@@ -891,7 +891,6 @@ process_arguments (int argc, char **argv)
891 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8); 891 memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
892 } 892 }
893 eval_method[jj++] = CRIT_REGEX; 893 eval_method[jj++] = CRIT_REGEX;
894 ii++;
895 break; 894 break;
896 895
897 /* Format */ 896 /* Format */
@@ -1029,12 +1028,12 @@ selected.</para>
1029 1028
1030 1029
1031 1030
1032int 1031static int
1033validate_arguments () 1032validate_arguments ()
1034{ 1033{
1035 /* check whether to load locally installed MIBS (CPU/disk intensive) */ 1034 /* check whether to load locally installed MIBS (CPU/disk intensive) */
1036 if (miblist == NULL) { 1035 if (miblist == NULL) {
1037 if ( needmibs == TRUE ) { 1036 if (needmibs) {
1038 miblist = strdup (DEFAULT_MIBLIST); 1037 miblist = strdup (DEFAULT_MIBLIST);
1039 }else{ 1038 }else{
1040 miblist = ""; /* don't read any mib files for numeric oids */ 1039 miblist = ""; /* don't read any mib files for numeric oids */
@@ -1138,7 +1137,7 @@ validate_arguments ()
1138/* trim leading whitespace 1137/* trim leading whitespace
1139 if there is a leading quote, make sure it balances */ 1138 if there is a leading quote, make sure it balances */
1140 1139
1141char * 1140static char *
1142thisarg (char *str) 1141thisarg (char *str)
1143{ 1142{
1144 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ 1143 str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
@@ -1155,7 +1154,7 @@ thisarg (char *str)
1155 set the trailing quote to '\x0' 1154 set the trailing quote to '\x0'
1156 if the string continues, advance beyond the comma */ 1155 if the string continues, advance beyond the comma */
1157 1156
1158char * 1157static char *
1159nextarg (char *str) 1158nextarg (char *str)
1160{ 1159{
1161 if (str[0] == '\'') { 1160 if (str[0] == '\'') {
@@ -1187,7 +1186,7 @@ nextarg (char *str)
1187 1186
1188 1187
1189/* multiply result (values 0 < n < 1 work as divider) */ 1188/* multiply result (values 0 < n < 1 work as divider) */
1190char * 1189static char *
1191multiply (char *str) 1190multiply (char *str)
1192{ 1191{
1193 char *endptr; 1192 char *endptr;
@@ -1224,7 +1223,7 @@ multiply (char *str)
1224} 1223}
1225 1224
1226 1225
1227void 1226static void
1228print_help (void) 1227print_help (void)
1229{ 1228{
1230 print_revision (progname, NP_VERSION); 1229 print_revision (progname, NP_VERSION);
@@ -1252,10 +1251,12 @@ print_help (void)
1252 printf (" %s\n", _("SNMPv3 context")); 1251 printf (" %s\n", _("SNMPv3 context"));
1253 printf (" %s\n", "-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]"); 1252 printf (" %s\n", "-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]");
1254 printf (" %s\n", _("SNMPv3 securityLevel")); 1253 printf (" %s\n", _("SNMPv3 securityLevel"));
1255 printf (" %s\n", "-a, --authproto=[MD5|SHA]"); 1254 printf (" %s\n", "-a, --authproto=AUTHENTICATION_PROTOCOL");
1256 printf (" %s\n", _("SNMPv3 auth proto")); 1255 printf (" %s\n", _("SNMPv3 authentication protocol (default MD5), available options depend on the specific version of the net-snmp tools"));
1257 printf (" %s\n", "-x, --privproto=[DES|AES]"); 1256 printf (" %s\n", _("if < 5.8 SHA (1) and MD5 should be available, if >= 5.8 additionally SHA-224, SHA-256, SHA-384 and SHA-512"));
1258 printf (" %s\n", _("SNMPv3 priv proto (default DES)")); 1257 printf (" %s\n", "-x, --privproto=PRIVACY_PROTOCOL");
1258 printf (" %s\n", _("SNMPv3 privacy protocol (default DES), available options depend on the specific version of the net-snmp tools"));
1259 printf (" %s\n", _("if < 5.8 DES and AES should be available, if >= 5.8 additionally AES-192 and AES-256"));
1259 1260
1260 /* Authentication Tokens*/ 1261 /* Authentication Tokens*/
1261 printf (" %s\n", "-C, --community=STRING"); 1262 printf (" %s\n", "-C, --community=STRING");
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index 8ccbd5a..34ef37b 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -1,39 +1,39 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* Monitoring check_ssh plugin 3* Monitoring check_ssh plugin
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 2000-2007 Monitoring Plugins Development Team 6* Copyright (c) 2000-2007 Monitoring Plugins Development Team
7* 7*
8* Description: 8* Description:
9* 9*
10* This file contains the check_ssh plugin 10* This file contains the check_ssh plugin
11* 11*
12* Try to connect to an SSH server at specified server and port 12* Try to connect to an SSH server at specified server and port
13* 13*
14* 14*
15* This program is free software: you can redistribute it and/or modify 15* This program is free software: you can redistribute it and/or modify
16* it under the terms of the GNU General Public License as published by 16* it under the terms of the GNU General Public License as published by
17* the Free Software Foundation, either version 3 of the License, or 17* the Free Software Foundation, either version 3 of the License, or
18* (at your option) any later version. 18* (at your option) any later version.
19* 19*
20* This program is distributed in the hope that it will be useful, 20* This program is distributed in the hope that it will be useful,
21* but WITHOUT ANY WARRANTY; without even the implied warranty of 21* but WITHOUT ANY WARRANTY; without even the implied warranty of
22* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23* GNU General Public License for more details. 23* GNU General Public License for more details.
24* 24*
25* You should have received a copy of the GNU General Public License 25* You should have received a copy of the GNU General Public License
26* along with this program. If not, see <http://www.gnu.org/licenses/>. 26* along with this program. If not, see <http://www.gnu.org/licenses/>.
27* 27*
28* 28*
29*****************************************************************************/ 29*****************************************************************************/
30 30
31const char *progname = "check_ssh"; 31const char *progname = "check_ssh";
32const char *copyright = "2000-2007"; 32const char *copyright = "2000-2007";
33const char *email = "devel@monitoring-plugins.org"; 33const char *email = "devel@monitoring-plugins.org";
34 34
35#include "common.h" 35#include "./common.h"
36#include "netutils.h" 36#include "./netutils.h"
37#include "utils.h" 37#include "utils.h"
38 38
39#ifndef MSG_DONTWAIT 39#ifndef MSG_DONTWAIT
@@ -47,7 +47,7 @@ int port = -1;
47char *server_name = NULL; 47char *server_name = NULL;
48char *remote_version = NULL; 48char *remote_version = NULL;
49char *remote_protocol = NULL; 49char *remote_protocol = NULL;
50int verbose = FALSE; 50bool verbose = false;
51 51
52int process_arguments (int, char **); 52int process_arguments (int, char **);
53int validate_arguments (void); 53int validate_arguments (void);
@@ -57,7 +57,6 @@ void print_usage (void);
57int ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol); 57int ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol);
58 58
59 59
60
61int 60int
62main (int argc, char **argv) 61main (int argc, char **argv)
63{ 62{
@@ -106,7 +105,7 @@ process_arguments (int argc, char **argv)
106 {"timeout", required_argument, 0, 't'}, 105 {"timeout", required_argument, 0, 't'},
107 {"verbose", no_argument, 0, 'v'}, 106 {"verbose", no_argument, 0, 'v'},
108 {"remote-version", required_argument, 0, 'r'}, 107 {"remote-version", required_argument, 0, 'r'},
109 {"remote-protcol", required_argument, 0, 'P'}, 108 {"remote-protocol", required_argument, 0, 'P'},
110 {0, 0, 0, 0} 109 {0, 0, 0, 0}
111 }; 110 };
112 111
@@ -133,7 +132,7 @@ process_arguments (int argc, char **argv)
133 print_help (); 132 print_help ();
134 exit (STATE_UNKNOWN); 133 exit (STATE_UNKNOWN);
135 case 'v': /* verbose */ 134 case 'v': /* verbose */
136 verbose = TRUE; 135 verbose = true;
137 break; 136 break;
138 case 't': /* timeout period */ 137 case 't': /* timeout period */
139 if (!is_integer (optarg)) 138 if (!is_integer (optarg))
@@ -158,7 +157,7 @@ process_arguments (int argc, char **argv)
158 remote_protocol = optarg; 157 remote_protocol = optarg;
159 break; 158 break;
160 case 'H': /* host */ 159 case 'H': /* host */
161 if (is_host (optarg) == FALSE) 160 if (!is_host (optarg))
162 usage2 (_("Invalid hostname/address"), optarg); 161 usage2 (_("Invalid hostname/address"), optarg);
163 server_name = optarg; 162 server_name = optarg;
164 break; 163 break;
@@ -215,7 +214,9 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol
215{ 214{
216 int sd; 215 int sd;
217 int result; 216 int result;
218 char *output = NULL; 217 int len = 0;
218 ssize_t recv_ret = 0;
219 char *version_control_string = NULL;
219 char *buffer = NULL; 220 char *buffer = NULL;
220 char *ssh_proto = NULL; 221 char *ssh_proto = NULL;
221 char *ssh_server = NULL; 222 char *ssh_server = NULL;
@@ -230,52 +231,126 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol
230 if (result != STATE_OK) 231 if (result != STATE_OK)
231 return result; 232 return result;
232 233
233 output = (char *) malloc (BUFF_SZ + 1); 234 char *output = (char *) calloc (BUFF_SZ + 1, sizeof(char));
234 memset (output, 0, BUFF_SZ + 1); 235
235 recv (sd, output, BUFF_SZ, 0); 236 unsigned int iteration = 0;
236 if (strncmp (output, "SSH", 3)) { 237 ssize_t byte_offset = 0;
237 printf (_("Server answer: %s"), output); 238
238 close(sd); 239 while ((version_control_string == NULL) && (recv_ret = recv(sd, output+byte_offset, BUFF_SZ - byte_offset, 0) > 0)) {
240
241 if (strchr(output, '\n')) { /* we've got at least one full line, start parsing*/
242 byte_offset = 0;
243
244 char *index = NULL;
245 while ((index = strchr(output+byte_offset, '\n')) != NULL) {
246 /*Partition the buffer so that this line is a separate string,
247 * by replacing the newline with NUL*/
248 output[(index - output)] = '\0';
249 len = strlen(output + byte_offset);
250
251 if ((len >= 4) && (strncmp (output+byte_offset, "SSH-", 4) == 0)) {
252 /*if the string starts with SSH-, this _should_ be a valid version control string*/
253 version_control_string = output+byte_offset;
254 break;
255 }
256
257 /*the start of the next line (if one exists) will be after the current one (+ NUL)*/
258 byte_offset += (len + 1);
259 }
260
261 if(version_control_string == NULL) {
262 /* move unconsumed data to beginning of buffer, null rest */
263 memmove((void *)output, (void *)output+byte_offset+1, BUFF_SZ - len+1);
264 memset(output+byte_offset+1, 0, BUFF_SZ-byte_offset+1);
265
266 /*start reading from end of current line chunk on next recv*/
267 byte_offset = strlen(output);
268 }
269 } else {
270 byte_offset += recv_ret;
271 }
272 }
273
274 if (recv_ret < 0) {
275 printf("SSH CRITICAL - %s", strerror(errno));
276 exit(STATE_CRITICAL);
277 }
278
279 if (version_control_string == NULL) {
280 printf("SSH CRITICAL - No version control string received");
281 exit(STATE_CRITICAL);
282 }
283 /*
284 * "When the connection has been established, both sides MUST send an
285 * identification string. This identification string MUST be
286 *
287 * SSH-protoversion-softwareversion SP comments CR LF"
288 * - RFC 4253:4.2
289 */
290 strip (version_control_string);
291 if (verbose)
292 printf ("%s\n", version_control_string);
293 ssh_proto = version_control_string + 4;
294
295 /*
296 * We assume the protoversion is of the form Major.Minor, although
297 * this is not _strictly_ required. See
298 *
299 * "Both the 'protoversion' and 'softwareversion' strings MUST consist of
300 * printable US-ASCII characters, with the exception of whitespace
301 * characters and the minus sign (-)"
302 * - RFC 4253:4.2
303 * and,
304 *
305 * "As stated earlier, the 'protoversion' specified for this protocol is
306 * "2.0". Earlier versions of this protocol have not been formally
307 * documented, but it is widely known that they use 'protoversion' of
308 * "1.x" (e.g., "1.5" or "1.3")."
309 * - RFC 4253:5
310 */
311 ssh_server = ssh_proto + strspn (ssh_proto, "0123456789.") + 1; /* (+1 for the '-' separating protoversion from softwareversion) */
312
313 /* If there's a space in the version string, whatever's after the space is a comment
314 * (which is NOT part of the server name/version)*/
315 char *tmp = strchr(ssh_server, ' ');
316 if (tmp) {
317 ssh_server[tmp - ssh_server] = '\0';
318 }
319 if (strlen(ssh_proto) == 0 || strlen(ssh_server) == 0) {
320 printf(_("SSH CRITICAL - Invalid protocol version control string %s\n"), version_control_string);
239 exit (STATE_CRITICAL); 321 exit (STATE_CRITICAL);
240 } 322 }
241 else { 323 ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
242 strip (output);
243 if (verbose)
244 printf ("%s\n", output);
245 ssh_proto = output + 4;
246 ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789. ");
247 ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
248
249 xasprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, rev_no);
250 send (sd, buffer, strlen (buffer), MSG_DONTWAIT);
251 if (verbose)
252 printf ("%s\n", buffer);
253
254 if (remote_version && strcmp(remote_version, ssh_server)) {
255 printf
256 (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"),
257 ssh_server, ssh_proto, remote_version);
258 close(sd);
259 exit (STATE_CRITICAL);
260 }
261 324
262 if (remote_protocol && strcmp(remote_protocol, ssh_proto)) { 325 xasprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, rev_no);
263 printf 326 send (sd, buffer, strlen (buffer), MSG_DONTWAIT);
264 (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"), 327 if (verbose)
265 ssh_server, ssh_proto, remote_protocol); 328 printf ("%s\n", buffer);
266 close(sd);
267 exit (STATE_CRITICAL);
268 }
269 329
270 elapsed_time = (double)deltime(tv) / 1.0e6; 330 if (remote_version && strcmp(remote_version, ssh_server)) {
331 printf
332 (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"),
333 ssh_server, ssh_proto, remote_version);
334 close(sd);
335 exit (STATE_CRITICAL);
336 }
271 337
338 if (remote_protocol && strcmp(remote_protocol, ssh_proto)) {
272 printf 339 printf
273 (_("SSH OK - %s (protocol %s) | %s\n"), 340 (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s' | %s\n"),
274 ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s", 341 ssh_server, ssh_proto, remote_protocol, fperfdata("time", elapsed_time, "s",
275 FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout)); 342 false, 0, false, 0, true, 0, true, (int)socket_timeout));
276 close(sd); 343 close(sd);
277 exit (STATE_OK); 344 exit (STATE_CRITICAL);
278 } 345 }
346 elapsed_time = (double)deltime(tv) / 1.0e6;
347
348 printf
349 (_("SSH OK - %s (protocol %s) | %s\n"),
350 ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
351 false, 0, false, 0, true, 0, true, (int)socket_timeout));
352 close(sd);
353 exit (STATE_OK);
279} 354}
280 355
281 356
@@ -293,7 +368,7 @@ print_help (void)
293 368
294 printf ("%s\n", _("Try to connect to an SSH server at specified server and port")); 369 printf ("%s\n", _("Try to connect to an SSH server at specified server and port"));
295 370
296 printf ("\n\n"); 371 printf ("\n\n");
297 372
298 print_usage (); 373 print_usage ();
299 374
@@ -307,10 +382,10 @@ print_help (void)
307 printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); 382 printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
308 383
309 printf (" %s\n", "-r, --remote-version=STRING"); 384 printf (" %s\n", "-r, --remote-version=STRING");
310 printf (" %s\n", _("Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)")); 385 printf (" %s\n", _("Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"));
311 386
312 printf (" %s\n", "-P, --remote-protocol=STRING"); 387 printf (" %s\n", "-P, --remote-protocol=STRING");
313 printf (" %s\n", _("Alert if protocol doesn't match expected protocol version (ex: 2.0)")); 388 printf (" %s\n", _("Alert if protocol doesn't match expected protocol version (ex: 2.0)"));
314 389
315 printf (UT_VERBOSE); 390 printf (UT_VERBOSE);
316 391
@@ -322,7 +397,7 @@ print_help (void)
322void 397void
323print_usage (void) 398print_usage (void)
324{ 399{
325 printf ("%s\n", _("Usage:")); 400 printf ("%s\n", _("Usage:"));
326 printf ("%s [-4|-6] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n", progname); 401 printf ("%s [-4|-6] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n", progname);
327} 402}
328 403
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index cd965e3..e7ee785 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -4,7 +4,7 @@
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net) 6* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
7* Copyright (c) 2000-2007 Monitoring Plugins Development Team 7* Copyright (c) 2000-2024 Monitoring Plugins Development Team
8* 8*
9* Description: 9* Description:
10* 10*
@@ -28,7 +28,7 @@
28*****************************************************************************/ 28*****************************************************************************/
29 29
30const char *progname = "check_swap"; 30const char *progname = "check_swap";
31const char *copyright = "2000-2007"; 31const char *copyright = "2000-2024";
32const char *email = "devel@monitoring-plugins.org"; 32const char *email = "devel@monitoring-plugins.org";
33 33
34#include "common.h" 34#include "common.h"
@@ -52,9 +52,9 @@ const char *email = "devel@monitoring-plugins.org";
52#endif 52#endif
53 53
54typedef struct { 54typedef struct {
55 int is_percentage; 55 bool is_percentage;
56 uint64_t value; 56 uint64_t value;
57} threshold_t; 57} threshold;
58 58
59int check_swap (float free_swap_mb, float total_swap_mb); 59int check_swap (float free_swap_mb, float total_swap_mb);
60int process_arguments (int argc, char **argv); 60int process_arguments (int argc, char **argv);
@@ -62,10 +62,10 @@ int validate_arguments (void);
62void print_usage (void); 62void print_usage (void);
63void print_help (void); 63void print_help (void);
64 64
65threshold_t warn; 65threshold warn;
66threshold_t crit; 66threshold crit;
67int verbose; 67int verbose;
68int allswaps; 68bool allswaps = false;
69int no_swap_state = STATE_CRITICAL; 69int no_swap_state = STATE_CRITICAL;
70 70
71int 71int
@@ -383,10 +383,10 @@ main (int argc, char **argv)
383 if (crit.is_percentage) crit_print = crit.value * (total_swap_mb *1024 *1024/100); 383 if (crit.is_percentage) crit_print = crit.value * (total_swap_mb *1024 *1024/100);
384 384
385 puts (perfdata_uint64 ("swap", free_swap_mb *1024 *1024, "B", 385 puts (perfdata_uint64 ("swap", free_swap_mb *1024 *1024, "B",
386 TRUE, warn_print, 386 true, warn_print,
387 TRUE, crit_print, 387 true, crit_print,
388 TRUE, 0, 388 true, 0,
389 TRUE, (long) total_swap_mb * 1024 * 1024)); 389 true, (long) total_swap_mb * 1024 * 1024));
390 390
391 return result; 391 return result;
392} 392}
@@ -399,28 +399,30 @@ check_swap(float free_swap_mb, float total_swap_mb)
399 if (!total_swap_mb) return no_swap_state; 399 if (!total_swap_mb) return no_swap_state;
400 400
401 uint64_t free_swap = free_swap_mb * (1024 * 1024); /* Convert back to bytes as warn and crit specified in bytes */ 401 uint64_t free_swap = free_swap_mb * (1024 * 1024); /* Convert back to bytes as warn and crit specified in bytes */
402
403 if (!crit.is_percentage && crit.value >= free_swap) return STATE_CRITICAL;
404 if (!warn.is_percentage && warn.value >= free_swap) return STATE_WARNING;
405
406
407 uint64_t usage_percentage = ((total_swap_mb - free_swap_mb) / total_swap_mb) * 100; 402 uint64_t usage_percentage = ((total_swap_mb - free_swap_mb) / total_swap_mb) * 100;
408 403
409 if (crit.is_percentage && 404 if (warn.value || crit.value) { /* Thresholds defined */
410 crit.value != 0 && 405 if (!crit.is_percentage && crit.value >= free_swap) return STATE_CRITICAL;
411 usage_percentage >= (100 - crit.value)) 406 if (!warn.is_percentage && warn.value >= free_swap) return STATE_WARNING;
412 { 407
413 return STATE_CRITICAL; 408 if (crit.is_percentage &&
414 } 409 crit.value != 0 &&
415 410 usage_percentage >= (100 - crit.value))
416 if (warn.is_percentage && 411 {
417 warn.value != 0 && 412 return STATE_CRITICAL;
418 usage_percentage >= (100 - warn.value)) 413 }
419 { 414
420 return STATE_WARNING; 415 if (warn.is_percentage &&
421 } 416 warn.value != 0 &&
422 417 usage_percentage >= (100 - warn.value))
423 return STATE_OK; 418 {
419 return STATE_WARNING;
420 }
421
422 return STATE_OK;
423 } else { /* Without thresholds */
424 return STATE_OK;
425 }
424} 426}
425 427
426 428
@@ -443,9 +445,6 @@ process_arguments (int argc, char **argv)
443 {0, 0, 0, 0} 445 {0, 0, 0, 0}
444 }; 446 };
445 447
446 if (argc < 2)
447 return ERROR;
448
449 while (1) { 448 while (1) {
450 c = getopt_long (argc, argv, "+?Vvhac:w:n:", longopts, &option); 449 c = getopt_long (argc, argv, "+?Vvhac:w:n:", longopts, &option);
451 450
@@ -465,7 +464,7 @@ process_arguments (int argc, char **argv)
465 464
466 if (optarg[length - 1] == '%') { 465 if (optarg[length - 1] == '%') {
467 /* It's percentage */ 466 /* It's percentage */
468 warn.is_percentage = 1; 467 warn.is_percentage = true;
469 optarg[length - 1] = '\0'; 468 optarg[length - 1] = '\0';
470 if (is_uint64(optarg, &warn.value)) { 469 if (is_uint64(optarg, &warn.value)) {
471 if (warn.value > 100) { 470 if (warn.value > 100) {
@@ -475,7 +474,7 @@ process_arguments (int argc, char **argv)
475 break; 474 break;
476 } else { 475 } else {
477 /* It's Bytes */ 476 /* It's Bytes */
478 warn.is_percentage = 0; 477 warn.is_percentage = false;
479 if (is_uint64(optarg, &warn.value)) { 478 if (is_uint64(optarg, &warn.value)) {
480 break; 479 break;
481 } else { 480 } else {
@@ -495,7 +494,7 @@ process_arguments (int argc, char **argv)
495 494
496 if (optarg[length - 1] == '%') { 495 if (optarg[length - 1] == '%') {
497 /* It's percentage */ 496 /* It's percentage */
498 crit.is_percentage = 1; 497 crit.is_percentage = true;
499 optarg[length - 1] = '\0'; 498 optarg[length - 1] = '\0';
500 if (is_uint64(optarg, &crit.value)) { 499 if (is_uint64(optarg, &crit.value)) {
501 if (crit.value> 100) { 500 if (crit.value> 100) {
@@ -505,7 +504,7 @@ process_arguments (int argc, char **argv)
505 break; 504 break;
506 } else { 505 } else {
507 /* It's Bytes */ 506 /* It's Bytes */
508 crit.is_percentage = 0; 507 crit.is_percentage = false;
509 if (is_uint64(optarg, &crit.value)) { 508 if (is_uint64(optarg, &crit.value)) {
510 break; 509 break;
511 } else { 510 } else {
@@ -514,7 +513,7 @@ process_arguments (int argc, char **argv)
514 } 513 }
515 } 514 }
516 case 'a': /* all swap */ 515 case 'a': /* all swap */
517 allswaps = TRUE; 516 allswaps = true;
518 break; 517 break;
519 case 'n': 518 case 'n':
520 if ((no_swap_state = mp_translate_state(optarg)) == ERROR) { 519 if ((no_swap_state = mp_translate_state(optarg)) == ERROR) {
@@ -547,10 +546,7 @@ process_arguments (int argc, char **argv)
547int 546int
548validate_arguments (void) 547validate_arguments (void)
549{ 548{
550 if (warn.value == 0 && crit.value == 0) { 549 if ((warn.is_percentage == crit.is_percentage) && (warn.value < crit.value)) {
551 return ERROR;
552 }
553 else if ((warn.is_percentage == crit.is_percentage) && (warn.value < crit.value)) {
554 /* This is NOT triggered if warn and crit are different units, e.g warn is percentage 550 /* This is NOT triggered if warn and crit are different units, e.g warn is percentage
555 * and crit is absolute. We cannot determine the condition at this point since we 551 * and crit is absolute. We cannot determine the condition at this point since we
556 * dont know the value of total swap yet 552 * dont know the value of total swap yet
@@ -595,6 +591,7 @@ print_help (void)
595 printf ("\n"); 591 printf ("\n");
596 printf ("%s\n", _("Notes:")); 592 printf ("%s\n", _("Notes:"));
597 printf (" %s\n", _("Both INTEGER and PERCENT thresholds can be specified, they are all checked.")); 593 printf (" %s\n", _("Both INTEGER and PERCENT thresholds can be specified, they are all checked."));
594 printf (" %s\n", _("Without thresholds, the plugin shows free swap space and performance data, but always returns OK."));
598 printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.")); 595 printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."));
599 596
600 printf (UT_SUPPORT); 597 printf (UT_SUPPORT);
@@ -605,6 +602,6 @@ void
605print_usage (void) 602print_usage (void)
606{ 603{
607 printf ("%s\n", _("Usage:")); 604 printf ("%s\n", _("Usage:"));
608 printf (" %s [-av] -w <percent_free>%% -c <percent_free>%%\n",progname); 605 printf (" %s [-av] [-w <percent_free>%%] [-c <percent_free>%%]\n",progname);
609 printf (" -w <bytes_free> -c <bytes_free> [-n <state>]\n"); 606 printf (" [-w <bytes_free>] [-c <bytes_free>] [-n <state>]\n");
610} 607}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 1d307cf..01dd35e 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -41,7 +41,7 @@ const char *email = "devel@monitoring-plugins.org";
41#include <sys/select.h> 41#include <sys/select.h>
42 42
43#ifdef HAVE_SSL 43#ifdef HAVE_SSL
44static int check_cert = FALSE; 44static bool check_cert = false;
45static int days_till_exp_warn, days_till_exp_crit; 45static int days_till_exp_warn, days_till_exp_crit;
46# define my_recv(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_read(buf, len) : read(sd, buf, len)) 46# define my_recv(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
47# define my_send(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0)) 47# define my_send(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
@@ -65,12 +65,12 @@ static int READ_TIMEOUT = 2;
65 65
66static int server_port = 0; 66static int server_port = 0;
67static char *server_address = NULL; 67static char *server_address = NULL;
68static int host_specified = FALSE; 68static bool host_specified = false;
69static char *server_send = NULL; 69static char *server_send = NULL;
70static char *server_quit = NULL; 70static char *server_quit = NULL;
71static char **server_expect; 71static char **server_expect;
72static size_t server_expect_count = 0; 72static size_t server_expect_count = 0;
73static size_t maxbytes = 0; 73static ssize_t maxbytes = 0;
74static char **warn_codes = NULL; 74static char **warn_codes = NULL;
75static size_t warn_codes_count = 0; 75static size_t warn_codes_count = 0;
76static char **crit_codes = NULL; 76static char **crit_codes = NULL;
@@ -88,7 +88,7 @@ static int match_flags = NP_MATCH_EXACT;
88 88
89#ifdef HAVE_SSL 89#ifdef HAVE_SSL
90static char *sni = NULL; 90static char *sni = NULL;
91static int sni_specified = FALSE; 91static bool sni_specified = false;
92#endif 92#endif
93 93
94#define FLAG_SSL 0x01 94#define FLAG_SSL 0x01
@@ -102,11 +102,9 @@ int
102main (int argc, char **argv) 102main (int argc, char **argv)
103{ 103{
104 int result = STATE_UNKNOWN; 104 int result = STATE_UNKNOWN;
105 int i;
106 char *status = NULL; 105 char *status = NULL;
107 struct timeval tv; 106 struct timeval tv;
108 struct timeval timeout; 107 struct timeval timeout;
109 size_t len;
110 int match = -1; 108 int match = -1;
111 fd_set rfds; 109 fd_set rfds;
112 110
@@ -121,10 +119,10 @@ main (int argc, char **argv)
121 if(progname != NULL) progname++; 119 if(progname != NULL) progname++;
122 else progname = argv[0]; 120 else progname = argv[0];
123 121
124 len = strlen(progname); 122 size_t prog_name_len = strlen(progname);
125 if(len > 6 && !memcmp(progname, "check_", 6)) { 123 if(prog_name_len > 6 && !memcmp(progname, "check_", 6)) {
126 SERVICE = strdup(progname + 6); 124 SERVICE = strdup(progname + 6);
127 for(i = 0; i < len - 6; i++) 125 for(size_t i = 0; i < prog_name_len - 6; i++)
128 SERVICE[i] = toupper(SERVICE[i]); 126 SERVICE[i] = toupper(SERVICE[i]);
129 } 127 }
130 128
@@ -247,7 +245,7 @@ main (int argc, char **argv)
247#ifdef HAVE_SSL 245#ifdef HAVE_SSL
248 if (flags & FLAG_SSL){ 246 if (flags & FLAG_SSL){
249 result = np_net_ssl_init_with_hostname(sd, (sni_specified ? sni : NULL)); 247 result = np_net_ssl_init_with_hostname(sd, (sni_specified ? sni : NULL));
250 if (result == STATE_OK && check_cert == TRUE) { 248 if (result == STATE_OK && check_cert) {
251 result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit); 249 result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
252 } 250 }
253 } 251 }
@@ -275,19 +273,21 @@ main (int argc, char **argv)
275 printf("Quit string: %s\n", server_quit); 273 printf("Quit string: %s\n", server_quit);
276 } 274 }
277 printf("server_expect_count: %d\n", (int)server_expect_count); 275 printf("server_expect_count: %d\n", (int)server_expect_count);
278 for(i = 0; i < server_expect_count; i++) 276 for(size_t i = 0; i < server_expect_count; i++)
279 printf("\t%d: %s\n", i, server_expect[i]); 277 printf("\t%zd: %s\n", i, server_expect[i]);
280 } 278 }
281 279
282 /* if(len) later on, we know we have a non-NULL response */ 280 /* if(len) later on, we know we have a non-NULL response */
283 len = 0; 281 ssize_t len = 0;
282
284 if (server_expect_count) { 283 if (server_expect_count) {
284 ssize_t received = 0;
285 285
286 /* watch for the expect string */ 286 /* watch for the expect string */
287 while ((i = my_recv(buffer, sizeof(buffer))) > 0) { 287 while ((received = my_recv(buffer, sizeof(buffer))) > 0) {
288 status = realloc(status, len + i + 1); 288 status = realloc(status, len + received + 1);
289 memcpy(&status[len], buffer, i); 289 memcpy(&status[len], buffer, received);
290 len += i; 290 len += received;
291 status[len] = '\0'; 291 status[len] = '\0';
292 292
293 /* stop reading if user-forced */ 293 /* stop reading if user-forced */
@@ -307,6 +307,7 @@ main (int argc, char **argv)
307 if(select(sd + 1, &rfds, NULL, NULL, &timeout) <= 0) 307 if(select(sd + 1, &rfds, NULL, NULL, &timeout) <= 0)
308 break; 308 break;
309 } 309 }
310
310 if (match == NP_MATCH_RETRY) 311 if (match == NP_MATCH_RETRY)
311 match = NP_MATCH_FAILURE; 312 match = NP_MATCH_FAILURE;
312 313
@@ -378,18 +379,18 @@ main (int argc, char **argv)
378 if(match == NP_MATCH_FAILURE) 379 if(match == NP_MATCH_FAILURE)
379 printf ("|%s", 380 printf ("|%s",
380 fperfdata ("time", elapsed_time, "s", 381 fperfdata ("time", elapsed_time, "s",
381 (flags & FLAG_TIME_WARN ? TRUE : FALSE), 0, 382 (flags & FLAG_TIME_WARN ? true : false), 0,
382 (flags & FLAG_TIME_CRIT ? TRUE : FALSE), 0, 383 (flags & FLAG_TIME_CRIT ? true : false), 0,
383 TRUE, 0, 384 true, 0,
384 TRUE, socket_timeout) 385 true, socket_timeout)
385 ); 386 );
386 else 387 else
387 printf("|%s", 388 printf("|%s",
388 fperfdata ("time", elapsed_time, "s", 389 fperfdata ("time", elapsed_time, "s",
389 (flags & FLAG_TIME_WARN ? TRUE : FALSE), warning_time, 390 (flags & FLAG_TIME_WARN ? true : false), warning_time,
390 (flags & FLAG_TIME_CRIT ? TRUE : FALSE), critical_time, 391 (flags & FLAG_TIME_CRIT ? true : false), critical_time,
391 TRUE, 0, 392 true, 0,
392 TRUE, socket_timeout) 393 true, socket_timeout)
393 ); 394 );
394 395
395 putchar('\n'); 396 putchar('\n');
@@ -399,11 +400,9 @@ main (int argc, char **argv)
399 400
400 401
401/* process command-line arguments */ 402/* process command-line arguments */
402static int 403static int process_arguments (int argc, char **argv) {
403process_arguments (int argc, char **argv)
404{
405 int c; 404 int c;
406 int escape = 0; 405 bool escape = false;
407 char *temp; 406 char *temp;
408 407
409 enum { 408 enum {
@@ -492,7 +491,7 @@ process_arguments (int argc, char **argv)
492#endif 491#endif
493 break; 492 break;
494 case 'H': /* hostname */ 493 case 'H': /* hostname */
495 host_specified = TRUE; 494 host_specified = true;
496 server_address = optarg; 495 server_address = optarg;
497 break; 496 break;
498 case 'c': /* critical */ 497 case 'c': /* critical */
@@ -527,7 +526,7 @@ process_arguments (int argc, char **argv)
527 server_port = atoi (optarg); 526 server_port = atoi (optarg);
528 break; 527 break;
529 case 'E': 528 case 'E':
530 escape = 1; 529 escape = true;
531 break; 530 break;
532 case 's': 531 case 's':
533 if (escape) 532 if (escape)
@@ -601,7 +600,7 @@ process_arguments (int argc, char **argv)
601 usage2 (_("Invalid certificate expiration period"), optarg); 600 usage2 (_("Invalid certificate expiration period"), optarg);
602 days_till_exp_warn = atoi (optarg); 601 days_till_exp_warn = atoi (optarg);
603 } 602 }
604 check_cert = TRUE; 603 check_cert = true;
605 flags |= FLAG_SSL; 604 flags |= FLAG_SSL;
606 break; 605 break;
607# endif /* USE_OPENSSL */ 606# endif /* USE_OPENSSL */
@@ -617,7 +616,7 @@ process_arguments (int argc, char **argv)
617 case SNI_OPTION: 616 case SNI_OPTION:
618#ifdef HAVE_SSL 617#ifdef HAVE_SSL
619 flags |= FLAG_SSL; 618 flags |= FLAG_SSL;
620 sni_specified = TRUE; 619 sni_specified = true;
621 sni = optarg; 620 sni = optarg;
622#else 621#else
623 die (STATE_UNKNOWN, _("Invalid option - SSL is not available")); 622 die (STATE_UNKNOWN, _("Invalid option - SSL is not available"));
@@ -630,15 +629,15 @@ process_arguments (int argc, char **argv)
630 } 629 }
631 630
632 c = optind; 631 c = optind;
633 if(host_specified == FALSE && c < argc) 632 if(!host_specified && c < argc)
634 server_address = strdup (argv[c++]); 633 server_address = strdup (argv[c++]);
635 634
636 if (server_address == NULL) 635 if (server_address == NULL)
637 usage4 (_("You must provide a server address")); 636 usage4 (_("You must provide a server address"));
638 else if (server_address[0] != '/' && is_host (server_address) == FALSE) 637 else if (server_address[0] != '/' && !is_host(server_address))
639 die (STATE_CRITICAL, "%s %s - %s: %s\n", SERVICE, state_text(STATE_CRITICAL), _("Invalid hostname, address or socket"), server_address); 638 die (STATE_CRITICAL, "%s %s - %s: %s\n", SERVICE, state_text(STATE_CRITICAL), _("Invalid hostname, address or socket"), server_address);
640 639
641 return TRUE; 640 return OK;
642} 641}
643 642
644 643
diff --git a/plugins/check_time.c b/plugins/check_time.c
index baf8c59..f50ea42 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -45,16 +45,16 @@ enum {
45uint32_t raw_server_time; 45uint32_t raw_server_time;
46unsigned long server_time, diff_time; 46unsigned long server_time, diff_time;
47int warning_time = 0; 47int warning_time = 0;
48int check_warning_time = FALSE; 48bool check_warning_time = false;
49int critical_time = 0; 49int critical_time = 0;
50int check_critical_time = FALSE; 50bool check_critical_time = false;
51unsigned long warning_diff = 0; 51unsigned long warning_diff = 0;
52int check_warning_diff = FALSE; 52bool check_warning_diff = false;
53unsigned long critical_diff = 0; 53unsigned long critical_diff = 0;
54int check_critical_diff = FALSE; 54bool check_critical_diff = false;
55int server_port = TIME_PORT; 55int server_port = TIME_PORT;
56char *server_address = NULL; 56char *server_address = NULL;
57int use_udp = FALSE; 57bool use_udp = false;
58 58
59int process_arguments (int, char **); 59int process_arguments (int, char **);
60void print_help (void); 60void print_help (void);
@@ -92,9 +92,9 @@ main (int argc, char **argv)
92 } 92 }
93 93
94 if (result != STATE_OK) { 94 if (result != STATE_OK) {
95 if (check_critical_time == TRUE) 95 if (check_critical_time)
96 result = STATE_CRITICAL; 96 result = STATE_CRITICAL;
97 else if (check_warning_time == TRUE) 97 else if (check_warning_time)
98 result = STATE_WARNING; 98 result = STATE_WARNING;
99 else 99 else
100 result = STATE_UNKNOWN; 100 result = STATE_UNKNOWN;
@@ -105,9 +105,9 @@ main (int argc, char **argv)
105 105
106 if (use_udp) { 106 if (use_udp) {
107 if (send (sd, "", 0, 0) < 0) { 107 if (send (sd, "", 0, 0) < 0) {
108 if (check_critical_time == TRUE) 108 if (check_critical_time)
109 result = STATE_CRITICAL; 109 result = STATE_CRITICAL;
110 else if (check_warning_time == TRUE) 110 else if (check_warning_time)
111 result = STATE_WARNING; 111 result = STATE_WARNING;
112 else 112 else
113 result = STATE_UNKNOWN; 113 result = STATE_UNKNOWN;
@@ -129,9 +129,9 @@ main (int argc, char **argv)
129 129
130 /* return a WARNING status if we couldn't read any data */ 130 /* return a WARNING status if we couldn't read any data */
131 if (result <= 0) { 131 if (result <= 0) {
132 if (check_critical_time == TRUE) 132 if (check_critical_time)
133 result = STATE_CRITICAL; 133 result = STATE_CRITICAL;
134 else if (check_warning_time == TRUE) 134 else if (check_warning_time)
135 result = STATE_WARNING; 135 result = STATE_WARNING;
136 else 136 else
137 result = STATE_UNKNOWN; 137 result = STATE_UNKNOWN;
@@ -143,9 +143,9 @@ main (int argc, char **argv)
143 result = STATE_OK; 143 result = STATE_OK;
144 144
145 conntime = (end_time - start_time); 145 conntime = (end_time - start_time);
146 if (check_critical_time == TRUE && conntime > critical_time) 146 if (check_critical_time&& conntime > critical_time)
147 result = STATE_CRITICAL; 147 result = STATE_CRITICAL;
148 else if (check_warning_time == TRUE && conntime > warning_time) 148 else if (check_warning_time && conntime > warning_time)
149 result = STATE_WARNING; 149 result = STATE_WARNING;
150 150
151 if (result != STATE_OK) 151 if (result != STATE_OK)
@@ -154,7 +154,7 @@ main (int argc, char **argv)
154 perfdata ("time", (long)conntime, "s", 154 perfdata ("time", (long)conntime, "s",
155 check_warning_time, (long)warning_time, 155 check_warning_time, (long)warning_time,
156 check_critical_time, (long)critical_time, 156 check_critical_time, (long)critical_time,
157 TRUE, 0, FALSE, 0)); 157 true, 0, false, 0));
158 158
159 server_time = ntohl (raw_server_time) - UNIX_EPOCH; 159 server_time = ntohl (raw_server_time) - UNIX_EPOCH;
160 if (server_time > (unsigned long)end_time) 160 if (server_time > (unsigned long)end_time)
@@ -162,9 +162,9 @@ main (int argc, char **argv)
162 else 162 else
163 diff_time = (unsigned long)end_time - server_time; 163 diff_time = (unsigned long)end_time - server_time;
164 164
165 if (check_critical_diff == TRUE && diff_time > critical_diff) 165 if (check_critical_diff&& diff_time > critical_diff)
166 result = STATE_CRITICAL; 166 result = STATE_CRITICAL;
167 else if (check_warning_diff == TRUE && diff_time > warning_diff) 167 else if (check_warning_diff&& diff_time > warning_diff)
168 result = STATE_WARNING; 168 result = STATE_WARNING;
169 169
170 printf (_("TIME %s - %lu second time difference|%s %s\n"), 170 printf (_("TIME %s - %lu second time difference|%s %s\n"),
@@ -172,11 +172,11 @@ main (int argc, char **argv)
172 perfdata ("time", (long)conntime, "s", 172 perfdata ("time", (long)conntime, "s",
173 check_warning_time, (long)warning_time, 173 check_warning_time, (long)warning_time,
174 check_critical_time, (long)critical_time, 174 check_critical_time, (long)critical_time,
175 TRUE, 0, FALSE, 0), 175 true, 0, false, 0),
176 perfdata ("offset", diff_time, "s", 176 perfdata ("offset", diff_time, "s",
177 check_warning_diff, warning_diff, 177 check_warning_diff, warning_diff,
178 check_critical_diff, critical_diff, 178 check_critical_diff, critical_diff,
179 TRUE, 0, FALSE, 0)); 179 true, 0, false, 0));
180 return result; 180 return result;
181} 181}
182 182
@@ -219,7 +219,7 @@ process_arguments (int argc, char **argv)
219 strcpy (argv[c], "-C"); 219 strcpy (argv[c], "-C");
220 } 220 }
221 221
222 while (1) { 222 while (true) {
223 c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:u", longopts, 223 c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:u", longopts,
224 &option); 224 &option);
225 225
@@ -236,19 +236,19 @@ process_arguments (int argc, char **argv)
236 print_revision (progname, NP_VERSION); 236 print_revision (progname, NP_VERSION);
237 exit (STATE_UNKNOWN); 237 exit (STATE_UNKNOWN);
238 case 'H': /* hostname */ 238 case 'H': /* hostname */
239 if (is_host (optarg) == FALSE) 239 if (!is_host (optarg))
240 usage2 (_("Invalid hostname/address"), optarg); 240 usage2 (_("Invalid hostname/address"), optarg);
241 server_address = optarg; 241 server_address = optarg;
242 break; 242 break;
243 case 'w': /* warning-variance */ 243 case 'w': /* warning-variance */
244 if (is_intnonneg (optarg)) { 244 if (is_intnonneg (optarg)) {
245 warning_diff = strtoul (optarg, NULL, 10); 245 warning_diff = strtoul (optarg, NULL, 10);
246 check_warning_diff = TRUE; 246 check_warning_diff = true;
247 } 247 }
248 else if (strspn (optarg, "0123456789:,") > 0) { 248 else if (strspn (optarg, "0123456789:,") > 0) {
249 if (sscanf (optarg, "%lu%*[:,]%d", &warning_diff, &warning_time) == 2) { 249 if (sscanf (optarg, "%lu%*[:,]%d", &warning_diff, &warning_time) == 2) {
250 check_warning_diff = TRUE; 250 check_warning_diff = true;
251 check_warning_time = TRUE; 251 check_warning_time = true;
252 } 252 }
253 else { 253 else {
254 usage4 (_("Warning thresholds must be a positive integer")); 254 usage4 (_("Warning thresholds must be a positive integer"));
@@ -261,13 +261,13 @@ process_arguments (int argc, char **argv)
261 case 'c': /* critical-variance */ 261 case 'c': /* critical-variance */
262 if (is_intnonneg (optarg)) { 262 if (is_intnonneg (optarg)) {
263 critical_diff = strtoul (optarg, NULL, 10); 263 critical_diff = strtoul (optarg, NULL, 10);
264 check_critical_diff = TRUE; 264 check_critical_diff = true;
265 } 265 }
266 else if (strspn (optarg, "0123456789:,") > 0) { 266 else if (strspn (optarg, "0123456789:,") > 0) {
267 if (sscanf (optarg, "%lu%*[:,]%d", &critical_diff, &critical_time) == 267 if (sscanf (optarg, "%lu%*[:,]%d", &critical_diff, &critical_time) ==
268 2) { 268 2) {
269 check_critical_diff = TRUE; 269 check_critical_diff = true;
270 check_critical_time = TRUE; 270 check_critical_time = true;
271 } 271 }
272 else { 272 else {
273 usage4 (_("Critical thresholds must be a positive integer")); 273 usage4 (_("Critical thresholds must be a positive integer"));
@@ -282,14 +282,14 @@ process_arguments (int argc, char **argv)
282 usage4 (_("Warning threshold must be a positive integer")); 282 usage4 (_("Warning threshold must be a positive integer"));
283 else 283 else
284 warning_time = atoi (optarg); 284 warning_time = atoi (optarg);
285 check_warning_time = TRUE; 285 check_warning_time = true;
286 break; 286 break;
287 case 'C': /* critical-connect */ 287 case 'C': /* critical-connect */
288 if (!is_intnonneg (optarg)) 288 if (!is_intnonneg (optarg))
289 usage4 (_("Critical threshold must be a positive integer")); 289 usage4 (_("Critical threshold must be a positive integer"));
290 else 290 else
291 critical_time = atoi (optarg); 291 critical_time = atoi (optarg);
292 check_critical_time = TRUE; 292 check_critical_time = true;
293 break; 293 break;
294 case 'p': /* port */ 294 case 'p': /* port */
295 if (!is_intnonneg (optarg)) 295 if (!is_intnonneg (optarg))
@@ -304,14 +304,14 @@ process_arguments (int argc, char **argv)
304 socket_timeout = atoi (optarg); 304 socket_timeout = atoi (optarg);
305 break; 305 break;
306 case 'u': /* udp */ 306 case 'u': /* udp */
307 use_udp = TRUE; 307 use_udp = true;
308 } 308 }
309 } 309 }
310 310
311 c = optind; 311 c = optind;
312 if (server_address == NULL) { 312 if (server_address == NULL) {
313 if (argc > c) { 313 if (argc > c) {
314 if (is_host (argv[c]) == FALSE) 314 if (!is_host (argv[c]))
315 usage2 (_("Invalid hostname/address"), optarg); 315 usage2 (_("Invalid hostname/address"), optarg);
316 server_address = argv[c]; 316 server_address = argv[c];
317 } 317 }
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 68737c4..380ff3b 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -1,665 +1,746 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2 *
3* Monitoring check_ups plugin 3 * Monitoring check_ups plugin
4* 4 *
5* License: GPL 5 * License: GPL
6* Copyright (c) 2000 Tom Shields 6 * Copyright (c) 2000 Tom Shields
7* 2004 Alain Richard <alain.richard@equation.fr> 7 * 2004 Alain Richard <alain.richard@equation.fr>
8* 2004 Arnaud Quette <arnaud.quette@mgeups.com> 8 * 2004 Arnaud Quette <arnaud.quette@mgeups.com>
9* Copyright (c) 2002-2007 Monitoring Plugins Development Team 9 * Copyright (c) 2002-2023 Monitoring Plugins Development Team
10* 10 *
11* Description: 11 * Description:
12* 12 *
13* This file contains Network UPS Tools plugin for Monitoring 13 * This file contains Network UPS Tools plugin for Monitoring
14* 14 *
15* This plugin tests the UPS service on the specified host. Network UPS Tools 15 * This plugin tests the UPS service on the specified host. Network UPS Tools
16* from www.networkupstools.org must be running for this plugin to work. 16 * from www.networkupstools.org must be running for this plugin to work.
17* 17 *
18* 18 *
19* This program is free software: you can redistribute it and/or modify 19 * This program is free software: you can redistribute it and/or modify
20* it under the terms of the GNU General Public License as published by 20 * it under the terms of the GNU General Public License as published by
21* the Free Software Foundation, either version 3 of the License, or 21 * the Free Software Foundation, either version 3 of the License, or
22* (at your option) any later version. 22 * (at your option) any later version.
23* 23 *
24* This program is distributed in the hope that it will be useful, 24 * This program is distributed in the hope that it will be useful,
25* but WITHOUT ANY WARRANTY; without even the implied warranty of 25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27* GNU General Public License for more details. 27 * GNU General Public License for more details.
28* 28 *
29* You should have received a copy of the GNU General Public License 29 * You should have received a copy of the GNU General Public License
30* along with this program. If not, see <http://www.gnu.org/licenses/>. 30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31* 31 *
32* 32 *
33*****************************************************************************/ 33 *****************************************************************************/
34 34
35const char *progname = "check_ups"; 35const char *progname = "check_ups";
36const char *copyright = "2000-2007"; 36const char *copyright = "2000-2023";
37const char *email = "devel@monitoring-plugins.org"; 37const char *email = "devel@monitoring-plugins.org";
38 38
39#include "common.h" 39#include "common.h"
40#include "netutils.h" 40#include "netutils.h"
41#include "utils.h" 41#include "utils.h"
42 42
43enum { 43enum { PORT = 3493 };
44 PORT = 3493 44
45}; 45#define UPS_NONE 0 /* no supported options */
46 46#define UPS_UTILITY 1 /* supports utility line */
47#define CHECK_NONE 0 47#define UPS_BATTPCT 2 /* supports percent battery remaining */
48 48#define UPS_STATUS 4 /* supports UPS status */
49#define UPS_NONE 0 /* no supported options */ 49#define UPS_TEMP 8 /* supports UPS temperature */
50#define UPS_UTILITY 1 /* supports utility line voltage */ 50#define UPS_LOADPCT 16 /* supports load percent */
51#define UPS_BATTPCT 2 /* supports percent battery remaining */ 51#define UPS_REALPOWER 32 /* supports real power */
52#define UPS_STATUS 4 /* supports UPS status */ 52
53#define UPS_TEMP 8 /* supports UPS temperature */ 53#define UPSSTATUS_NONE 0
54#define UPS_LOADPCT 16 /* supports load percent */ 54#define UPSSTATUS_OFF 1
55 55#define UPSSTATUS_OL 2
56#define UPSSTATUS_NONE 0 56#define UPSSTATUS_OB 4
57#define UPSSTATUS_OFF 1 57#define UPSSTATUS_LB 8
58#define UPSSTATUS_OL 2 58#define UPSSTATUS_CAL 16
59#define UPSSTATUS_OB 4 59#define UPSSTATUS_RB 32 /*Replace Battery */
60#define UPSSTATUS_LB 8 60#define UPSSTATUS_BYPASS 64
61#define UPSSTATUS_CAL 16 61#define UPSSTATUS_OVER 128
62#define UPSSTATUS_RB 32 /*Replace Battery */ 62#define UPSSTATUS_TRIM 256
63#define UPSSTATUS_BYPASS 64 63#define UPSSTATUS_BOOST 512
64#define UPSSTATUS_OVER 128
65#define UPSSTATUS_TRIM 256
66#define UPSSTATUS_BOOST 512
67#define UPSSTATUS_CHRG 1024 64#define UPSSTATUS_CHRG 1024
68#define UPSSTATUS_DISCHRG 2048 65#define UPSSTATUS_DISCHRG 2048
69#define UPSSTATUS_UNKNOWN 4096 66#define UPSSTATUS_UNKNOWN 4096
70 67#define UPSSTATUS_ALARM 8192
71enum { NOSUCHVAR = ERROR-1 }; 68
72 69enum { NOSUCHVAR = ERROR - 1 };
73int server_port = PORT; 70
74char *server_address; 71typedef struct ups_config {
75char *ups_name = NULL; 72 unsigned int server_port;
76double warning_value = 0.0; 73 char *server_address;
77double critical_value = 0.0; 74 char *ups_name;
78int check_warn = FALSE; 75 double warning_value;
79int check_crit = FALSE; 76 double critical_value;
80int check_variable = UPS_NONE; 77 bool check_warn;
81int supported_options = UPS_NONE; 78 bool check_crit;
82int status = UPSSTATUS_NONE; 79 int check_variable;
83 80 int status;
84double ups_utility_voltage = 0.0; 81 bool temp_output_c;
85double ups_battery_percent = 0.0; 82} ups_config;
86double ups_load_percent = 0.0; 83
87double ups_temperature = 0.0; 84ups_config ups_config_init(void) {
88char *ups_status; 85 ups_config tmp = {0};
89int temp_output_c = 0; 86 tmp.server_port = PORT;
90 87 tmp.server_address = NULL;
91int determine_status (void); 88 tmp.ups_name = NULL;
92int get_ups_variable (const char *, char *); 89 tmp.check_variable = UPS_NONE;
93 90 tmp.status = UPSSTATUS_NONE;
94int process_arguments (int, char **); 91
95int validate_arguments (void); 92 return tmp;
96void print_help (void); 93}
97void print_usage (void); 94
98 95// Forward declarations
99int 96int determine_status(ups_config *, int *supported_options);
100main (int argc, char **argv) 97int get_ups_variable(const char *, char *, const ups_config config);
101{ 98
102 int result = STATE_UNKNOWN; 99int process_arguments(int, char **, ups_config *);
103 char *message; 100int validate_arguments(ups_config);
101void print_help(void);
102void print_usage(void);
103
104int main(int argc, char **argv) {
105 setlocale(LC_ALL, "");
106 bindtextdomain(PACKAGE, LOCALEDIR);
107 textdomain(PACKAGE);
108
109 char *ups_status;
110 ups_status = strdup("N/A");
111
104 char *data; 112 char *data;
105 char *tunits; 113 data = strdup("");
106 char temp_buffer[MAX_INPUT_BUFFER];
107 double ups_utility_deviation = 0.0;
108 int res;
109 114
110 setlocale (LC_ALL, ""); 115 char *message;
111 bindtextdomain (PACKAGE, LOCALEDIR); 116 message = strdup("");
112 textdomain (PACKAGE);
113 117
114 ups_status = strdup ("N/A"); 118 // Exit result
115 data = strdup (""); 119 int result = STATE_UNKNOWN;
116 message = strdup ("");
117 120
118 /* Parse extra opts if any */ 121 /* Parse extra opts if any */
119 argv=np_extra_opts (&argc, argv, progname); 122 argv = np_extra_opts(&argc, argv, progname);
120 123
121 if (process_arguments (argc, argv) == ERROR) 124 // Config from commandline
122 usage4 (_("Could not parse arguments")); 125 ups_config config = ups_config_init();
126
127 if (process_arguments(argc, argv, &config) == ERROR) {
128 usage4(_("Could not parse arguments"));
129 }
123 130
124 /* initialize alarm signal handling */ 131 /* initialize alarm signal handling */
125 signal (SIGALRM, socket_timeout_alarm_handler); 132 signal(SIGALRM, socket_timeout_alarm_handler);
126 133
127 /* set socket timeout */ 134 /* set socket timeout */
128 alarm (socket_timeout); 135 alarm(socket_timeout);
136
137 int supported_options = UPS_NONE;
129 138
130 /* get the ups status if possible */ 139 /* get the ups status if possible */
131 if (determine_status () != OK) 140 if (determine_status(&config, &supported_options) != OK) {
132 return STATE_CRITICAL; 141 return STATE_CRITICAL;
142 }
143
144
133 if (supported_options & UPS_STATUS) { 145 if (supported_options & UPS_STATUS) {
134 146
135 ups_status = strdup (""); 147 ups_status = strdup("");
148
136 result = STATE_OK; 149 result = STATE_OK;
137 150
138 if (status & UPSSTATUS_OFF) { 151 if (config.status & UPSSTATUS_OFF) {
139 xasprintf (&ups_status, "Off"); 152 xasprintf(&ups_status, "Off");
140 result = STATE_CRITICAL; 153 result = STATE_CRITICAL;
141 } 154 } else if ((config.status & (UPSSTATUS_OB | UPSSTATUS_LB)) ==
142 else if ((status & (UPSSTATUS_OB | UPSSTATUS_LB)) == 155 (UPSSTATUS_OB | UPSSTATUS_LB)) {
143 (UPSSTATUS_OB | UPSSTATUS_LB)) { 156 xasprintf(&ups_status, _("On Battery, Low Battery"));
144 xasprintf (&ups_status, _("On Battery, Low Battery"));
145 result = STATE_CRITICAL; 157 result = STATE_CRITICAL;
146 } 158 } else {
147 else { 159 if (config.status & UPSSTATUS_OL) {
148 if (status & UPSSTATUS_OL) { 160 xasprintf(&ups_status, "%s%s", ups_status, _("Online"));
149 xasprintf (&ups_status, "%s%s", ups_status, _("Online"));
150 } 161 }
151 if (status & UPSSTATUS_OB) { 162 if (config.status & UPSSTATUS_OB) {
152 xasprintf (&ups_status, "%s%s", ups_status, _("On Battery")); 163 xasprintf(&ups_status, "%s%s", ups_status, _("On Battery"));
153 result = STATE_WARNING; 164 result = max_state(result, STATE_WARNING);
154 } 165 }
155 if (status & UPSSTATUS_LB) { 166 if (config.status & UPSSTATUS_LB) {
156 xasprintf (&ups_status, "%s%s", ups_status, _(", Low Battery")); 167 xasprintf(&ups_status, "%s%s", ups_status, _(", Low Battery"));
157 result = STATE_WARNING; 168 result = max_state(result, STATE_WARNING);
158 } 169 }
159 if (status & UPSSTATUS_CAL) { 170 if (config.status & UPSSTATUS_CAL) {
160 xasprintf (&ups_status, "%s%s", ups_status, _(", Calibrating")); 171 xasprintf(&ups_status, "%s%s", ups_status, _(", Calibrating"));
161 } 172 }
162 if (status & UPSSTATUS_RB) { 173 if (config.status & UPSSTATUS_RB) {
163 xasprintf (&ups_status, "%s%s", ups_status, _(", Replace Battery")); 174 xasprintf(&ups_status, "%s%s", ups_status,
164 result = STATE_WARNING; 175 _(", Replace Battery"));
176 result = max_state(result, STATE_WARNING);
165 } 177 }
166 if (status & UPSSTATUS_BYPASS) { 178 if (config.status & UPSSTATUS_BYPASS) {
167 xasprintf (&ups_status, "%s%s", ups_status, _(", On Bypass")); 179 xasprintf(&ups_status, "%s%s", ups_status, _(", On Bypass"));
180 // Bypassing the battery is likely a bad thing
181 result = STATE_CRITICAL;
182 }
183 if (config.status & UPSSTATUS_OVER) {
184 xasprintf(&ups_status, "%s%s", ups_status, _(", Overload"));
185 result = max_state(result, STATE_WARNING);
168 } 186 }
169 if (status & UPSSTATUS_OVER) { 187 if (config.status & UPSSTATUS_TRIM) {
170 xasprintf (&ups_status, "%s%s", ups_status, _(", Overload")); 188 xasprintf(&ups_status, "%s%s", ups_status, _(", Trimming"));
171 } 189 }
172 if (status & UPSSTATUS_TRIM) { 190 if (config.status & UPSSTATUS_BOOST) {
173 xasprintf (&ups_status, "%s%s", ups_status, _(", Trimming")); 191 xasprintf(&ups_status, "%s%s", ups_status, _(", Boosting"));
174 } 192 }
175 if (status & UPSSTATUS_BOOST) { 193 if (config.status & UPSSTATUS_CHRG) {
176 xasprintf (&ups_status, "%s%s", ups_status, _(", Boosting")); 194 xasprintf(&ups_status, "%s%s", ups_status, _(", Charging"));
177 } 195 }
178 if (status & UPSSTATUS_CHRG) { 196 if (config.status & UPSSTATUS_DISCHRG) {
179 xasprintf (&ups_status, "%s%s", ups_status, _(", Charging")); 197 xasprintf(&ups_status, "%s%s", ups_status, _(", Discharging"));
198 result = max_state(result, STATE_WARNING);
180 } 199 }
181 if (status & UPSSTATUS_DISCHRG) { 200 if (config.status & UPSSTATUS_ALARM) {
182 xasprintf (&ups_status, "%s%s", ups_status, _(", Discharging")); 201 xasprintf(&ups_status, "%s%s", ups_status, _(", ALARM"));
202 result = STATE_CRITICAL;
183 } 203 }
184 if (status & UPSSTATUS_UNKNOWN) { 204 if (config.status & UPSSTATUS_UNKNOWN) {
185 xasprintf (&ups_status, "%s%s", ups_status, _(", Unknown")); 205 xasprintf(&ups_status, "%s%s", ups_status, _(", Unknown"));
186 } 206 }
187 } 207 }
188 xasprintf (&message, "%sStatus=%s ", message, ups_status); 208 xasprintf(&message, "%sStatus=%s ", message, ups_status);
189 } 209 }
190 210
211 int res;
212 char temp_buffer[MAX_INPUT_BUFFER];
213
191 /* get the ups utility voltage if possible */ 214 /* get the ups utility voltage if possible */
192 res=get_ups_variable ("input.voltage", temp_buffer); 215 res = get_ups_variable("input.voltage", temp_buffer, config);
193 if (res == NOSUCHVAR) supported_options &= ~UPS_UTILITY; 216 if (res == NOSUCHVAR) {
194 else if (res != OK) 217 supported_options &= ~UPS_UTILITY;
218 } else if (res != OK) {
195 return STATE_CRITICAL; 219 return STATE_CRITICAL;
196 else { 220 } else {
197 supported_options |= UPS_UTILITY; 221 supported_options |= UPS_UTILITY;
198 222
199 ups_utility_voltage = atof (temp_buffer); 223 double ups_utility_voltage = 0.0;
200 xasprintf (&message, "%sUtility=%3.1fV ", message, ups_utility_voltage); 224 ups_utility_voltage = atof(temp_buffer);
225 xasprintf(&message, "%sUtility=%3.1fV ", message, ups_utility_voltage);
226
227 double ups_utility_deviation = 0.0;
201 228
202 if (ups_utility_voltage > 120.0) 229 if (ups_utility_voltage > 120.0) {
203 ups_utility_deviation = 120.0 - ups_utility_voltage; 230 ups_utility_deviation = 120.0 - ups_utility_voltage;
204 else 231 } else {
205 ups_utility_deviation = ups_utility_voltage - 120.0; 232 ups_utility_deviation = ups_utility_voltage - 120.0;
233 }
206 234
207 if (check_variable == UPS_UTILITY) { 235 if (config.check_variable == UPS_UTILITY) {
208 if (check_crit==TRUE && ups_utility_deviation>=critical_value) { 236 if (config.check_crit &&
237 ups_utility_deviation >= config.critical_value) {
209 result = STATE_CRITICAL; 238 result = STATE_CRITICAL;
239 } else if (config.check_warn &&
240 ups_utility_deviation >= config.warning_value) {
241 result = max_state(result, STATE_WARNING);
210 } 242 }
211 else if (check_warn==TRUE && ups_utility_deviation>=warning_value) { 243 xasprintf(&data, "%s",
212 result = max_state (result, STATE_WARNING); 244 perfdata("voltage", (long)(1000 * ups_utility_voltage),
213 } 245 "mV", config.check_warn,
214 xasprintf (&data, "%s", 246 (long)(1000 * config.warning_value),
215 perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV", 247 config.check_crit,
216 check_warn, (long)(1000*warning_value), 248 (long)(1000 * config.critical_value), true, 0,
217 check_crit, (long)(1000*critical_value), 249 false, 0));
218 TRUE, 0, FALSE, 0));
219 } else { 250 } else {
220 xasprintf (&data, "%s", 251 xasprintf(&data, "%s",
221 perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV", 252 perfdata("voltage", (long)(1000 * ups_utility_voltage),
222 FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0)); 253 "mV", false, 0, false, 0, true, 0, false, 0));
223 } 254 }
224 } 255 }
225 256
226 /* get the ups battery percent if possible */ 257 /* get the ups battery percent if possible */
227 res=get_ups_variable ("battery.charge", temp_buffer); 258 res = get_ups_variable("battery.charge", temp_buffer, config);
228 if (res == NOSUCHVAR) supported_options &= ~UPS_BATTPCT; 259 if (res == NOSUCHVAR) {
229 else if ( res != OK) 260 supported_options &= ~UPS_BATTPCT;
261 } else if (res != OK) {
230 return STATE_CRITICAL; 262 return STATE_CRITICAL;
231 else { 263 } else {
232 supported_options |= UPS_BATTPCT; 264 supported_options |= UPS_BATTPCT;
233 ups_battery_percent = atof (temp_buffer);
234 xasprintf (&message, "%sBatt=%3.1f%% ", message, ups_battery_percent);
235 265
236 if (check_variable == UPS_BATTPCT) { 266 double ups_battery_percent = 0.0;
237 if (check_crit==TRUE && ups_battery_percent <= critical_value) { 267 ups_battery_percent = atof(temp_buffer);
268 xasprintf(&message, "%sBatt=%3.1f%% ", message, ups_battery_percent);
269
270 if (config.check_variable == UPS_BATTPCT) {
271 if (config.check_crit &&
272 ups_battery_percent <= config.critical_value) {
238 result = STATE_CRITICAL; 273 result = STATE_CRITICAL;
274 } else if (config.check_warn &&
275 ups_battery_percent <= config.warning_value) {
276 result = max_state(result, STATE_WARNING);
239 } 277 }
240 else if (check_warn==TRUE && ups_battery_percent<=warning_value) { 278 xasprintf(&data, "%s %s", data,
241 result = max_state (result, STATE_WARNING); 279 perfdata("battery", (long)ups_battery_percent, "%",
242 } 280 config.check_warn, (long)(config.warning_value),
243 xasprintf (&data, "%s %s", data, 281 config.check_crit, (long)(config.critical_value),
244 perfdata ("battery", (long)ups_battery_percent, "%", 282 true, 0, true, 100));
245 check_warn, (long)(warning_value),
246 check_crit, (long)(critical_value),
247 TRUE, 0, TRUE, 100));
248 } else { 283 } else {
249 xasprintf (&data, "%s %s", data, 284 xasprintf(&data, "%s %s", data,
250 perfdata ("battery", (long)ups_battery_percent, "%", 285 perfdata("battery", (long)ups_battery_percent, "%", false,
251 FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100)); 286 0, false, 0, true, 0, true, 100));
252 } 287 }
253 } 288 }
254 289
255 /* get the ups load percent if possible */ 290 /* get the ups load percent if possible */
256 res=get_ups_variable ("ups.load", temp_buffer); 291 res = get_ups_variable("ups.load", temp_buffer, config);
257 if ( res == NOSUCHVAR ) supported_options &= ~UPS_LOADPCT; 292 if (res == NOSUCHVAR) {
258 else if ( res != OK) 293 supported_options &= ~UPS_LOADPCT;
294 } else if (res != OK) {
259 return STATE_CRITICAL; 295 return STATE_CRITICAL;
260 else { 296 } else {
261 supported_options |= UPS_LOADPCT; 297 supported_options |= UPS_LOADPCT;
262 ups_load_percent = atof (temp_buffer);
263 xasprintf (&message, "%sLoad=%3.1f%% ", message, ups_load_percent);
264 298
265 if (check_variable == UPS_LOADPCT) { 299 double ups_load_percent = 0.0;
266 if (check_crit==TRUE && ups_load_percent>=critical_value) { 300 ups_load_percent = atof(temp_buffer);
301 xasprintf(&message, "%sLoad=%3.1f%% ", message, ups_load_percent);
302
303 if (config.check_variable == UPS_LOADPCT) {
304 if (config.check_crit &&
305 ups_load_percent >= config.critical_value) {
267 result = STATE_CRITICAL; 306 result = STATE_CRITICAL;
307 } else if (config.check_warn &&
308 ups_load_percent >= config.warning_value) {
309 result = max_state(result, STATE_WARNING);
268 } 310 }
269 else if (check_warn==TRUE && ups_load_percent>=warning_value) { 311 xasprintf(&data, "%s %s", data,
270 result = max_state (result, STATE_WARNING); 312 perfdata("load", (long)ups_load_percent, "%",
271 } 313 config.check_warn, (long)(config.warning_value),
272 xasprintf (&data, "%s %s", data, 314 config.check_crit, (long)(config.critical_value),
273 perfdata ("load", (long)ups_load_percent, "%", 315 true, 0, true, 100));
274 check_warn, (long)(warning_value),
275 check_crit, (long)(critical_value),
276 TRUE, 0, TRUE, 100));
277 } else { 316 } else {
278 xasprintf (&data, "%s %s", data, 317 xasprintf(&data, "%s %s", data,
279 perfdata ("load", (long)ups_load_percent, "%", 318 perfdata("load", (long)ups_load_percent, "%", false, 0,
280 FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100)); 319 false, 0, true, 0, true, 100));
281 } 320 }
282 } 321 }
283 322
284 /* get the ups temperature if possible */ 323 /* get the ups temperature if possible */
285 res=get_ups_variable ("ups.temperature", temp_buffer); 324 res = get_ups_variable("ups.temperature", temp_buffer, config);
286 if ( res == NOSUCHVAR ) supported_options &= ~UPS_TEMP; 325 if (res == NOSUCHVAR) {
287 else if ( res != OK) 326 supported_options &= ~UPS_TEMP;
327 } else if (res != OK) {
288 return STATE_CRITICAL; 328 return STATE_CRITICAL;
289 else { 329 } else {
290 supported_options |= UPS_TEMP; 330 supported_options |= UPS_TEMP;
291 if (temp_output_c) { 331
292 tunits="degC"; 332 double ups_temperature = 0.0;
293 ups_temperature = atof (temp_buffer); 333 char *tunits;
294 xasprintf (&message, "%sTemp=%3.1fC", message, ups_temperature); 334
295 } 335 if (config.temp_output_c) {
296 else { 336 tunits = "degC";
297 tunits="degF"; 337 ups_temperature = atof(temp_buffer);
298 ups_temperature = (atof (temp_buffer) * 1.8) + 32; 338 xasprintf(&message, "%sTemp=%3.1fC", message, ups_temperature);
299 xasprintf (&message, "%sTemp=%3.1fF", message, ups_temperature); 339 } else {
340 tunits = "degF";
341 ups_temperature = (atof(temp_buffer) * 1.8) + 32;
342 xasprintf(&message, "%sTemp=%3.1fF", message, ups_temperature);
300 } 343 }
301 344
302 if (check_variable == UPS_TEMP) { 345 if (config.check_variable == UPS_TEMP) {
303 if (check_crit==TRUE && ups_temperature>=critical_value) { 346 if (config.check_crit && ups_temperature >= config.critical_value) {
304 result = STATE_CRITICAL; 347 result = STATE_CRITICAL;
348 } else if (config.check_warn &&
349 ups_temperature >= config.warning_value) {
350 result = max_state(result, STATE_WARNING);
305 } 351 }
306 else if (check_warn == TRUE && ups_temperature>=warning_value) { 352 xasprintf(&data, "%s %s", data,
307 result = max_state (result, STATE_WARNING); 353 perfdata("temp", (long)ups_temperature, tunits,
354 config.check_warn, (long)(config.warning_value),
355 config.check_crit, (long)(config.critical_value),
356 true, 0, false, 0));
357 } else {
358 xasprintf(&data, "%s %s", data,
359 perfdata("temp", (long)ups_temperature, tunits, false, 0,
360 false, 0, true, 0, false, 0));
361 }
362 }
363
364 /* get the ups real power if possible */
365 res = get_ups_variable("ups.realpower", temp_buffer, config);
366 if (res == NOSUCHVAR) {
367 supported_options &= ~UPS_REALPOWER;
368 } else if (res != OK) {
369 return STATE_CRITICAL;
370 } else {
371 supported_options |= UPS_REALPOWER;
372 double ups_realpower = 0.0;
373 ups_realpower = atof(temp_buffer);
374 xasprintf(&message, "%sReal power=%3.1fW ", message, ups_realpower);
375
376 if (config.check_variable == UPS_REALPOWER) {
377 if (config.check_crit && ups_realpower >= config.critical_value) {
378 result = STATE_CRITICAL;
379 } else if (config.check_warn &&
380 ups_realpower >= config.warning_value) {
381 result = max_state(result, STATE_WARNING);
308 } 382 }
309 xasprintf (&data, "%s %s", data, 383 xasprintf(&data, "%s %s", data,
310 perfdata ("temp", (long)ups_temperature, tunits, 384 perfdata("realpower", (long)ups_realpower, "W",
311 check_warn, (long)(warning_value), 385 config.check_warn, (long)(config.warning_value),
312 check_crit, (long)(critical_value), 386 config.check_crit, (long)(config.critical_value),
313 TRUE, 0, FALSE, 0)); 387 true, 0, false, 0));
314 } else { 388 } else {
315 xasprintf (&data, "%s %s", data, 389 xasprintf(&data, "%s %s", data,
316 perfdata ("temp", (long)ups_temperature, tunits, 390 perfdata("realpower", (long)ups_realpower, "W", false, 0,
317 FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0)); 391 false, 0, true, 0, false, 0));
318 } 392 }
319 } 393 }
320 394
321 /* if the UPS does not support any options we are looking for, report an error */ 395 /* if the UPS does not support any options we are looking for, report an
396 * error */
322 if (supported_options == UPS_NONE) { 397 if (supported_options == UPS_NONE) {
323 result = STATE_CRITICAL; 398 result = STATE_CRITICAL;
324 xasprintf (&message, _("UPS does not support any available options\n")); 399 xasprintf(&message, _("UPS does not support any available options\n"));
325 } 400 }
326 401
327 /* reset timeout */ 402 /* reset timeout */
328 alarm (0); 403 alarm(0);
329 404
330 printf ("UPS %s - %s|%s\n", state_text(result), message, data); 405 printf("UPS %s - %s|%s\n", state_text(result), message, data);
331 return result; 406 return result;
332} 407}
333 408
334
335
336/* determines what options are supported by the UPS */ 409/* determines what options are supported by the UPS */
337int 410int determine_status(ups_config *config, int *supported_options) {
338determine_status (void)
339{
340 char recv_buffer[MAX_INPUT_BUFFER]; 411 char recv_buffer[MAX_INPUT_BUFFER];
341 char temp_buffer[MAX_INPUT_BUFFER];
342 char *ptr;
343 int res;
344 412
345 res=get_ups_variable ("ups.status", recv_buffer); 413 int res = get_ups_variable("ups.status", recv_buffer, *config);
346 if (res == NOSUCHVAR) return OK; 414 if (res == NOSUCHVAR) {
415 return OK;
416 }
417
347 if (res != STATE_OK) { 418 if (res != STATE_OK) {
348 printf ("%s\n", _("Invalid response received from host")); 419 printf("%s\n", _("Invalid response received from host"));
349 return ERROR; 420 return ERROR;
350 } 421 }
351 422
352 supported_options |= UPS_STATUS; 423 *supported_options |= UPS_STATUS;
353 424
354 strcpy (temp_buffer, recv_buffer); 425 char temp_buffer[MAX_INPUT_BUFFER];
355 for (ptr = (char *) strtok (temp_buffer, " "); ptr != NULL; 426
356 ptr = (char *) strtok (NULL, " ")) { 427 strcpy(temp_buffer, recv_buffer);
357 if (!strcmp (ptr, "OFF")) 428 for (char *ptr = (char *)strtok(temp_buffer, " "); ptr != NULL;
358 status |= UPSSTATUS_OFF; 429 ptr = (char *)strtok(NULL, " ")) {
359 else if (!strcmp (ptr, "OL")) 430 if (!strcmp(ptr, "OFF")) {
360 status |= UPSSTATUS_OL; 431 config->status |= UPSSTATUS_OFF;
361 else if (!strcmp (ptr, "OB")) 432 } else if (!strcmp(ptr, "OL")) {
362 status |= UPSSTATUS_OB; 433 config->status |= UPSSTATUS_OL;
363 else if (!strcmp (ptr, "LB")) 434 } else if (!strcmp(ptr, "OB")) {
364 status |= UPSSTATUS_LB; 435 config->status |= UPSSTATUS_OB;
365 else if (!strcmp (ptr, "CAL")) 436 } else if (!strcmp(ptr, "LB")) {
366 status |= UPSSTATUS_CAL; 437 config->status |= UPSSTATUS_LB;
367 else if (!strcmp (ptr, "RB")) 438 } else if (!strcmp(ptr, "CAL")) {
368 status |= UPSSTATUS_RB; 439 config->status |= UPSSTATUS_CAL;
369 else if (!strcmp (ptr, "BYPASS")) 440 } else if (!strcmp(ptr, "RB")) {
370 status |= UPSSTATUS_BYPASS; 441 config->status |= UPSSTATUS_RB;
371 else if (!strcmp (ptr, "OVER")) 442 } else if (!strcmp(ptr, "BYPASS")) {
372 status |= UPSSTATUS_OVER; 443 config->status |= UPSSTATUS_BYPASS;
373 else if (!strcmp (ptr, "TRIM")) 444 } else if (!strcmp(ptr, "OVER")) {
374 status |= UPSSTATUS_TRIM; 445 config->status |= UPSSTATUS_OVER;
375 else if (!strcmp (ptr, "BOOST")) 446 } else if (!strcmp(ptr, "TRIM")) {
376 status |= UPSSTATUS_BOOST; 447 config->status |= UPSSTATUS_TRIM;
377 else if (!strcmp (ptr, "CHRG")) 448 } else if (!strcmp(ptr, "BOOST")) {
378 status |= UPSSTATUS_CHRG; 449 config->status |= UPSSTATUS_BOOST;
379 else if (!strcmp (ptr, "DISCHRG")) 450 } else if (!strcmp(ptr, "CHRG")) {
380 status |= UPSSTATUS_DISCHRG; 451 config->status |= UPSSTATUS_CHRG;
381 else 452 } else if (!strcmp(ptr, "DISCHRG")) {
382 status |= UPSSTATUS_UNKNOWN; 453 config->status |= UPSSTATUS_DISCHRG;
454 } else if (!strcmp(ptr, "ALARM")) {
455 config->status |= UPSSTATUS_ALARM;
456 } else {
457 config->status |= UPSSTATUS_UNKNOWN;
458 }
383 } 459 }
384 460
385 return OK; 461 return OK;
386} 462}
387 463
388
389/* gets a variable value for a specific UPS */ 464/* gets a variable value for a specific UPS */
390int 465int get_ups_variable(const char *varname, char *buf, const ups_config config) {
391get_ups_variable (const char *varname, char *buf)
392{
393 /* char command[MAX_INPUT_BUFFER]; */
394 char temp_buffer[MAX_INPUT_BUFFER];
395 char send_buffer[MAX_INPUT_BUFFER]; 466 char send_buffer[MAX_INPUT_BUFFER];
396 char *ptr;
397 char *logout = "OK Goodbye\n";
398 int logout_len = strlen(logout);
399 int len;
400
401 *buf=0;
402 467
403 /* create the command string to send to the UPS daemon */ 468 /* create the command string to send to the UPS daemon */
404 /* Add LOGOUT to avoid read failure logs */ 469 /* Add LOGOUT to avoid read failure logs */
405 if (snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname) >= sizeof(send_buffer)) { 470 int res = snprintf(send_buffer, sizeof(send_buffer),
471 "GET VAR %s %s\nLOGOUT\n", config.ups_name, varname);
472 if ((res > 0) && ((size_t)res >= sizeof(send_buffer))) {
406 printf("%s\n", _("UPS name to long for buffer")); 473 printf("%s\n", _("UPS name to long for buffer"));
407 return ERROR; 474 return ERROR;
408 } 475 }
409 476
477 char temp_buffer[MAX_INPUT_BUFFER];
478
410 /* send the command to the daemon and get a response back */ 479 /* send the command to the daemon and get a response back */
411 if (process_tcp_request 480 if (process_tcp_request(config.server_address, config.server_port,
412 (server_address, server_port, send_buffer, temp_buffer, 481 send_buffer, temp_buffer,
413 sizeof (temp_buffer)) != STATE_OK) { 482 sizeof(temp_buffer)) != STATE_OK) {
414 printf ("%s\n", _("Invalid response received from host")); 483 printf("%s\n", _("Invalid response received from host"));
415 return ERROR; 484 return ERROR;
416 } 485 }
417 486
418 ptr = temp_buffer; 487 char *ptr = temp_buffer;
419 len = strlen(ptr); 488 int len = strlen(ptr);
420 if (len > logout_len && strcmp (ptr + len - logout_len, logout) == 0) len -= logout_len; 489 const char *logout = "OK Goodbye\n";
421 if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0; 490 const int logout_len = strlen(logout);
422 if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) { 491
423 printf (_("CRITICAL - no such UPS '%s' on that host\n"), ups_name); 492 if (len > logout_len && strcmp(ptr + len - logout_len, logout) == 0) {
493 len -= logout_len;
494 }
495 if (len > 0 && ptr[len - 1] == '\n') {
496 ptr[len - 1] = 0;
497 }
498 if (strcmp(ptr, "ERR UNKNOWN-UPS") == 0) {
499 printf(_("CRITICAL - no such UPS '%s' on that host\n"),
500 config.ups_name);
424 return ERROR; 501 return ERROR;
425 } 502 }
426 503
427 if (strcmp (ptr, "ERR VAR-NOT-SUPPORTED") == 0) { 504 if (strcmp(ptr, "ERR VAR-NOT-SUPPORTED") == 0) {
428 /*printf ("Error: Variable '%s' is not supported\n", varname);*/ 505 /*printf ("Error: Variable '%s' is not supported\n", varname);*/
429 return NOSUCHVAR; 506 return NOSUCHVAR;
430 } 507 }
431 508
432 if (strcmp (ptr, "ERR DATA-STALE") == 0) { 509 if (strcmp(ptr, "ERR DATA-STALE") == 0) {
433 printf ("%s\n", _("CRITICAL - UPS data is stale")); 510 printf("%s\n", _("CRITICAL - UPS data is stale"));
434 return ERROR; 511 return ERROR;
435 } 512 }
436 513
437 if (strncmp (ptr, "ERR", 3) == 0) { 514 if (strncmp(ptr, "ERR", 3) == 0) {
438 printf (_("Unknown error: %s\n"), ptr); 515 printf(_("Unknown error: %s\n"), ptr);
439 return ERROR; 516 return ERROR;
440 } 517 }
441 518
442 ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6; 519 ptr = temp_buffer + strlen(varname) + strlen(config.ups_name) + 6;
443 len = strlen(ptr); 520 len = strlen(ptr);
444 if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') { 521 if (len < 2 || ptr[0] != '"' || ptr[len - 1] != '"') {
445 printf ("%s\n", _("Error: unable to parse variable")); 522 printf("%s\n", _("Error: unable to parse variable"));
446 return ERROR; 523 return ERROR;
447 } 524 }
448 strncpy (buf, ptr+1, len - 2); 525
526 *buf = 0;
527 strncpy(buf, ptr + 1, len - 2);
449 buf[len - 2] = 0; 528 buf[len - 2] = 0;
450 529
451 return OK; 530 return OK;
452} 531}
453 532
454
455/* Command line: CHECK_UPS -H <host_address> -u ups [-p port] [-v variable] 533/* Command line: CHECK_UPS -H <host_address> -u ups [-p port] [-v variable]
456 [-wv warn_value] [-cv crit_value] [-to to_sec] */ 534 [-wv warn_value] [-cv crit_value] [-to to_sec] */
457 535
458
459/* process command-line arguments */ 536/* process command-line arguments */
460int 537int process_arguments(int argc, char **argv, ups_config *config) {
461process_arguments (int argc, char **argv) 538
462{ 539 static struct option longopts[] = {{"hostname", required_argument, 0, 'H'},
463 int c; 540 {"ups", required_argument, 0, 'u'},
464 541 {"port", required_argument, 0, 'p'},
465 int option = 0; 542 {"critical", required_argument, 0, 'c'},
466 static struct option longopts[] = { 543 {"warning", required_argument, 0, 'w'},
467 {"hostname", required_argument, 0, 'H'}, 544 {"timeout", required_argument, 0, 't'},
468 {"ups", required_argument, 0, 'u'}, 545 {"temperature", no_argument, 0, 'T'},
469 {"port", required_argument, 0, 'p'}, 546 {"variable", required_argument, 0, 'v'},
470 {"critical", required_argument, 0, 'c'}, 547 {"version", no_argument, 0, 'V'},
471 {"warning", required_argument, 0, 'w'}, 548 {"help", no_argument, 0, 'h'},
472 {"timeout", required_argument, 0, 't'}, 549 {0, 0, 0, 0}};
473 {"temperature", no_argument, 0, 'T'}, 550
474 {"variable", required_argument, 0, 'v'}, 551 if (argc < 2) {
475 {"version", no_argument, 0, 'V'},
476 {"help", no_argument, 0, 'h'},
477 {0, 0, 0, 0}
478 };
479
480 if (argc < 2)
481 return ERROR; 552 return ERROR;
553 }
482 554
555 int c;
483 for (c = 1; c < argc; c++) { 556 for (c = 1; c < argc; c++) {
484 if (strcmp ("-to", argv[c]) == 0) 557 if (strcmp("-to", argv[c]) == 0) {
485 strcpy (argv[c], "-t"); 558 strcpy(argv[c], "-t");
486 else if (strcmp ("-wt", argv[c]) == 0) 559 } else if (strcmp("-wt", argv[c]) == 0) {
487 strcpy (argv[c], "-w"); 560 strcpy(argv[c], "-w");
488 else if (strcmp ("-ct", argv[c]) == 0) 561 } else if (strcmp("-ct", argv[c]) == 0) {
489 strcpy (argv[c], "-c"); 562 strcpy(argv[c], "-c");
563 }
490 } 564 }
491 565
566 int option = 0;
492 while (1) { 567 while (1) {
493 c = getopt_long (argc, argv, "hVTH:u:p:v:c:w:t:", longopts, 568 c = getopt_long(argc, argv, "hVTH:u:p:v:c:w:t:", longopts, &option);
494 &option);
495 569
496 if (c == -1 || c == EOF) 570 if (c == -1 || c == EOF) {
497 break; 571 break;
572 }
498 573
499 switch (c) { 574 switch (c) {
500 case '?': /* help */ 575 case '?': /* help */
501 usage5 (); 576 usage5();
502 case 'H': /* hostname */ 577 case 'H': /* hostname */
503 if (is_host (optarg)) { 578 if (is_host(optarg)) {
504 server_address = optarg; 579 config->server_address = optarg;
505 } 580 } else {
506 else { 581 usage2(_("Invalid hostname/address"), optarg);
507 usage2 (_("Invalid hostname/address"), optarg);
508 } 582 }
509 break; 583 break;
510 case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for Fahrenheit) */ 584 case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for
511 temp_output_c = 1; 585 Fahrenheit) */
586 config->temp_output_c = true;
512 break; 587 break;
513 case 'u': /* ups name */ 588 case 'u': /* ups name */
514 ups_name = optarg; 589 config->ups_name = optarg;
515 break; 590 break;
516 case 'p': /* port */ 591 case 'p': /* port */
517 if (is_intpos (optarg)) { 592 if (is_intpos(optarg)) {
518 server_port = atoi (optarg); 593 config->server_port = atoi(optarg);
519 } 594 } else {
520 else { 595 usage2(_("Port must be a positive integer"), optarg);
521 usage2 (_("Port must be a positive integer"), optarg);
522 } 596 }
523 break; 597 break;
524 case 'c': /* critical time threshold */ 598 case 'c': /* critical time threshold */
525 if (is_intnonneg (optarg)) { 599 if (is_intnonneg(optarg)) {
526 critical_value = atoi (optarg); 600 config->critical_value = atoi(optarg);
527 check_crit = TRUE; 601 config->check_crit = true;
528 } 602 } else {
529 else { 603 usage2(_("Critical time must be a positive integer"), optarg);
530 usage2 (_("Critical time must be a positive integer"), optarg);
531 } 604 }
532 break; 605 break;
533 case 'w': /* warning time threshold */ 606 case 'w': /* warning time threshold */
534 if (is_intnonneg (optarg)) { 607 if (is_intnonneg(optarg)) {
535 warning_value = atoi (optarg); 608 config->warning_value = atoi(optarg);
536 check_warn = TRUE; 609 config->check_warn = true;
537 } 610 } else {
538 else { 611 usage2(_("Warning time must be a positive integer"), optarg);
539 usage2 (_("Warning time must be a positive integer"), optarg);
540 } 612 }
541 break; 613 break;
542 case 'v': /* variable */ 614 case 'v': /* variable */
543 if (!strcmp (optarg, "LINE")) 615 if (!strcmp(optarg, "LINE")) {
544 check_variable = UPS_UTILITY; 616 config->check_variable = UPS_UTILITY;
545 else if (!strcmp (optarg, "TEMP")) 617 } else if (!strcmp(optarg, "TEMP")) {
546 check_variable = UPS_TEMP; 618 config->check_variable = UPS_TEMP;
547 else if (!strcmp (optarg, "BATTPCT")) 619 } else if (!strcmp(optarg, "BATTPCT")) {
548 check_variable = UPS_BATTPCT; 620 config->check_variable = UPS_BATTPCT;
549 else if (!strcmp (optarg, "LOADPCT")) 621 } else if (!strcmp(optarg, "LOADPCT")) {
550 check_variable = UPS_LOADPCT; 622 config->check_variable = UPS_LOADPCT;
551 else 623 } else if (!strcmp(optarg, "REALPOWER")) {
552 usage2 (_("Unrecognized UPS variable"), optarg); 624 config->check_variable = UPS_REALPOWER;
553 break; 625 } else {
554 case 't': /* timeout */ 626 usage2(_("Unrecognized UPS variable"), optarg);
555 if (is_intnonneg (optarg)) {
556 socket_timeout = atoi (optarg);
557 } 627 }
558 else { 628 break;
559 usage4 (_("Timeout interval must be a positive integer")); 629 case 't': /* timeout */
630 if (is_intnonneg(optarg)) {
631 socket_timeout = atoi(optarg);
632 } else {
633 usage4(_("Timeout interval must be a positive integer"));
560 } 634 }
561 break; 635 break;
562 case 'V': /* version */ 636 case 'V': /* version */
563 print_revision (progname, NP_VERSION); 637 print_revision(progname, NP_VERSION);
564 exit (STATE_UNKNOWN); 638 exit(STATE_UNKNOWN);
565 case 'h': /* help */ 639 case 'h': /* help */
566 print_help (); 640 print_help();
567 exit (STATE_UNKNOWN); 641 exit(STATE_UNKNOWN);
568 } 642 }
569 } 643 }
570 644
571 645 if (config->server_address == NULL && argc > optind) {
572 if (server_address == NULL && argc > optind) { 646 if (is_host(argv[optind])) {
573 if (is_host (argv[optind])) 647 config->server_address = argv[optind++];
574 server_address = argv[optind++]; 648 } else {
575 else 649 usage2(_("Invalid hostname/address"), optarg);
576 usage2 (_("Invalid hostname/address"), optarg); 650 }
577 } 651 }
578 652
579 if (server_address == NULL) 653 if (config->server_address == NULL) {
580 server_address = strdup("127.0.0.1"); 654 config->server_address = strdup("127.0.0.1");
655 }
581 656
582 return validate_arguments(); 657 return validate_arguments(*config);
583} 658}
584 659
585 660int validate_arguments(ups_config config) {
586int 661 if (!config.ups_name) {
587validate_arguments (void) 662 printf("%s\n", _("Error : no UPS indicated"));
588{
589 if (! ups_name) {
590 printf ("%s\n", _("Error : no UPS indicated"));
591 return ERROR; 663 return ERROR;
592 } 664 }
593 return OK; 665 return OK;
594} 666}
595 667
668void print_help(void) {
669 print_revision(progname, NP_VERSION);
596 670
597void 671 printf("Copyright (c) 2000 Tom Shields\n");
598print_help (void) 672 printf("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
599{ 673 printf("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
600 char *myport; 674 printf(COPYRIGHT, copyright, email);
601 xasprintf (&myport, "%d", PORT);
602
603 print_revision (progname, NP_VERSION);
604
605 printf ("Copyright (c) 2000 Tom Shields\n");
606 printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
607 printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
608 printf (COPYRIGHT, copyright, email);
609
610 printf ("%s\n", _("This plugin tests the UPS service on the specified host. Network UPS Tools"));
611 printf ("%s\n", _("from www.networkupstools.org must be running for this plugin to work."));
612
613 printf ("\n\n");
614
615 print_usage ();
616 675
617 printf (UT_HELP_VRSN); 676 printf("%s\n", _("This plugin tests the UPS service on the specified host. "
618 printf (UT_EXTRA_OPTS); 677 "Network UPS Tools"));
678 printf("%s\n", _("from www.networkupstools.org must be running for this "
679 "plugin to work."));
619 680
620 printf (UT_HOST_PORT, 'p', myport); 681 printf("\n\n");
621 682
622 printf (" %s\n", "-u, --ups=STRING"); 683 print_usage();
623 printf (" %s\n", _("Name of UPS"));
624 printf (" %s\n", "-T, --temperature");
625 printf (" %s\n", _("Output of temperatures in Celsius"));
626 printf (" %s\n", "-v, --variable=STRING");
627 printf (" %s %s\n", _("Valid values for STRING are"), "LINE, TEMP, BATTPCT or LOADPCT");
628 684
629 printf (UT_WARN_CRIT); 685 printf(UT_HELP_VRSN);
686 printf(UT_EXTRA_OPTS);
630 687
631 printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); 688 char *myport;
632 689 xasprintf(&myport, "%d", PORT);
633/* TODO: -v clashing with -v/-variable. Commenting out help text since verbose 690 printf(UT_HOST_PORT, 'p', myport);
634 is unused up to now */ 691
635/* printf (UT_VERBOSE); */ 692 printf(" %s\n", "-u, --ups=STRING");
636 693 printf(" %s\n", _("Name of UPS"));
637 printf ("\n"); 694 printf(" %s\n", "-T, --temperature");
638 printf ("%s\n", _("This plugin attempts to determine the status of a UPS (Uninterruptible Power")); 695 printf(" %s\n", _("Output of temperatures in Celsius"));
639 printf ("%s\n", _("Supply) on a local or remote host. If the UPS is online or calibrating, the")); 696 printf(" %s\n", "-v, --variable=STRING");
640 printf ("%s\n", _("plugin will return an OK state. If the battery is on it will return a WARNING")); 697 printf(" %s %s\n", _("Valid values for STRING are"),
641 printf ("%s\n", _("state. If the UPS is off or has a low battery the plugin will return a CRITICAL")); 698 "LINE, TEMP, BATTPCT, LOADPCT or REALPOWER");
642 printf ("%s\n", _("state.")); 699
643 700 printf(UT_WARN_CRIT);
644 printf ("\n"); 701
645 printf ("%s\n", _("Notes:")); 702 printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
646 printf (" %s\n", _("You may also specify a variable to check (such as temperature, utility voltage,")); 703
647 printf (" %s\n", _("battery load, etc.) as well as warning and critical thresholds for the value")); 704 /* TODO: -v clashing with -v/-variable. Commenting out help text since
648 printf (" %s\n", _("of that variable. If the remote host has multiple UPS that are being monitored")); 705 verbose is unused up to now */
649 printf (" %s\n", _("you will have to use the --ups option to specify which UPS to check.")); 706 /* printf (UT_VERBOSE); */
650 printf ("\n"); 707
651 printf (" %s\n", _("This plugin requires that the UPSD daemon distributed with Russell Kroll's")); 708 printf("\n");
652 printf (" %s\n", _("Network UPS Tools be installed on the remote host. If you do not have the")); 709 printf("%s\n", _("This plugin attempts to determine the status of a UPS "
653 printf (" %s\n", _("package installed on your system, you can download it from")); 710 "(Uninterruptible Power"));
654 printf (" %s\n", _("http://www.networkupstools.org")); 711 printf("%s\n", _("Supply) on a local or remote host. If the UPS is online "
655 712 "or calibrating, the"));
656 printf (UT_SUPPORT); 713 printf("%s\n", _("plugin will return an OK state. If the battery is on it "
714 "will return a WARNING"));
715 printf("%s\n", _("state. If the UPS is off or has a low battery the plugin "
716 "will return a CRITICAL"));
717 printf("%s\n", _("state."));
718
719 printf("\n");
720 printf("%s\n", _("Notes:"));
721 printf(" %s\n", _("You may also specify a variable to check (such as "
722 "temperature, utility voltage,"));
723 printf(" %s\n", _("battery load, etc.) as well as warning and critical "
724 "thresholds for the value"));
725 printf(" %s\n", _("of that variable. If the remote host has multiple UPS "
726 "that are being monitored"));
727 printf(" %s\n", _("you will have to use the --ups option to specify which "
728 "UPS to check."));
729 printf("\n");
730 printf(" %s\n", _("This plugin requires that the UPSD daemon distributed "
731 "with Russell Kroll's"));
732 printf(" %s\n", _("Network UPS Tools be installed on the remote host. If "
733 "you do not have the"));
734 printf(" %s\n",
735 _("package installed on your system, you can download it from"));
736 printf(" %s\n", _("http://www.networkupstools.org"));
737
738 printf(UT_SUPPORT);
657} 739}
658 740
659 741void print_usage(void) {
660void 742 printf("%s\n", _("Usage:"));
661print_usage (void) 743 printf("%s -H host -u ups [-p port] [-v variable] [-w warn_value] [-c "
662{ 744 "crit_value] [-to to_sec] [-T]\n",
663 printf ("%s\n", _("Usage:")); 745 progname);
664 printf ("%s -H host -u ups [-p port] [-v variable] [-w warn_value] [-c crit_value] [-to to_sec] [-T]\n", progname);
665} 746}
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 2a9ee98..89b9536 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -179,7 +179,7 @@ main (int argc, char **argv)
179 printf (_("USERS %s - %d users currently logged in |%s\n"), 179 printf (_("USERS %s - %d users currently logged in |%s\n"),
180 state_text(result), users, 180 state_text(result), users,
181 sperfdata_int("users", users, "", warning_range, 181 sperfdata_int("users", users, "", warning_range,
182 critical_range, TRUE, 0, FALSE, 0)); 182 critical_range, true, 0, false, 0));
183 } 183 }
184 184
185 return result; 185 return result;
@@ -202,7 +202,7 @@ process_arguments (int argc, char **argv)
202 if (argc < 2) 202 if (argc < 2)
203 usage ("\n"); 203 usage ("\n");
204 204
205 while (1) { 205 while (true) {
206 c = getopt_long (argc, argv, "+hVvc:w:", longopts, &option); 206 c = getopt_long (argc, argv, "+hVvc:w:", longopts, &option);
207 207
208 if (c == -1 || c == EOF || c == 1) 208 if (c == -1 || c == EOF || c == 1)
@@ -227,18 +227,23 @@ process_arguments (int argc, char **argv)
227 } 227 }
228 228
229 c = optind; 229 c = optind;
230
230 if (warning_range == NULL && argc > c) 231 if (warning_range == NULL && argc > c)
231 warning_range = argv[c++]; 232 warning_range = argv[c++];
233
232 if (critical_range == NULL && argc > c) 234 if (critical_range == NULL && argc > c)
233 critical_range = argv[c++]; 235 critical_range = argv[c++];
234 236
235 /* this will abort in case of invalid ranges */ 237 /* this will abort in case of invalid ranges */
236 set_thresholds (&thlds, warning_range, critical_range); 238 set_thresholds (&thlds, warning_range, critical_range);
237 239
238 if (thlds->warning->end < 0) 240 if (!thlds->warning) {
239 usage4 (_("Warning threshold must be a positive integer")); 241 usage4 (_("Warning threshold must be a valid range expression"));
240 if (thlds->critical->end < 0) 242 }
241 usage4 (_("Critical threshold must be a positive integer")); 243
244 if (!thlds->critical) {
245 usage4 (_("Critical threshold must be a valid range expression"));
246 }
242 247
243 return OK; 248 return OK;
244} 249}
@@ -261,10 +266,10 @@ print_help (void)
261 printf (UT_HELP_VRSN); 266 printf (UT_HELP_VRSN);
262 printf (UT_EXTRA_OPTS); 267 printf (UT_EXTRA_OPTS);
263 268
264 printf (" %s\n", "-w, --warning=INTEGER"); 269 printf (" %s\n", "-w, --warning=RANGE_EXPRESSION");
265 printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in")); 270 printf (" %s\n", _("Set WARNING status if number of logged in users violates RANGE_EXPRESSION"));
266 printf (" %s\n", "-c, --critical=INTEGER"); 271 printf (" %s\n", "-c, --critical=RANGE_EXPRESSION");
267 printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in")); 272 printf (" %s\n", _("Set CRITICAL status if number of logged in users violates RANGE_EXPRESSION"));
268 273
269 printf (UT_SUPPORT); 274 printf (UT_SUPPORT);
270} 275}
diff --git a/plugins/common.h b/plugins/common.h
index 0f08e2f..833479c 100644
--- a/plugins/common.h
+++ b/plugins/common.h
@@ -184,14 +184,6 @@ enum {
184 ERROR = -1 184 ERROR = -1
185}; 185};
186 186
187/* AIX seems to have this defined somewhere else */
188#ifndef FALSE
189enum {
190 FALSE,
191 TRUE
192};
193#endif
194
195enum { 187enum {
196 STATE_OK, 188 STATE_OK,
197 STATE_WARNING, 189 STATE_WARNING,
@@ -225,18 +217,4 @@ enum {
225# define __attribute__(x) /* do nothing */ 217# define __attribute__(x) /* do nothing */
226#endif 218#endif
227 219
228/* Try sysconf(_SC_OPEN_MAX) first, as it can be higher than OPEN_MAX.
229 * If that fails and the macro isn't defined, we fall back to an educated
230 * guess. There's no guarantee that our guess is adequate and the program
231 * will die with SIGSEGV if it isn't and the upper boundary is breached. */
232#define DEFAULT_MAXFD 256 /* fallback value if no max open files value is set */
233#define MAXFD_LIMIT 8192 /* upper limit of open files */
234#ifdef _SC_OPEN_MAX
235static long maxfd = 0;
236#elif defined(OPEN_MAX)
237# define maxfd OPEN_MAX
238#else /* sysconf macro unavailable, so guess (may be wildly inaccurate) */
239# define maxfd DEFAULT_MAXFD
240#endif
241
242#endif /* _COMMON_H_ */ 220#endif /* _COMMON_H_ */
diff --git a/plugins/negate.c b/plugins/negate.c
index 50f62d3..c5fe7e1 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -47,7 +47,7 @@ static const char **process_arguments (int, char **);
47void validate_arguments (char **); 47void validate_arguments (char **);
48void print_help (void); 48void print_help (void);
49void print_usage (void); 49void print_usage (void);
50int subst_text = FALSE; 50bool subst_text = false;
51 51
52static int state[4] = { 52static int state[4] = {
53 STATE_OK, 53 STATE_OK,
@@ -63,7 +63,6 @@ main (int argc, char **argv)
63 char *sub; 63 char *sub;
64 char **command_line; 64 char **command_line;
65 output chld_out, chld_err; 65 output chld_out, chld_err;
66 int i;
67 66
68 setlocale (LC_ALL, ""); 67 setlocale (LC_ALL, "");
69 bindtextdomain (PACKAGE, LOCALEDIR); 68 bindtextdomain (PACKAGE, LOCALEDIR);
@@ -86,7 +85,7 @@ main (int argc, char **argv)
86 result = cmd_run_array (command_line, &chld_out, &chld_err, 0); 85 result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
87 } 86 }
88 if (chld_err.lines > 0) { 87 if (chld_err.lines > 0) {
89 for (i = 0; i < chld_err.lines; i++) { 88 for (size_t i = 0; i < chld_err.lines; i++) {
90 fprintf (stderr, "%s\n", chld_err.line[i]); 89 fprintf (stderr, "%s\n", chld_err.line[i]);
91 } 90 }
92 } 91 }
@@ -95,7 +94,7 @@ main (int argc, char **argv)
95 if (chld_out.lines == 0) 94 if (chld_out.lines == 0)
96 die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n")); 95 die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n"));
97 96
98 for (i = 0; i < chld_out.lines; i++) { 97 for (size_t i = 0; i < chld_out.lines; i++) {
99 if (subst_text && result >= 0 && result <= 4 && result != state[result]) { 98 if (subst_text && result >= 0 && result <= 4 && result != state[result]) {
100 /* Loop over each match found */ 99 /* Loop over each match found */
101 while ((sub = strstr (chld_out.line[i], state_text (result)))) { 100 while ((sub = strstr (chld_out.line[i], state_text (result)))) {
@@ -122,7 +121,7 @@ static const char **
122process_arguments (int argc, char **argv) 121process_arguments (int argc, char **argv)
123{ 122{
124 int c; 123 int c;
125 int permute = TRUE; 124 bool permute = true;
126 125
127 int option = 0; 126 int option = 0;
128 static struct option longopts[] = { 127 static struct option longopts[] = {
@@ -168,26 +167,26 @@ process_arguments (int argc, char **argv)
168 case 'o': /* replacement for OK */ 167 case 'o': /* replacement for OK */
169 if ((state[STATE_OK] = mp_translate_state(optarg)) == ERROR) 168 if ((state[STATE_OK] = mp_translate_state(optarg)) == ERROR)
170 usage4 (_("Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3).")); 169 usage4 (_("Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
171 permute = FALSE; 170 permute = false;
172 break; 171 break;
173 172
174 case 'w': /* replacement for WARNING */ 173 case 'w': /* replacement for WARNING */
175 if ((state[STATE_WARNING] = mp_translate_state(optarg)) == ERROR) 174 if ((state[STATE_WARNING] = mp_translate_state(optarg)) == ERROR)
176 usage4 (_("Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3).")); 175 usage4 (_("Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
177 permute = FALSE; 176 permute = false;
178 break; 177 break;
179 case 'c': /* replacement for CRITICAL */ 178 case 'c': /* replacement for CRITICAL */
180 if ((state[STATE_CRITICAL] = mp_translate_state(optarg)) == ERROR) 179 if ((state[STATE_CRITICAL] = mp_translate_state(optarg)) == ERROR)
181 usage4 (_("Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3).")); 180 usage4 (_("Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
182 permute = FALSE; 181 permute = false;
183 break; 182 break;
184 case 'u': /* replacement for UNKNOWN */ 183 case 'u': /* replacement for UNKNOWN */
185 if ((state[STATE_UNKNOWN] = mp_translate_state(optarg)) == ERROR) 184 if ((state[STATE_UNKNOWN] = mp_translate_state(optarg)) == ERROR)
186 usage4 (_("Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3).")); 185 usage4 (_("Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
187 permute = FALSE; 186 permute = false;
188 break; 187 break;
189 case 's': /* Substitute status text */ 188 case 's': /* Substitute status text */
190 subst_text = TRUE; 189 subst_text = true;
191 break; 190 break;
192 } 191 }
193 } 192 }
@@ -221,8 +220,10 @@ print_help (void)
221 220
222 printf (COPYRIGHT, copyright, email); 221 printf (COPYRIGHT, copyright, email);
223 222
224 printf ("%s\n", _("Negates the status of a plugin (returns OK for CRITICAL and vice-versa).")); 223 printf ("%s\n", _("Negates only the return code of a plugin (returns OK for CRITICAL and vice-versa) by default."));
225 printf ("%s\n", _("Additional switches can be used to control which state becomes what.")); 224 printf ("%s\n", _("Additional switches can be used to control:\n"));
225 printf ("\t - which state becomes what\n");
226 printf ("\t - changing the plugin output text to match the return code");
226 227
227 printf ("\n\n"); 228 printf ("\n\n");
228 229
diff --git a/plugins/netutils.c b/plugins/netutils.c
index 1bb4f07..c6af248 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -34,7 +34,7 @@ unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
34unsigned int socket_timeout_state = STATE_CRITICAL; 34unsigned int socket_timeout_state = STATE_CRITICAL;
35 35
36int econn_refuse_state = STATE_CRITICAL; 36int econn_refuse_state = STATE_CRITICAL;
37int was_refused = FALSE; 37bool was_refused = false;
38#if USE_IPV6 38#if USE_IPV6
39int address_family = AF_UNSPEC; 39int address_family = AF_UNSPEC;
40#else 40#else
@@ -215,14 +215,14 @@ np_net_connect (const char *host_name, int port, int *sd, int proto)
215 result = connect (*sd, r->ai_addr, r->ai_addrlen); 215 result = connect (*sd, r->ai_addr, r->ai_addrlen);
216 216
217 if (result == 0) { 217 if (result == 0) {
218 was_refused = FALSE; 218 was_refused = false;
219 break; 219 break;
220 } 220 }
221 221
222 if (result < 0) { 222 if (result < 0) {
223 switch (errno) { 223 switch (errno) {
224 case ECONNREFUSED: 224 case ECONNREFUSED:
225 was_refused = TRUE; 225 was_refused = true;
226 break; 226 break;
227 } 227 }
228 } 228 }
@@ -246,7 +246,7 @@ np_net_connect (const char *host_name, int port, int *sd, int proto)
246 } 246 }
247 result = connect(*sd, (struct sockaddr *)&su, sizeof(su)); 247 result = connect(*sd, (struct sockaddr *)&su, sizeof(su));
248 if (result < 0 && errno == ECONNREFUSED) 248 if (result < 0 && errno == ECONNREFUSED)
249 was_refused = TRUE; 249 was_refused = true;
250 } 250 }
251 251
252 if (result == 0) 252 if (result == 0)
@@ -326,13 +326,11 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
326} 326}
327 327
328 328
329int 329bool is_host (const char *address) {
330is_host (const char *address)
331{
332 if (is_addr (address) || is_hostname (address)) 330 if (is_addr (address) || is_hostname (address))
333 return (TRUE); 331 return (true);
334 332
335 return (FALSE); 333 return (false);
336} 334}
337 335
338void 336void
@@ -342,20 +340,18 @@ host_or_die(const char *str)
342 usage_va(_("Invalid hostname/address - %s"), str); 340 usage_va(_("Invalid hostname/address - %s"), str);
343} 341}
344 342
345int 343bool is_addr (const char *address) {
346is_addr (const char *address)
347{
348#ifdef USE_IPV6 344#ifdef USE_IPV6
349 if (address_family == AF_INET && is_inet_addr (address)) 345 if (address_family == AF_INET && is_inet_addr (address))
350 return TRUE; 346 return true;
351 else if (address_family == AF_INET6 && is_inet6_addr (address)) 347 else if (address_family == AF_INET6 && is_inet6_addr (address))
352 return TRUE; 348 return true;
353#else 349#else
354 if (is_inet_addr (address)) 350 if (is_inet_addr (address))
355 return (TRUE); 351 return (true);
356#endif 352#endif
357 353
358 return (FALSE); 354 return (false);
359} 355}
360 356
361int 357int
@@ -370,10 +366,10 @@ dns_lookup (const char *in, struct sockaddr_storage *ss, int family)
370 366
371 retval = getaddrinfo (in, NULL, &hints, &res); 367 retval = getaddrinfo (in, NULL, &hints, &res);
372 if (retval != 0) 368 if (retval != 0)
373 return FALSE; 369 return false;
374 370
375 if (ss != NULL) 371 if (ss != NULL)
376 memcpy (ss, res->ai_addr, res->ai_addrlen); 372 memcpy (ss, res->ai_addr, res->ai_addrlen);
377 freeaddrinfo (res); 373 freeaddrinfo (res);
378 return TRUE; 374 return true;
379} 375}
diff --git a/plugins/netutils.h b/plugins/netutils.h
index d7ee0dd..a95057e 100644
--- a/plugins/netutils.h
+++ b/plugins/netutils.h
@@ -73,8 +73,8 @@ int send_request (int sd, int proto, const char *send_buffer, char *recv_buffer,
73 73
74 74
75/* "is_*" wrapper macros and functions */ 75/* "is_*" wrapper macros and functions */
76int is_host (const char *); 76bool is_host (const char *);
77int is_addr (const char *); 77bool is_addr (const char *);
78int dns_lookup (const char *, struct sockaddr_storage *, int); 78int dns_lookup (const char *, struct sockaddr_storage *, int);
79void host_or_die(const char *str); 79void host_or_die(const char *str);
80#define resolve_host_or_addr(addr, family) dns_lookup(addr, NULL, family) 80#define resolve_host_or_addr(addr, family) dns_lookup(addr, NULL, family)
@@ -89,10 +89,10 @@ void host_or_die(const char *str);
89extern unsigned int socket_timeout; 89extern unsigned int socket_timeout;
90extern unsigned int socket_timeout_state; 90extern unsigned int socket_timeout_state;
91extern int econn_refuse_state; 91extern int econn_refuse_state;
92extern int was_refused; 92extern bool was_refused;
93extern int address_family; 93extern int address_family;
94 94
95RETSIGTYPE socket_timeout_alarm_handler (int) __attribute__((noreturn)); 95void socket_timeout_alarm_handler (int) __attribute__((noreturn));
96 96
97/* SSL-Related functionality */ 97/* SSL-Related functionality */
98#ifdef HAVE_SSL 98#ifdef HAVE_SSL
diff --git a/plugins/popen.c b/plugins/popen.c
index 723817d..54e63bc 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -38,8 +38,9 @@
38* 38*
39*****************************************************************************/ 39*****************************************************************************/
40 40
41#include "common.h" 41#include "./common.h"
42#include "utils.h" 42#include "./utils.h"
43#include "../lib/maxfd.h"
43 44
44/* extern so plugin has pid to kill exec'd process on timeouts */ 45/* extern so plugin has pid to kill exec'd process on timeouts */
45extern pid_t *childpid; 46extern pid_t *childpid;
@@ -49,9 +50,9 @@ extern FILE *child_process;
49FILE *spopen (const char *); 50FILE *spopen (const char *);
50int spclose (FILE *); 51int spclose (FILE *);
51#ifdef REDHAT_SPOPEN_ERROR 52#ifdef REDHAT_SPOPEN_ERROR
52RETSIGTYPE popen_sigchld_handler (int); 53void popen_sigchld_handler (int);
53#endif 54#endif
54RETSIGTYPE popen_timeout_alarm_handler (int); 55void popen_timeout_alarm_handler (int);
55 56
56#include <stdarg.h> /* ANSI C header file */ 57#include <stdarg.h> /* ANSI C header file */
57#include <fcntl.h> 58#include <fcntl.h>
@@ -104,7 +105,7 @@ spopen (const char *cmdstring)
104#endif 105#endif
105 106
106 env[0] = strdup("LC_ALL=C"); 107 env[0] = strdup("LC_ALL=C");
107 env[1] = '\0'; 108 env[1] = NULL;
108 109
109 /* if no command was passed, return with no error */ 110 /* if no command was passed, return with no error */
110 if (cmdstring == NULL) 111 if (cmdstring == NULL)
@@ -177,8 +178,7 @@ spopen (const char *cmdstring)
177 } 178 }
178 argv[i] = NULL; 179 argv[i] = NULL;
179 180
180 if(maxfd == 0) 181 long maxfd = mp_open_max();
181 maxfd = open_max();
182 182
183 if (childpid == NULL) { /* first time through */ 183 if (childpid == NULL) { /* first time through */
184 if ((childpid = calloc ((size_t)maxfd, sizeof (pid_t))) == NULL) 184 if ((childpid = calloc ((size_t)maxfd, sizeof (pid_t))) == NULL)
@@ -266,7 +266,7 @@ spclose (FILE * fp)
266} 266}
267 267
268#ifdef REDHAT_SPOPEN_ERROR 268#ifdef REDHAT_SPOPEN_ERROR
269RETSIGTYPE 269void
270popen_sigchld_handler (int signo) 270popen_sigchld_handler (int signo)
271{ 271{
272 if (signo == SIGCHLD) 272 if (signo == SIGCHLD)
@@ -274,7 +274,7 @@ popen_sigchld_handler (int signo)
274} 274}
275#endif 275#endif
276 276
277RETSIGTYPE 277void
278popen_timeout_alarm_handler (int signo) 278popen_timeout_alarm_handler (int signo)
279{ 279{
280 int fh; 280 int fh;
diff --git a/plugins/popen.h b/plugins/popen.h
index a5dd8fa..1ea6963 100644
--- a/plugins/popen.h
+++ b/plugins/popen.h
@@ -5,7 +5,7 @@
5 5
6FILE *spopen (const char *); 6FILE *spopen (const char *);
7int spclose (FILE *); 7int spclose (FILE *);
8RETSIGTYPE popen_timeout_alarm_handler (int); 8void popen_timeout_alarm_handler (int);
9 9
10pid_t *childpid=NULL; 10pid_t *childpid=NULL;
11int *child_stderr_array=NULL; 11int *child_stderr_array=NULL;
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index 102191e..ed49bb9 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -60,6 +60,8 @@
60# define SIG_ERR ((Sigfunc *)-1) 60# define SIG_ERR ((Sigfunc *)-1)
61#endif 61#endif
62 62
63#include "../lib/maxfd.h"
64
63/* This variable must be global, since there's no way the caller 65/* This variable must be global, since there's no way the caller
64 * can forcibly slay a dead or ungainly running program otherwise. 66 * can forcibly slay a dead or ungainly running program otherwise.
65 * Multithreading apps and plugins can initialize it (via NP_RUNCMD_INIT) 67 * Multithreading apps and plugins can initialize it (via NP_RUNCMD_INIT)
@@ -88,8 +90,7 @@ extern void die (int, const char *, ...)
88 * through this api and thus achieve async-safeness throughout the api */ 90 * through this api and thus achieve async-safeness throughout the api */
89void np_runcmd_init(void) 91void np_runcmd_init(void)
90{ 92{
91 if(maxfd == 0) 93 long maxfd = mp_open_max();
92 maxfd = open_max();
93 if(!np_pids) np_pids = calloc(maxfd, sizeof(pid_t)); 94 if(!np_pids) np_pids = calloc(maxfd, sizeof(pid_t));
94} 95}
95 96
@@ -114,7 +115,7 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
114 if(!np_pids) NP_RUNCMD_INIT; 115 if(!np_pids) NP_RUNCMD_INIT;
115 116
116 env[0] = strdup("LC_ALL=C"); 117 env[0] = strdup("LC_ALL=C");
117 env[1] = '\0'; 118 env[1] = NULL;
118 119
119 /* make copy of command string so strtok() doesn't silently modify it */ 120 /* make copy of command string so strtok() doesn't silently modify it */
120 /* (the calling program may want to access it later) */ 121 /* (the calling program may want to access it later) */
@@ -192,6 +193,7 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
192 /* close all descriptors in np_pids[] 193 /* close all descriptors in np_pids[]
193 * This is executed in a separate address space (pure child), 194 * This is executed in a separate address space (pure child),
194 * so we don't have to worry about async safety */ 195 * so we don't have to worry about async safety */
196 long maxfd = mp_open_max();
195 for (i = 0; i < maxfd; i++) 197 for (i = 0; i < maxfd; i++)
196 if(np_pids[i] > 0) 198 if(np_pids[i] > 0)
197 close (i); 199 close (i);
@@ -219,6 +221,7 @@ np_runcmd_close(int fd)
219 pid_t pid; 221 pid_t pid;
220 222
221 /* make sure this fd was opened by popen() */ 223 /* make sure this fd was opened by popen() */
224 long maxfd = mp_open_max();
222 if(fd < 0 || fd > maxfd || !np_pids || (pid = np_pids[fd]) == 0) 225 if(fd < 0 || fd > maxfd || !np_pids || (pid = np_pids[fd]) == 0)
223 return -1; 226 return -1;
224 227
@@ -237,12 +240,12 @@ np_runcmd_close(int fd)
237void 240void
238runcmd_timeout_alarm_handler (int signo) 241runcmd_timeout_alarm_handler (int signo)
239{ 242{
240 size_t i;
241 243
242 if (signo == SIGALRM) 244 if (signo == SIGALRM)
243 puts(_("CRITICAL - Plugin timed out while executing system call")); 245 puts(_("CRITICAL - Plugin timed out while executing system call"));
244 246
245 if(np_pids) for(i = 0; i < maxfd; i++) { 247 long maxfd = mp_open_max();
248 if(np_pids) for(long int i = 0; i < maxfd; i++) {
246 if(np_pids[i] != 0) kill(np_pids[i], SIGKILL); 249 if(np_pids[i] != 0) kill(np_pids[i], SIGKILL);
247 } 250 }
248 251
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index 666a012..6bc0ba8 100644
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
@@ -31,9 +31,8 @@
31#include "netutils.h" 31#include "netutils.h"
32 32
33#ifdef HAVE_SSL 33#ifdef HAVE_SSL
34static SSL_CTX *c=NULL; 34static SSL_CTX *ctx=NULL;
35static SSL *s=NULL; 35static SSL *s=NULL;
36static int initialized=0;
37 36
38int np_net_ssl_init(int sd) { 37int np_net_ssl_init(int sd) {
39 return np_net_ssl_init_with_hostname(sd, NULL); 38 return np_net_ssl_init_with_hostname(sd, NULL);
@@ -48,24 +47,24 @@ int np_net_ssl_init_with_hostname_and_version(int sd, char *host_name, int versi
48} 47}
49 48
50int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey) { 49int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey) {
51 const SSL_METHOD *method = NULL;
52 long options = 0; 50 long options = 0;
53 51
52 if ((ctx = SSL_CTX_new(TLS_client_method())) == NULL) {
53 printf("%s\n", _("CRITICAL - Cannot create SSL context."));
54 return STATE_CRITICAL;
55 }
56
54 switch (version) { 57 switch (version) {
55 case MP_SSLv2: /* SSLv2 protocol */ 58 case MP_SSLv2: /* SSLv2 protocol */
56#if defined(USE_GNUTLS) || defined(OPENSSL_NO_SSL2)
57 printf("%s\n", _("UNKNOWN - SSL protocol version 2 is not supported by your SSL library.")); 59 printf("%s\n", _("UNKNOWN - SSL protocol version 2 is not supported by your SSL library."));
58 return STATE_UNKNOWN; 60 return STATE_UNKNOWN;
59#else
60 method = SSLv2_client_method();
61 break;
62#endif
63 case MP_SSLv3: /* SSLv3 protocol */ 61 case MP_SSLv3: /* SSLv3 protocol */
64#if defined(OPENSSL_NO_SSL3) 62#if defined(OPENSSL_NO_SSL3)
65 printf("%s\n", _("UNKNOWN - SSL protocol version 3 is not supported by your SSL library.")); 63 printf("%s\n", _("UNKNOWN - SSL protocol version 3 is not supported by your SSL library."));
66 return STATE_UNKNOWN; 64 return STATE_UNKNOWN;
67#else 65#else
68 method = SSLv3_client_method(); 66 SSL_CTX_set_min_proto_version(ctx, SSL3_VERSION);
67 SSL_CTX_set_max_proto_version(ctx, SSL3_VERSION);
69 break; 68 break;
70#endif 69#endif
71 case MP_TLSv1: /* TLSv1 protocol */ 70 case MP_TLSv1: /* TLSv1 protocol */
@@ -73,7 +72,8 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
73 printf("%s\n", _("UNKNOWN - TLS protocol version 1 is not supported by your SSL library.")); 72 printf("%s\n", _("UNKNOWN - TLS protocol version 1 is not supported by your SSL library."));
74 return STATE_UNKNOWN; 73 return STATE_UNKNOWN;
75#else 74#else
76 method = TLSv1_client_method(); 75 SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
76 SSL_CTX_set_max_proto_version(ctx, TLS1_VERSION);
77 break; 77 break;
78#endif 78#endif
79 case MP_TLSv1_1: /* TLSv1.1 protocol */ 79 case MP_TLSv1_1: /* TLSv1.1 protocol */
@@ -81,7 +81,8 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
81 printf("%s\n", _("UNKNOWN - TLS protocol version 1.1 is not supported by your SSL library.")); 81 printf("%s\n", _("UNKNOWN - TLS protocol version 1.1 is not supported by your SSL library."));
82 return STATE_UNKNOWN; 82 return STATE_UNKNOWN;
83#else 83#else
84 method = TLSv1_1_client_method(); 84 SSL_CTX_set_min_proto_version(ctx, TLS1_1_VERSION);
85 SSL_CTX_set_max_proto_version(ctx, TLS1_1_VERSION);
85 break; 86 break;
86#endif 87#endif
87 case MP_TLSv1_2: /* TLSv1.2 protocol */ 88 case MP_TLSv1_2: /* TLSv1.2 protocol */
@@ -89,7 +90,8 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
89 printf("%s\n", _("UNKNOWN - TLS protocol version 1.2 is not supported by your SSL library.")); 90 printf("%s\n", _("UNKNOWN - TLS protocol version 1.2 is not supported by your SSL library."));
90 return STATE_UNKNOWN; 91 return STATE_UNKNOWN;
91#else 92#else
92 method = TLSv1_2_client_method(); 93 SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION);
94 SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION);
93 break; 95 break;
94#endif 96#endif
95 case MP_TLSv1_2_OR_NEWER: 97 case MP_TLSv1_2_OR_NEWER:
@@ -97,56 +99,43 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
97 printf("%s\n", _("UNKNOWN - Disabling TLSv1.1 is not supported by your SSL library.")); 99 printf("%s\n", _("UNKNOWN - Disabling TLSv1.1 is not supported by your SSL library."));
98 return STATE_UNKNOWN; 100 return STATE_UNKNOWN;
99#else 101#else
100 options |= SSL_OP_NO_TLSv1_1; 102 SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION);
103 break;
101#endif 104#endif
102 /* FALLTHROUGH */
103 case MP_TLSv1_1_OR_NEWER: 105 case MP_TLSv1_1_OR_NEWER:
104#if !defined(SSL_OP_NO_TLSv1) 106#if !defined(SSL_OP_NO_TLSv1)
105 printf("%s\n", _("UNKNOWN - Disabling TLSv1 is not supported by your SSL library.")); 107 printf("%s\n", _("UNKNOWN - Disabling TLSv1 is not supported by your SSL library."));
106 return STATE_UNKNOWN; 108 return STATE_UNKNOWN;
107#else 109#else
108 options |= SSL_OP_NO_TLSv1; 110 SSL_CTX_set_min_proto_version(ctx, TLS1_1_VERSION);
111 break;
109#endif 112#endif
110 /* FALLTHROUGH */
111 case MP_TLSv1_OR_NEWER: 113 case MP_TLSv1_OR_NEWER:
112#if defined(SSL_OP_NO_SSLv3) 114#if defined(SSL_OP_NO_SSLv3)
113 options |= SSL_OP_NO_SSLv3; 115 SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
116 break;
114#endif 117#endif
115 /* FALLTHROUGH */
116 case MP_SSLv3_OR_NEWER: 118 case MP_SSLv3_OR_NEWER:
117#if defined(SSL_OP_NO_SSLv2) 119#if defined(SSL_OP_NO_SSLv2)
118 options |= SSL_OP_NO_SSLv2; 120 SSL_CTX_set_min_proto_version(ctx, SSL3_VERSION);
121 break;
119#endif 122#endif
120 case MP_SSLv2_OR_NEWER:
121 /* FALLTHROUGH */
122 default: /* Default to auto negotiation */
123 method = SSLv23_client_method();
124 }
125 if (!initialized) {
126 /* Initialize SSL context */
127 SSLeay_add_ssl_algorithms();
128 SSL_load_error_strings();
129 OpenSSL_add_all_algorithms();
130 initialized = 1;
131 }
132 if ((c = SSL_CTX_new(method)) == NULL) {
133 printf("%s\n", _("CRITICAL - Cannot create SSL context."));
134 return STATE_CRITICAL;
135 } 123 }
124
136 if (cert && privkey) { 125 if (cert && privkey) {
137#ifdef USE_OPENSSL 126#ifdef USE_OPENSSL
138 if (!SSL_CTX_use_certificate_chain_file(c, cert)) { 127 if (!SSL_CTX_use_certificate_chain_file(ctx, cert)) {
139#elif USE_GNUTLS 128#elif USE_GNUTLS
140 if (!SSL_CTX_use_certificate_file(c, cert, SSL_FILETYPE_PEM)) { 129 if (!SSL_CTX_use_certificate_file(ctx, cert, SSL_FILETYPE_PEM)) {
141#else 130#else
142#error Unported for unknown SSL library 131#error Unported for unknown SSL library
143#endif 132#endif
144 printf ("%s\n", _("CRITICAL - Unable to open certificate chain file!\n")); 133 printf ("%s\n", _("CRITICAL - Unable to open certificate chain file!\n"));
145 return STATE_CRITICAL; 134 return STATE_CRITICAL;
146 } 135 }
147 SSL_CTX_use_PrivateKey_file(c, privkey, SSL_FILETYPE_PEM); 136 SSL_CTX_use_PrivateKey_file(ctx, privkey, SSL_FILETYPE_PEM);
148#ifdef USE_OPENSSL 137#ifdef USE_OPENSSL
149 if (!SSL_CTX_check_private_key(c)) { 138 if (!SSL_CTX_check_private_key(ctx)) {
150 printf ("%s\n", _("CRITICAL - Private key does not seem to match certificate!\n")); 139 printf ("%s\n", _("CRITICAL - Private key does not seem to match certificate!\n"));
151 return STATE_CRITICAL; 140 return STATE_CRITICAL;
152 } 141 }
@@ -155,9 +144,9 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
155#ifdef SSL_OP_NO_TICKET 144#ifdef SSL_OP_NO_TICKET
156 options |= SSL_OP_NO_TICKET; 145 options |= SSL_OP_NO_TICKET;
157#endif 146#endif
158 SSL_CTX_set_options(c, options); 147 SSL_CTX_set_options(ctx, options);
159 SSL_CTX_set_mode(c, SSL_MODE_AUTO_RETRY); 148 SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
160 if ((s = SSL_new(c)) != NULL) { 149 if ((s = SSL_new(ctx)) != NULL) {
161#ifdef SSL_set_tlsext_host_name 150#ifdef SSL_set_tlsext_host_name
162 if (host_name != NULL) 151 if (host_name != NULL)
163 SSL_set_tlsext_host_name(s, host_name); 152 SSL_set_tlsext_host_name(s, host_name);
@@ -184,9 +173,9 @@ void np_net_ssl_cleanup() {
184#endif 173#endif
185 SSL_shutdown(s); 174 SSL_shutdown(s);
186 SSL_free(s); 175 SSL_free(s);
187 if (c) { 176 if (ctx) {
188 SSL_CTX_free(c); 177 SSL_CTX_free(ctx);
189 c=NULL; 178 ctx=NULL;
190 } 179 }
191 s=NULL; 180 s=NULL;
192 } 181 }
diff --git a/plugins/t/check_curl.t b/plugins/t/check_curl.t
index eae98cc..7a930a4 100644
--- a/plugins/t/check_curl.t
+++ b/plugins/t/check_curl.t
@@ -205,9 +205,9 @@ SKIP: {
205 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' ); 205 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
206 like ( $res->output, '/time_ssl=[\d\.]+/', 'Extended Performance Data SSL Output OK' ); 206 like ( $res->output, '/time_ssl=[\d\.]+/', 'Extended Performance Data SSL Output OK' );
207 207
208 $res = NPTest->testCmd( "./$plugin -H www.mozilla.com -u /firefox -f curl" ); 208 $res = NPTest->testCmd( "./$plugin -H monitoring-plugins.org -u /download.html -f follow" );
209 is( $res->return_code, 0, "Redirection based on location is okay"); 209 is( $res->return_code, 0, "Redirection based on location is okay");
210 210
211 $res = NPTest->testCmd( "./$plugin -H www.mozilla.com --extended-perfdata" ); 211 $res = NPTest->testCmd( "./$plugin -H monitoring-plugins.org --extended-perfdata" );
212 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' ); 212 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
213} 213}
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
index ca035ce..9eb77ce 100644
--- a/plugins/t/check_disk.t
+++ b/plugins/t/check_disk.t
@@ -23,11 +23,11 @@ my $mountpoint2_valid = getTestParameter( "NP_MOUNTPOINT2_VALID", "Path to anoth
23if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { 23if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") {
24 plan skip_all => "Need 2 mountpoints to test"; 24 plan skip_all => "Need 2 mountpoints to test";
25} else { 25} else {
26 plan tests => 88; 26 plan tests => 94;
27} 27}
28 28
29$result = NPTest->testCmd( 29$result = NPTest->testCmd(
30 "./check_disk -w 1% -c 1% -p $mountpoint_valid -w 1% -c 1% -p $mountpoint2_valid" 30 "./check_disk -w 1% -c 1% -p $mountpoint_valid -w 1% -c 1% -p $mountpoint2_valid"
31 ); 31 );
32cmp_ok( $result->return_code, "==", 0, "Checking two mountpoints (must have at least 1% free in space and inodes)"); 32cmp_ok( $result->return_code, "==", 0, "Checking two mountpoints (must have at least 1% free in space and inodes)");
33my $c = 0; 33my $c = 0;
@@ -44,7 +44,7 @@ my @perf_data = sort(split(/ /, $result->perf_output));
44# Calculate avg_free free on mountpoint1 and mountpoint2 44# Calculate avg_free free on mountpoint1 and mountpoint2
45# because if you check in the middle, you should get different errors 45# because if you check in the middle, you should get different errors
46$_ = $result->output; 46$_ = $result->output;
47my ($free_on_mp1, $free_on_mp2) = (m/\((\d+)%.*\((\d+)%/); 47my ($free_on_mp1, $free_on_mp2) = (m/\((\d+\.\d+)%.*\((\d+\.\d+)%/);
48die "Cannot parse output: $_" unless ($free_on_mp1 && $free_on_mp2); 48die "Cannot parse output: $_" unless ($free_on_mp1 && $free_on_mp2);
49my $avg_free = ceil(($free_on_mp1+$free_on_mp2)/2); 49my $avg_free = ceil(($free_on_mp1+$free_on_mp2)/2);
50my ($more_free, $less_free); 50my ($more_free, $less_free);
@@ -103,8 +103,8 @@ is ($crit_percth_data, int((1-10/100)*$total_percth_data), "Wrong critical in pe
103 103
104 104
105# Check when order of mount points are reversed, that perf data remains same 105# Check when order of mount points are reversed, that perf data remains same
106$result = NPTest->testCmd( 106$result = NPTest->testCmd(
107 "./check_disk -w 1% -c 1% -p $mountpoint2_valid -w 1% -c 1% -p $mountpoint_valid" 107 "./check_disk -w 1% -c 1% -p $mountpoint2_valid -w 1% -c 1% -p $mountpoint_valid"
108 ); 108 );
109@_ = sort(split(/ /, $result->perf_output)); 109@_ = sort(split(/ /, $result->perf_output));
110is_deeply( \@perf_data, \@_, "perf data for both filesystems same when reversed"); 110is_deeply( \@perf_data, \@_, "perf data for both filesystems same when reversed");
@@ -119,8 +119,12 @@ like ( $result->only_output, qr/$more_free/, "Have disk name in text");
119 119
120$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" ); 120$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" );
121cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free"); 121cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free");
122
122$_ = $result->output; 123$_ = $result->output;
124
123my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+)MiB .* (\d+)MiB /g); 125my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+)MiB .* (\d+)MiB /g);
126die "Cannot parse output: $_" unless ($free_mb_on_mp1 && $free_mb_on_mp2);
127
124my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2; 128my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2;
125 129
126 130
@@ -134,8 +138,8 @@ cmp_ok( $result->return_code, '==', 0, "Old syntax okay" );
134$result = NPTest->testCmd( "./check_disk -w 1% -c 1% -p $more_free" ); 138$result = NPTest->testCmd( "./check_disk -w 1% -c 1% -p $more_free" );
135cmp_ok( $result->return_code, "==", 0, "At least 1% free" ); 139cmp_ok( $result->return_code, "==", 0, "At least 1% free" );
136 140
137$result = NPTest->testCmd( 141$result = NPTest->testCmd(
138 "./check_disk -w 1% -c 1% -p $more_free -w 100% -c 100% -p $less_free" 142 "./check_disk -w 1% -c 1% -p $more_free -w 100% -c 100% -p $less_free"
139 ); 143 );
140cmp_ok( $result->return_code, "==", 2, "Get critical on less_free mountpoint $less_free" ); 144cmp_ok( $result->return_code, "==", 2, "Get critical on less_free mountpoint $less_free" );
141like( $result->output, $failureOutput, "Right output" ); 145like( $result->output, $failureOutput, "Right output" );
@@ -151,14 +155,14 @@ $result = NPTest->testCmd(
151 ); 155 );
152cmp_ok( $result->return_code, '==', 0, "Get ok on more_free mountpoint, when checking avg_free"); 156cmp_ok( $result->return_code, '==', 0, "Get ok on more_free mountpoint, when checking avg_free");
153 157
154$result = NPTest->testCmd( 158$result = NPTest->testCmd(
155 "./check_disk -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free" 159 "./check_disk -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
156 ); 160 );
157cmp_ok( $result->return_code, "==", 1, "Combining above two tests, get warning"); 161cmp_ok( $result->return_code, "==", 1, "Combining above two tests, get warning");
158my $all_disks = $result->output; 162my $all_disks = $result->output;
159 163
160$result = NPTest->testCmd( 164$result = NPTest->testCmd(
161 "./check_disk -e -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free" 165 "./check_disk -e -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
162 ); 166 );
163isnt( $result->output, $all_disks, "-e gives different output"); 167isnt( $result->output, $all_disks, "-e gives different output");
164 168
@@ -240,7 +244,7 @@ TODO: {
240 cmp_ok( $result->return_code, '==', 3, "Invalid command line options" ); 244 cmp_ok( $result->return_code, '==', 3, "Invalid command line options" );
241} 245}
242 246
243$result = NPTest->testCmd( 247$result = NPTest->testCmd(
244 "./check_disk -p $mountpoint_valid -w 10% -c 15%" 248 "./check_disk -p $mountpoint_valid -w 10% -c 15%"
245 ); 249 );
246cmp_ok( $result->return_code, "==", 3, "Invalid options: -p must come after thresholds" ); 250cmp_ok( $result->return_code, "==", 3, "Invalid options: -p must come after thresholds" );
@@ -311,8 +315,8 @@ $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -C -w 0% -c 0% -p $mountpoi
311like( $result->output, '/;.*;\|/', "-C selects partitions if -p is not given"); 315like( $result->output, '/;.*;\|/', "-C selects partitions if -p is not given");
312 316
313# grouping: exit crit if the sum of free megs on mp1+mp2 is less than warn/crit 317# grouping: exit crit if the sum of free megs on mp1+mp2 is less than warn/crit
314$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all + 1) ." -c ". ($free_mb_on_all + 1) ."-g group -p $mountpoint_valid -p $mountpoint2_valid" ); 318$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all + 1) ." -c ". ($free_mb_on_all + 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" );
315cmp_ok( $result->return_code, '==', 2, "grouping: exit crit if the sum of free megs on mp1+mp2 is less than warn/crit"); 319cmp_ok( $result->return_code, '==', 2, "grouping: exit crit if the sum of free megs on mp1+mp2 is less than warn/crit\nInstead received: " . $result->output);
316 320
317# grouping: exit warning if the sum of free megs on mp1+mp2 is between -w and -c 321# grouping: exit warning if the sum of free megs on mp1+mp2 is between -w and -c
318$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all + 1) ." -c ". ($free_mb_on_all - 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" ); 322$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all + 1) ." -c ". ($free_mb_on_all - 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" );
@@ -322,7 +326,7 @@ cmp_ok( $result->return_code, '==', 1, "grouping: exit warning if the sum of fre
322$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" ); 326$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" );
323cmp_ok( $result->return_code, '==', 0, "grouping: exit ok if the sum of free megs on mp1+mp2 is more than warn/crit"); 327cmp_ok( $result->return_code, '==', 0, "grouping: exit ok if the sum of free megs on mp1+mp2 is more than warn/crit");
324 328
325# grouping: exit unknown if group name is given after -p 329# grouping: exit unknown if group name is given after -p
326$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -p $mountpoint_valid -g group -p $mountpoint2_valid" ); 330$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -p $mountpoint_valid -g group -p $mountpoint2_valid" );
327cmp_ok( $result->return_code, '==', 3, "Invalid options: -p must come after groupname"); 331cmp_ok( $result->return_code, '==', 3, "Invalid options: -p must come after groupname");
328 332
@@ -355,17 +359,17 @@ like( $result->output, qr/$mountpoint2_valid/,"ignore: output data does have $mo
355# ignore-missing: exit okay, when fs is not accessible 359# ignore-missing: exit okay, when fs is not accessible
356$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -p /bob"); 360$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -p /bob");
357cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for not existing filesystem /bob"); 361cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for not existing filesystem /bob");
358like( $result->output, '/^DISK OK - No disks were found for provided parameters; - ignored paths: /bob;.*$/', 'Output OK'); 362like( $result->output, '/^DISK OK - No disks were found for provided parameters - ignored paths: /bob;.*$/', 'Output OK');
359 363
360# ignore-missing: exit okay, when regex does not match 364# ignore-missing: exit okay, when regex does not match
361$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -r /bob"); 365$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -r /bob");
362cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching"); 366cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
363like( $result->output, '/^DISK OK - No disks were found for provided parameters;.*$/', 'Output OK'); 367like( $result->output, '/^DISK OK - No disks were found for provided parameters.*$/', 'Output OK');
364 368
365# ignore-missing: exit okay, when fs with exact match (-E) is not found 369# ignore-missing: exit okay, when fs with exact match (-E) is not found
366$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -E -p /etc"); 370$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -E -p /etc");
367cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay when exact match does not find fs"); 371cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay when exact match does not find fs");
368like( $result->output, '/^DISK OK - No disks were found for provided parameters; - ignored paths: /etc;.*$/', 'Output OK'); 372like( $result->output, '/^DISK OK - No disks were found for provided parameters - ignored paths: /etc;.*$/', 'Output OK');
369 373
370# ignore-missing: exit okay, when checking one existing fs and one non-existing fs (regex) 374# ignore-missing: exit okay, when checking one existing fs and one non-existing fs (regex)
371$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -r '/bob' -r '^/\$'"); 375$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -r '/bob' -r '^/\$'");
@@ -375,4 +379,19 @@ like( $result->output, '/^DISK OK - free space: \/ .*$/', 'Output OK');
375# ignore-missing: exit okay, when checking one existing fs and one non-existing fs (path) 379# ignore-missing: exit okay, when checking one existing fs and one non-existing fs (path)
376$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -p '/bob' -p '/'"); 380$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -p '/bob' -p '/'");
377cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching"); 381cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
378like( $result->output, '/^DISK OK - free space: / .*; - ignored paths: /bob;.*$/', 'Output OK'); \ No newline at end of file 382like( $result->output, '/^DISK OK - free space: / .*; - ignored paths: /bob;.*$/', 'Output OK');
383
384# ignore-missing: exit okay, when checking one non-existing fs (path) and one ignored
385$result = NPTest->testCmd( "./check_disk -n -w 0% -c 0% -r /dummy -i /dummy2");
386cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
387like( $result->output, '/^DISK OK - No disks were found for provided parameters\|$/', 'Output OK');
388
389# ignore-missing: exit okay, when regex match does not find anything
390$result = NPTest->testCmd( "./check_disk -n -e -l -w 10% -c 5% -W 10% -K 5% -r /dummy");
391cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
392like( $result->output, '/^DISK OK\|$/', 'Output OK');
393
394# ignore-missing: exit okay, when regex match does not find anything
395$result = NPTest->testCmd( "./check_disk -n -l -w 10% -c 5% -W 10% -K 5% -r /dummy");
396cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
397like( $result->output, '/^DISK OK - No disks were found for provided parameters\|$/', 'Output OK');
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 1f2fbdf..6ab4a5b 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -166,10 +166,10 @@ SKIP: {
166 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' ); 166 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
167 like ( $res->output, '/time_ssl=[\d\.]+/', 'Extended Performance Data SSL Output OK' ); 167 like ( $res->output, '/time_ssl=[\d\.]+/', 'Extended Performance Data SSL Output OK' );
168 168
169 $res = NPTest->testCmd( "./$plugin -H www.mozilla.com -u /firefox -f follow" ); 169 $res = NPTest->testCmd( "./$plugin -H monitoring-plugins.org -u /download.html -f follow" );
170 is( $res->return_code, 0, "Redirection based on location is okay"); 170 is( $res->return_code, 0, "Redirection based on location is okay");
171 171
172 $res = NPTest->testCmd( "./$plugin -H www.mozilla.com --extended-perfdata" ); 172 $res = NPTest->testCmd( "./$plugin -H monitoring-plugins.org --extended-perfdata" );
173 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' ); 173 like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
174} 174}
175 175
diff --git a/plugins/t/check_imap.t b/plugins/t/check_imap.t
index 7c74e56..cf2f81c 100644
--- a/plugins/t/check_imap.t
+++ b/plugins/t/check_imap.t
@@ -25,7 +25,7 @@ $t = NPTest->testCmd( "./check_imap $host_tcp_imap -p 143 -wt 9 -ct 9 -to 10 -e
25cmp_ok( $t->return_code, '==', 0, "Check old parameter options" ); 25cmp_ok( $t->return_code, '==', 0, "Check old parameter options" );
26 26
27$t = NPTest->testCmd( "./check_imap $host_nonresponsive" ); 27$t = NPTest->testCmd( "./check_imap $host_nonresponsive" );
28cmp_ok( $t->return_code, '==', 2, "Get error with non reponsive host" ); 28cmp_ok( $t->return_code, '==', 2, "Get error with non responsive host" );
29 29
30$t = NPTest->testCmd( "./check_imap $hostname_invalid" ); 30$t = NPTest->testCmd( "./check_imap $hostname_invalid" );
31cmp_ok( $t->return_code, '==', 2, "Invalid hostname" ); 31cmp_ok( $t->return_code, '==', 2, "Invalid hostname" );
diff --git a/plugins/t/check_ssh.t b/plugins/t/check_ssh.t
index a5cd23c..907d33a 100644
--- a/plugins/t/check_ssh.t
+++ b/plugins/t/check_ssh.t
@@ -8,34 +8,116 @@ use strict;
8use Test::More; 8use Test::More;
9use NPTest; 9use NPTest;
10 10
11my $res;
12
11# Required parameters 13# Required parameters
12my $ssh_host = getTestParameter("NP_SSH_HOST", "A host providing SSH service", "localhost"); 14my $ssh_host = getTestParameter("NP_SSH_HOST",
13my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1" ); 15 "A host providing SSH service",
14my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost" ); 16 "localhost");
17
18my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE",
19 "The hostname of system not responsive to network requests",
20 "10.0.0.1" );
21
22my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID",
23 "An invalid (not known to DNS) hostname",
24 "nosuchhost" );
25
26
27plan tests => 14 + 6;
28
29SKIP: {
30 skip "SSH_HOST must be defined", 6 unless $ssh_host;
31 my $result = NPTest->testCmd(
32 "./check_ssh -H $ssh_host"
33 );
34 cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
35 like($result->output, '/^SSH OK - /', "Status text if command returned none (OK)");
36
37
38 $result = NPTest->testCmd(
39 "./check_ssh -H $host_nonresponsive -t 2"
40 );
41 cmp_ok($result->return_code, '==', 2, "Exit with return code 0 (OK)");
42 like($result->output, '/^CRITICAL - Socket timeout after 2 seconds/', "Status text if command returned none (OK)");
43
44
45
46 $result = NPTest->testCmd(
47 "./check_ssh -H $hostname_invalid -t 2"
48 );
49 cmp_ok($result->return_code, '==', 3, "Exit with return code 0 (OK)");
50 like($result->output, '/^check_ssh: Invalid hostname/', "Status text if command returned none (OK)");
51
15 52
53}
54SKIP: {
16 55
17plan skip_all => "SSH_HOST must be defined" unless $ssh_host; 56 skip "No netcat available", 14 unless (system("which nc > /dev/null") == 0);
18plan tests => 6;
19 57
58 # netcat on linux (on debian) will just keep the socket open if not advised otherwise
59 # therefore we add -q to close it after two seconds after receiving the EOF from input
60 my $nc_flags = "-l 5003 -N";
61 #A valid protocol version control string has the form
62 # SSH-protoversion-softwareversion SP comments CR LF
63 #
64 # where `comments` is optional, protoversion is the SSH protocol version and
65 # softwareversion is an arbitrary string representing the server software version
66 open(NC, "echo 'SSH-2.0-nagiosplug.ssh.0.1' | nc ${nc_flags}|");
67 sleep 0.1;
68 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
69 cmp_ok( $res->return_code, '==', 0, "Got SSH protocol version control string");
70 like( $res->output, '/^SSH OK - nagiosplug.ssh.0.1 \(protocol 2.0\)/', "Output OK");
71 close NC;
20 72
21my $result = NPTest->testCmd( 73 open(NC, "echo 'SSH-2.0-3.2.9.1' | nc ${nc_flags}|");
22 "./check_ssh -H $ssh_host" 74 sleep 0.1;
23 ); 75 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
24cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)"); 76 cmp_ok( $res->return_code, "==", 0, "Got SSH protocol version control string with non-alpha softwareversion string");
25like($result->output, '/^SSH OK - /', "Status text if command returned none (OK)"); 77 like( $res->output, '/^SSH OK - 3.2.9.1 \(protocol 2.0\)/', "Output OK for non-alpha softwareversion string");
78 close NC;
26 79
80 open(NC, "echo 'SSH-2.0-nagiosplug.ssh.0.1 this is a comment' | nc ${nc_flags} |");
81 sleep 0.1;
82 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003 -r nagiosplug.ssh.0.1" );
83 cmp_ok( $res->return_code, '==', 0, "Got SSH protocol version control string, and parsed comment appropriately");
84 like( $res->output, '/^SSH OK - nagiosplug.ssh.0.1 \(protocol 2.0\)/', "Output OK");
85 close NC;
27 86
28$result = NPTest->testCmd( 87 open(NC, "echo 'SSH-' | nc ${nc_flags}|");
29 "./check_ssh -H $host_nonresponsive -t 2" 88 sleep 0.1;
30 ); 89 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
31cmp_ok($result->return_code, '==', 2, "Exit with return code 0 (OK)"); 90 cmp_ok( $res->return_code, '==', 2, "Got invalid SSH protocol version control string");
32like($result->output, '/^CRITICAL - Socket timeout after 2 seconds/', "Status text if command returned none (OK)"); 91 like( $res->output, '/^SSH CRITICAL/', "Output OK");
92 close NC;
33 93
94 open(NC, "echo '' | nc ${nc_flags}|");
95 sleep 0.1;
96 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
97 cmp_ok( $res->return_code, '==', 2, "No version control string received");
98 like( $res->output, '/^SSH CRITICAL - No version control string received/', "Output OK");
99 close NC;
34 100
101 open(NC, "echo 'Not a version control string' | nc ${nc_flags}|");
102 sleep 0.1;
103 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
104 cmp_ok( $res->return_code, '==', 2, "No version control string received");
105 like( $res->output, '/^SSH CRITICAL - No version control string received/', "Output OK");
106 close NC;
35 107
36$result = NPTest->testCmd(
37 "./check_ssh -H $hostname_invalid -t 2"
38 );
39cmp_ok($result->return_code, '==', 3, "Exit with return code 0 (OK)");
40like($result->output, '/^check_ssh: Invalid hostname/', "Status text if command returned none (OK)");
41 108
109 #RFC 4253 permits servers to send any number of data lines prior to sending the protocol version control string
110 open(NC, "{ echo 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; sleep 0.5;
111 echo 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'; sleep 0.5;
112 echo 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'; sleep 0.2;
113 echo 'DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD'; sleep 0.3;
114 printf 'EEEEEEEEEEEEEEEEEE'; sleep 0.2;
115 printf 'EEEEEEEEEEEEEEEEEE\n'; sleep 0.2;
116 echo 'Some\nPrepended\nData\nLines\n'; sleep 0.2;
117 echo 'SSH-2.0-nagiosplug.ssh.0.2';} | nc ${nc_flags}|");
118 sleep 0.1;
119 $res = NPTest->testCmd( "./check_ssh -H localhost -p 5003" );
120 cmp_ok( $res->return_code, '==', 0, "Got delayed SSH protocol version control string");
121 like( $res->output, '/^SSH OK - nagiosplug.ssh.0.2 \(protocol 2.0\)/', "Output OK");
122 close NC;
123}
diff --git a/plugins/t/check_swap.t b/plugins/t/check_swap.t
index de9e0f0..1878038 100644
--- a/plugins/t/check_swap.t
+++ b/plugins/t/check_swap.t
@@ -5,7 +5,7 @@
5# 5#
6 6
7use strict; 7use strict;
8use Test::More tests => 8; 8use Test::More tests => 14;
9use NPTest; 9use NPTest;
10 10
11my $successOutput = '/^SWAP OK - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)/'; 11my $successOutput = '/^SWAP OK - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)/';
@@ -14,6 +14,10 @@ my $warnOutput = '/^SWAP WARNING - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)
14 14
15my $result; 15my $result;
16 16
17$result = NPTest->testCmd( "./check_swap" ); # Always OK
18cmp_ok( $result->return_code, "==", 0, "Always OK" );
19like( $result->output, $successOutput, "Right output" );
20
17$result = NPTest->testCmd( "./check_swap -w 1048576 -c 1048576" ); # 1 MB free 21$result = NPTest->testCmd( "./check_swap -w 1048576 -c 1048576" ); # 1 MB free
18cmp_ok( $result->return_code, "==", 0, "At least 1MB free" ); 22cmp_ok( $result->return_code, "==", 0, "At least 1MB free" );
19like( $result->output, $successOutput, "Right output" ); 23like( $result->output, $successOutput, "Right output" );
@@ -29,3 +33,11 @@ like( $result->output, $failureOutput, "Right output" );
29$result = NPTest->testCmd( "./check_swap -w 100% -c 1%" ); # 100% (always warn) 33$result = NPTest->testCmd( "./check_swap -w 100% -c 1%" ); # 100% (always warn)
30cmp_ok( $result->return_code, "==", 1, 'Get warning because not 100% free' ); 34cmp_ok( $result->return_code, "==", 1, 'Get warning because not 100% free' );
31like( $result->output, $warnOutput, "Right output" ); 35like( $result->output, $warnOutput, "Right output" );
36
37$result = NPTest->testCmd( "./check_swap -w 100%" ); # 100% (single threshold, always warn)
38cmp_ok( $result->return_code, "==", 1, 'Get warning because not 100% free' );
39like( $result->output, $warnOutput, "Right output" );
40
41$result = NPTest->testCmd( "./check_swap -c 100%" ); # 100% (single threshold, always critical)
42cmp_ok( $result->return_code, "==", 2, 'Get critical because not 100% free' );
43like( $result->output, $failureOutput, "Right output" );
diff --git a/plugins/t/check_users.t b/plugins/t/check_users.t
index 088f3b5..21c3e53 100644
--- a/plugins/t/check_users.t
+++ b/plugins/t/check_users.t
@@ -2,7 +2,7 @@
2# 2#
3# Logged in Users Tests via check_users 3# Logged in Users Tests via check_users
4# 4#
5# Trick: This ckeck requires at least 1 user logged in. These commands should 5# Trick: This check requires at least 1 user logged in. These commands should
6# leave a session open forever in the background: 6# leave a session open forever in the background:
7# 7#
8# $ ssh -tt localhost </dev/null >/dev/null 2>/dev/null & 8# $ ssh -tt localhost </dev/null >/dev/null 2>/dev/null &
@@ -13,10 +13,11 @@ use Test;
13use NPTest; 13use NPTest;
14 14
15use vars qw($tests); 15use vars qw($tests);
16BEGIN {$tests = 8; plan tests => $tests} 16BEGIN {$tests = 12; plan tests => $tests}
17 17
18my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/'; 18my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
19my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/'; 19my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
20my $wrongOptionOutput = '/Usage:/';
20 21
21my $t; 22my $t;
22 23
@@ -24,6 +25,8 @@ $t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
24$t += checkCmd( "./check_users 0 0", 2, $failureOutput ); 25$t += checkCmd( "./check_users 0 0", 2, $failureOutput );
25$t += checkCmd( "./check_users -w 0:1000 -c 0:1000", 0, $successOutput ); 26$t += checkCmd( "./check_users -w 0:1000 -c 0:1000", 0, $successOutput );
26$t += checkCmd( "./check_users -w 0:0 -c 0:0", 2, $failureOutput ); 27$t += checkCmd( "./check_users -w 0:0 -c 0:0", 2, $failureOutput );
28$t += checkCmd( "./check_users -w 0:1000", 3, $wrongOptionOutput);
29$t += checkCmd( "./check_users", 3, $wrongOptionOutput);
27 30
28exit(0) if defined($Test::Harness::VERSION); 31exit(0) if defined($Test::Harness::VERSION);
29exit($tests - $t); 32exit($tests - $t);
diff --git a/plugins/tests/check_curl.t b/plugins/tests/check_curl.t
index 72f2b7c..eaa9f51 100755
--- a/plugins/tests/check_curl.t
+++ b/plugins/tests/check_curl.t
@@ -9,7 +9,7 @@
9# Country Name (2 letter code) [AU]:DE 9# Country Name (2 letter code) [AU]:DE
10# State or Province Name (full name) [Some-State]:Bavaria 10# State or Province Name (full name) [Some-State]:Bavaria
11# Locality Name (eg, city) []:Munich 11# Locality Name (eg, city) []:Munich
12# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Monitoring Plugins 12# Organization Name (eg, company) [Internet Widgets Pty Ltd]:Monitoring Plugins
13# Organizational Unit Name (eg, section) []: 13# Organizational Unit Name (eg, section) []:
14# Common Name (e.g. server FQDN or YOUR name) []:Monitoring Plugins 14# Common Name (e.g. server FQDN or YOUR name) []:Monitoring Plugins
15# Email Address []:devel@monitoring-plugins.org 15# Email Address []:devel@monitoring-plugins.org
@@ -21,7 +21,7 @@ use FindBin qw($Bin);
21 21
22$ENV{'LC_TIME'} = "C"; 22$ENV{'LC_TIME'} = "C";
23 23
24my $common_tests = 73; 24my $common_tests = 75;
25my $ssl_only_tests = 8; 25my $ssl_only_tests = 8;
26# Check that all dependent modules are available 26# Check that all dependent modules are available
27eval "use HTTP::Daemon 6.01;"; 27eval "use HTTP::Daemon 6.01;";
@@ -178,6 +178,11 @@ sub run_server {
178 $c->send_basic_header; 178 $c->send_basic_header;
179 $c->send_crlf; 179 $c->send_crlf;
180 $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' )); 180 $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' ));
181 } elsif ($r->url->path eq "/redirect_rel") {
182 $c->send_basic_header(302);
183 $c->send_header("Location", "/redirect2" );
184 $c->send_crlf;
185 $c->send_response('moved to /redirect2');
181 } elsif ($r->url->path eq "/redir_timeout") { 186 } elsif ($r->url->path eq "/redir_timeout") {
182 $c->send_redirect( "/timeout" ); 187 $c->send_redirect( "/timeout" );
183 } elsif ($r->url->path eq "/timeout") { 188 } elsif ($r->url->path eq "/timeout") {
@@ -471,9 +476,12 @@ sub run_common_tests {
471 is( $result->return_code, 0, $cmd); 476 is( $result->return_code, 0, $cmd);
472 like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); 477 like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
473 478
474 # These tests may block 479 $cmd = "$command -f follow -u /redirect_rel -s redirected";
475 print "ALRM\n"; 480 $result = NPTest->testCmd( $cmd );
481 is( $result->return_code, 0, $cmd);
482 like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
476 483
484 # These tests may block
477 # stickyport - on full urlS port is set back to 80 otherwise 485 # stickyport - on full urlS port is set back to 80 otherwise
478 $cmd = "$command -f stickyport -u /redir_external -t 5 -s redirected"; 486 $cmd = "$command -f stickyport -u /redir_external -t 5 -s redirected";
479 eval { 487 eval {
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t
index 6078b27..6eaf85b 100755
--- a/plugins/tests/check_http.t
+++ b/plugins/tests/check_http.t
@@ -13,7 +13,7 @@ use IO::Socket::INET;
13 13
14$ENV{'LC_TIME'} = "C"; 14$ENV{'LC_TIME'} = "C";
15 15
16my $common_tests = 71; 16my $common_tests = 73;
17my $virtual_port_tests = 8; 17my $virtual_port_tests = 8;
18my $ssl_only_tests = 12; 18my $ssl_only_tests = 12;
19my $chunked_encoding_special_tests = 1; 19my $chunked_encoding_special_tests = 1;
@@ -199,6 +199,11 @@ sub run_server {
199 $c->send_basic_header; 199 $c->send_basic_header;
200 $c->send_crlf; 200 $c->send_crlf;
201 $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' )); 201 $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' ));
202 } elsif ($r->url->path eq "/redirect_rel") {
203 $c->send_basic_header(302);
204 $c->send_header("Location", "/redirect2" );
205 $c->send_crlf;
206 $c->send_response('moved to /redirect2');
202 } elsif ($r->url->path eq "/redir_timeout") { 207 } elsif ($r->url->path eq "/redir_timeout") {
203 $c->send_redirect( "/timeout" ); 208 $c->send_redirect( "/timeout" );
204 } elsif ($r->url->path eq "/timeout") { 209 } elsif ($r->url->path eq "/timeout") {
@@ -515,6 +520,11 @@ sub run_common_tests {
515 is( $result->return_code, 0, $cmd); 520 is( $result->return_code, 0, $cmd);
516 like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output ); 521 like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
517 522
523 $cmd = "$command -f follow -u /redirect_rel -s redirected";
524 $result = NPTest->testCmd( $cmd );
525 is( $result->return_code, 0, $cmd);
526 like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
527
518 # These tests may block 528 # These tests may block
519 print "ALRM\n"; 529 print "ALRM\n";
520 530
diff --git a/plugins/utils.c b/plugins/utils.c
index b4214c6..77d6a6f 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -23,13 +23,15 @@
23*****************************************************************************/ 23*****************************************************************************/
24 24
25#include "common.h" 25#include "common.h"
26#include "utils.h" 26#include "./utils.h"
27#include "utils_base.h" 27#include "utils_base.h"
28#include <stdarg.h> 28#include <stdarg.h>
29#include <limits.h> 29#include <limits.h>
30#include <string.h> 30#include <string.h>
31#include <errno.h> 31#include <errno.h>
32 32
33#include <stdbool.h>
34
33#include <arpa/inet.h> 35#include <arpa/inet.h>
34 36
35extern void print_usage (void); 37extern void print_usage (void);
@@ -147,98 +149,107 @@ print_revision (const char *command_name, const char *revision)
147 command_name, revision, PACKAGE, VERSION); 149 command_name, revision, PACKAGE, VERSION);
148} 150}
149 151
150int 152bool is_numeric (char *number) {
151is_numeric (char *number)
152{
153 char tmp[1]; 153 char tmp[1];
154 float x; 154 float x;
155 155
156 if (!number) 156 if (!number)
157 return FALSE; 157 return false;
158 else if (sscanf (number, "%f%c", &x, tmp) == 1) 158 else if (sscanf (number, "%f%c", &x, tmp) == 1)
159 return TRUE; 159 return true;
160 else 160 else
161 return FALSE; 161 return false;
162} 162}
163 163
164int 164bool is_positive (char *number) {
165is_positive (char *number)
166{
167 if (is_numeric (number) && atof (number) > 0.0) 165 if (is_numeric (number) && atof (number) > 0.0)
168 return TRUE; 166 return true;
169 else 167 else
170 return FALSE; 168 return false;
171} 169}
172 170
173int 171bool is_negative (char *number) {
174is_negative (char *number)
175{
176 if (is_numeric (number) && atof (number) < 0.0) 172 if (is_numeric (number) && atof (number) < 0.0)
177 return TRUE; 173 return true;
178 else 174 else
179 return FALSE; 175 return false;
180} 176}
181 177
182int 178bool is_nonnegative (char *number) {
183is_nonnegative (char *number)
184{
185 if (is_numeric (number) && atof (number) >= 0.0) 179 if (is_numeric (number) && atof (number) >= 0.0)
186 return TRUE; 180 return true;
187 else 181 else
188 return FALSE; 182 return false;
189} 183}
190 184
191int 185bool is_percentage (char *number) {
192is_percentage (char *number)
193{
194 int x; 186 int x;
195 if (is_numeric (number) && (x = atof (number)) >= 0 && x <= 100) 187 if (is_numeric (number) && (x = atof (number)) >= 0 && x <= 100)
196 return TRUE; 188 return true;
197 else 189 else
198 return FALSE; 190 return false;
199} 191}
200 192
201int 193bool is_percentage_expression (const char str[]) {
202is_integer (char *number) 194 if (!str) {
203{ 195 return false;
196 }
197
198 size_t len = strlen(str);
199
200 if (str[len-1] != '%') {
201 return false;
202 }
203
204 char *foo = calloc(sizeof(char), len + 1);
205
206 if (!foo) {
207 die (STATE_UNKNOWN, _("calloc failed \n"));
208 }
209
210 strcpy(foo, str);
211 foo[len-1] = '\0';
212
213 bool result = is_numeric(foo);
214
215 free(foo);
216
217 return result;
218}
219
220bool is_integer (char *number) {
204 long int n; 221 long int n;
205 222
206 if (!number || (strspn (number, "-0123456789 ") != strlen (number))) 223 if (!number || (strspn (number, "-0123456789 ") != strlen (number)))
207 return FALSE; 224 return false;
208 225
209 n = strtol (number, NULL, 10); 226 n = strtol (number, NULL, 10);
210 227
211 if (errno != ERANGE && n >= INT_MIN && n <= INT_MAX) 228 if (errno != ERANGE && n >= INT_MIN && n <= INT_MAX)
212 return TRUE; 229 return true;
213 else 230 else
214 return FALSE; 231 return false;
215} 232}
216 233
217int 234bool is_intpos (char *number) {
218is_intpos (char *number)
219{
220 if (is_integer (number) && atoi (number) > 0) 235 if (is_integer (number) && atoi (number) > 0)
221 return TRUE; 236 return true;
222 else 237 else
223 return FALSE; 238 return false;
224} 239}
225 240
226int 241bool is_intneg (char *number) {
227is_intneg (char *number)
228{
229 if (is_integer (number) && atoi (number) < 0) 242 if (is_integer (number) && atoi (number) < 0)
230 return TRUE; 243 return true;
231 else 244 else
232 return FALSE; 245 return false;
233} 246}
234 247
235int 248bool is_intnonneg (char *number) {
236is_intnonneg (char *number)
237{
238 if (is_integer (number) && atoi (number) >= 0) 249 if (is_integer (number) && atoi (number) >= 0)
239 return TRUE; 250 return true;
240 else 251 else
241 return FALSE; 252 return false;
242} 253}
243 254
244/* 255/*
@@ -246,19 +257,27 @@ is_intnonneg (char *number)
246 * On success the number will be written to the _target_ address, if _target_ is not set 257 * On success the number will be written to the _target_ address, if _target_ is not set
247 * to NULL. 258 * to NULL.
248 */ 259 */
249int is_int64(char *number, int64_t *target) { 260bool is_int64(char *number, int64_t *target) {
250 errno = 0; 261 errno = 0;
251 uint64_t tmp = strtoll(number, NULL, 10); 262 char *endptr = { 0 };
263
264 int64_t tmp = strtoll(number, &endptr, 10);
252 if (errno != 0) { 265 if (errno != 0) {
266 return false;
267 }
268
269 if (*endptr == '\0') {
253 return 0; 270 return 0;
254 } 271 }
272
255 if (tmp < INT64_MIN || tmp > INT64_MAX) { 273 if (tmp < INT64_MIN || tmp > INT64_MAX) {
256 return 0; 274 return false;
257 } 275 }
276
258 if (target != NULL) { 277 if (target != NULL) {
259 *target = tmp; 278 *target = tmp;
260 } 279 }
261 return 1; 280 return true;
262} 281}
263 282
264/* 283/*
@@ -266,40 +285,45 @@ int is_int64(char *number, int64_t *target) {
266 * On success the number will be written to the _target_ address, if _target_ is not set 285 * On success the number will be written to the _target_ address, if _target_ is not set
267 * to NULL. 286 * to NULL.
268 */ 287 */
269int is_uint64(char *number, uint64_t *target) { 288bool is_uint64(char *number, uint64_t *target) {
270 errno = 0; 289 errno = 0;
271 uint64_t tmp = strtoll(number, NULL, 10); 290 char *endptr = { 0 };
291 unsigned long long tmp = strtoull(number, &endptr, 10);
292
272 if (errno != 0) { 293 if (errno != 0) {
273 return 0; 294 return false;
274 } 295 }
275 if (tmp < 0 || tmp > UINT64_MAX) { 296
276 return 0; 297 if (*endptr != '\0') {
298 return false;
299 }
300
301 if (tmp > UINT64_MAX) {
302 return false;
277 } 303 }
304
278 if (target != NULL) { 305 if (target != NULL) {
279 *target = tmp; 306 *target = (uint64_t)tmp;
280 } 307 }
281 return 1; 308
309 return true;
282} 310}
283 311
284int 312bool is_intpercent (char *number) {
285is_intpercent (char *number)
286{
287 int i; 313 int i;
288 if (is_integer (number) && (i = atoi (number)) >= 0 && i <= 100) 314 if (is_integer (number) && (i = atoi (number)) >= 0 && i <= 100)
289 return TRUE; 315 return true;
290 else 316 else
291 return FALSE; 317 return false;
292} 318}
293 319
294int 320bool is_option (char *str) {
295is_option (char *str)
296{
297 if (!str) 321 if (!str)
298 return FALSE; 322 return false;
299 else if (strspn (str, "-") == 1 || strspn (str, "-") == 2) 323 else if (strspn (str, "-") == 1 || strspn (str, "-") == 2)
300 return TRUE; 324 return true;
301 else 325 else
302 return FALSE; 326 return false;
303} 327}
304 328
305#ifdef NEED_GETTIMEOFDAY 329#ifdef NEED_GETTIMEOFDAY
@@ -804,19 +828,3 @@ char *sperfdata_int (const char *label,
804 828
805 return data; 829 return data;
806} 830}
807
808int
809open_max (void)
810{
811 errno = 0;
812 if (maxfd > 0)
813 return(maxfd);
814
815 if ((maxfd = sysconf (_SC_OPEN_MAX)) < 0) {
816 if (errno == 0)
817 maxfd = DEFAULT_MAXFD; /* it's indeterminate */
818 else
819 die (STATE_UNKNOWN, _("sysconf error for _SC_OPEN_MAX\n"));
820 }
821 return(maxfd);
822}
diff --git a/plugins/utils.h b/plugins/utils.h
index c76b321..f939e33 100644
--- a/plugins/utils.h
+++ b/plugins/utils.h
@@ -16,6 +16,8 @@ suite of plugins. */
16/* now some functions etc are being defined in ../lib/utils_base.c */ 16/* now some functions etc are being defined in ../lib/utils_base.c */
17#include "utils_base.h" 17#include "utils_base.h"
18 18
19#include <stdbool.h>
20
19 21
20#ifdef NP_EXTRA_OPTS 22#ifdef NP_EXTRA_OPTS
21/* Include extra-opts functions if compiled in */ 23/* Include extra-opts functions if compiled in */
@@ -34,21 +36,22 @@ extern time_t start_time, end_time;
34 36
35/* Test input types */ 37/* Test input types */
36 38
37int is_integer (char *); 39bool is_integer (char *);
38int is_intpos (char *); 40bool is_intpos (char *);
39int is_intneg (char *); 41bool is_intneg (char *);
40int is_intnonneg (char *); 42bool is_intnonneg (char *);
41int is_intpercent (char *); 43bool is_intpercent (char *);
42int is_uint64(char *number, uint64_t *target); 44bool is_uint64(char *number, uint64_t *target);
43int is_int64(char *number, int64_t *target); 45bool is_int64(char *number, int64_t *target);
44 46
45int is_numeric (char *); 47bool is_numeric (char *);
46int is_positive (char *); 48bool is_positive (char *);
47int is_negative (char *); 49bool is_negative (char *);
48int is_nonnegative (char *); 50bool is_nonnegative (char *);
49int is_percentage (char *); 51bool is_percentage (char *);
52bool is_percentage_expression (const char[]);
50 53
51int is_option (char *); 54bool is_option (char *);
52 55
53/* Generalized timer that will do milliseconds if available */ 56/* Generalized timer that will do milliseconds if available */
54#ifndef HAVE_STRUCT_TIMEVAL 57#ifndef HAVE_STRUCT_TIMEVAL
@@ -106,8 +109,6 @@ char *sperfdata (const char *, double, const char *, char *, char *,
106char *sperfdata_int (const char *, int, const char *, char *, char *, 109char *sperfdata_int (const char *, int, const char *, char *, char *,
107 int, int, int, int); 110 int, int, int, int);
108 111
109int open_max (void);
110
111/* The idea here is that, although not every plugin will use all of these, 112/* The idea here is that, although not every plugin will use all of these,
112 most will or should. Therefore, for consistency, these very common 113 most will or should. Therefore, for consistency, these very common
113 options should have only these meanings throughout the overall suite */ 114 options should have only these meanings throughout the overall suite */
diff --git a/po/ChangeLog b/po/ChangeLog
deleted file mode 100644
index 1074102..0000000
--- a/po/ChangeLog
+++ /dev/null
@@ -1,11 +0,0 @@
12003-07-02 gettextize <bug-gnu-gettext@gnu.org>
2
3 * Makefile.in.in: New file, from gettext-0.11.4.
4 * boldquot.sed: New file, from gettext-0.11.4.
5 * en@boldquot.header: New file, from gettext-0.11.4.
6 * en@quot.header: New file, from gettext-0.11.4.
7 * insert-header.sin: New file, from gettext-0.11.4.
8 * quot.sed: New file, from gettext-0.11.4.
9 * remove-potcdate.sin: New file, from gettext-0.11.4.
10 * Rules-quot: New file, from gettext-0.11.4.
11
diff --git a/po/LINGUAS b/po/LINGUAS
deleted file mode 100644
index 1ce0c39..0000000
--- a/po/LINGUAS
+++ /dev/null
@@ -1,2 +0,0 @@
1fr de
2
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
deleted file mode 100644
index 82864b2..0000000
--- a/po/Makefile.in.in
+++ /dev/null
@@ -1,395 +0,0 @@
1# -*- buffer-read-only: t -*- vi: set ro:
2# DO NOT EDIT! GENERATED AUTOMATICALLY!
3# Makefile for PO directory in any package using GNU gettext.
4# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
5#
6# This file can be copied and used freely without restrictions. It can
7# be used in projects which are not available under the GNU General Public
8# License but which still want to provide support for the GNU gettext
9# functionality.
10# Please note that the actual code of GNU gettext is covered by the GNU
11# General Public License and is *not* in the public domain.
12#
13# Origin: gettext-0.15
14
15PACKAGE = @PACKAGE@
16VERSION = @VERSION@
17PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
18
19SHELL = /bin/sh
20@SET_MAKE@
21
22srcdir = @srcdir@
23top_srcdir = @top_srcdir@
24VPATH = @srcdir@
25
26prefix = @prefix@
27exec_prefix = @exec_prefix@
28datarootdir = @datarootdir@
29datadir = @datadir@
30localedir = @localedir@
31gettextsrcdir = $(datadir)/gettext/po
32
33INSTALL = @INSTALL@
34INSTALL_DATA = @INSTALL_DATA@
35mkinstalldirs = $(SHELL) @install_sh@ -d
36mkdir_p = @MKDIR_P@
37
38GMSGFMT_ = @GMSGFMT@
39GMSGFMT_no = @GMSGFMT@
40GMSGFMT_yes = @GMSGFMT_015@
41GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
42MSGFMT_ = @MSGFMT@
43MSGFMT_no = @MSGFMT@
44MSGFMT_yes = @MSGFMT_015@
45MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
46XGETTEXT_ = @XGETTEXT@
47XGETTEXT_no = @XGETTEXT@
48XGETTEXT_yes = @XGETTEXT_015@
49XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
50MSGMERGE = msgmerge
51MSGMERGE_UPDATE = @MSGMERGE@ --update
52MSGINIT = msginit
53MSGCONV = msgconv
54MSGFILTER = msgfilter
55
56POFILES = @POFILES@
57GMOFILES = @GMOFILES@
58UPDATEPOFILES = @UPDATEPOFILES@
59DUMMYPOFILES = @DUMMYPOFILES@
60DISTFILES.common = Makefile.in.in remove-potcdate.sin \
61$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
62DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
63$(POFILES) $(GMOFILES) \
64$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
65
66POTFILES = \
67
68CATALOGS = @CATALOGS@
69
70# Makevars gets inserted here. (Don't remove this line!)
71
72.SUFFIXES:
73.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
74
75.po.mo:
76 @echo "$(MSGFMT) -c -o $@ $<"; \
77 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
78
79.po.gmo:
80 @lang=`echo $* | sed -e 's,.*/,,'`; \
81 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
82 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
83 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
84
85.sin.sed:
86 sed -e '/^#/d' $< > t-$@
87 mv t-$@ $@
88
89
90all: all-@USE_NLS@
91
92all-yes: stamp-po
93all-no:
94
95# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
96# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
97# we don't want to bother translators with empty POT files). We assume that
98# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
99# In this case, stamp-po is a nop (i.e. a phony target).
100
101# stamp-po is a timestamp denoting the last time at which the CATALOGS have
102# been loosely updated. Its purpose is that when a developer or translator
103# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
104# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
105# invocations of "make" will do nothing. This timestamp would not be necessary
106# if updating the $(CATALOGS) would always touch them; however, the rule for
107# $(POFILES) has been designed to not touch files that don't need to be
108# changed.
109stamp-po: $(srcdir)/$(DOMAIN).pot
110 test ! -f $(srcdir)/$(DOMAIN).pot || \
111 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
112 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
113 echo "touch stamp-po" && \
114 echo timestamp > stamp-poT && \
115 mv stamp-poT stamp-po; \
116 }
117
118# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
119# otherwise packages like GCC can not be built if only parts of the source
120# have been downloaded.
121
122# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
123# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
124$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
125 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
126 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
127 else \
128 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
129 fi; \
130 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
131 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
132 --files-from=$(srcdir)/POTFILES.in \
133 --copyright-holder='$(COPYRIGHT_HOLDER)' \
134 --msgid-bugs-address="$$msgid_bugs_address"
135 test ! -f $(DOMAIN).po || { \
136 if test -f $(srcdir)/$(DOMAIN).pot; then \
137 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
138 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
139 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
140 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
141 else \
142 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
143 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
144 fi; \
145 else \
146 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
147 fi; \
148 }
149
150# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
151# every "make" invocation, only create it when it is missing.
152# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
153$(srcdir)/$(DOMAIN).pot:
154 $(MAKE) $(DOMAIN).pot-update
155
156# This target rebuilds a PO file if $(DOMAIN).pot has changed.
157# Note that a PO file is not touched if it doesn't need to be changed.
158$(POFILES): $(srcdir)/$(DOMAIN).pot
159 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
160 if test -f "$(srcdir)/$${lang}.po"; then \
161 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
162 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
163 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
164 else \
165 $(MAKE) $${lang}.po-create; \
166 fi
167
168
169install: install-exec install-data
170install-exec:
171install-data: install-data-@USE_NLS@
172 if test "$(PACKAGE)" = "gettext-tools"; then \
173 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
174 for file in $(DISTFILES.common) Makevars.template; do \
175 $(INSTALL_DATA) $(srcdir)/$$file \
176 $(DESTDIR)$(gettextsrcdir)/$$file; \
177 done; \
178 for file in Makevars; do \
179 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
180 done; \
181 else \
182 : ; \
183 fi
184install-data-no: all
185install-data-yes: all
186 $(mkdir_p) $(DESTDIR)$(datadir)
187 @catalogs='$(CATALOGS)'; \
188 for cat in $$catalogs; do \
189 cat=`basename $$cat`; \
190 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
191 dir=$(localedir)/$$lang/LC_MESSAGES; \
192 $(mkdir_p) $(DESTDIR)$$dir; \
193 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
194 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
195 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
196 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
197 if test -n "$$lc"; then \
198 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
199 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
200 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
201 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
202 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
203 for file in *; do \
204 if test -f $$file; then \
205 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
206 fi; \
207 done); \
208 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
209 else \
210 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
211 :; \
212 else \
213 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
214 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
215 fi; \
216 fi; \
217 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
218 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
219 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
220 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
221 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
222 fi; \
223 done; \
224 done
225
226install-strip: install
227
228installdirs: installdirs-exec installdirs-data
229installdirs-exec:
230installdirs-data: installdirs-data-@USE_NLS@
231 if test "$(PACKAGE)" = "gettext-tools"; then \
232 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
233 else \
234 : ; \
235 fi
236installdirs-data-no:
237installdirs-data-yes:
238 $(mkdir_p) $(DESTDIR)$(datadir)
239 @catalogs='$(CATALOGS)'; \
240 for cat in $$catalogs; do \
241 cat=`basename $$cat`; \
242 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
243 dir=$(localedir)/$$lang/LC_MESSAGES; \
244 $(mkdir_p) $(DESTDIR)$$dir; \
245 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
246 if test -n "$$lc"; then \
247 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
248 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
249 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
250 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
251 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
252 for file in *; do \
253 if test -f $$file; then \
254 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
255 fi; \
256 done); \
257 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
258 else \
259 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
260 :; \
261 else \
262 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
263 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
264 fi; \
265 fi; \
266 fi; \
267 done; \
268 done
269
270# Define this as empty until I found a useful application.
271installcheck:
272
273uninstall: uninstall-exec uninstall-data
274uninstall-exec:
275uninstall-data: uninstall-data-@USE_NLS@
276 if test "$(PACKAGE)" = "gettext-tools"; then \
277 for file in $(DISTFILES.common) Makevars.template; do \
278 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
279 done; \
280 else \
281 : ; \
282 fi
283uninstall-data-no:
284uninstall-data-yes:
285 catalogs='$(CATALOGS)'; \
286 for cat in $$catalogs; do \
287 cat=`basename $$cat`; \
288 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
289 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
290 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
291 done; \
292 done
293
294check: all
295
296info dvi ps pdf html tags TAGS ctags CTAGS ID:
297
298mostlyclean:
299 rm -f remove-potcdate.sed
300 rm -f stamp-poT
301 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
302 rm -fr *.o
303
304clean: mostlyclean
305
306distclean: clean
307 rm -f Makefile Makefile.in POTFILES *.mo
308
309maintainer-clean: distclean
310 @echo "This command is intended for maintainers to use;"
311 @echo "it deletes files that may require special tools to rebuild."
312 rm -f stamp-po $(GMOFILES)
313
314distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
315dist distdir:
316 $(MAKE) update-po
317 @$(MAKE) dist2
318# This is a separate target because 'update-po' must be executed before.
319dist2: stamp-po $(DISTFILES)
320 dists="$(DISTFILES)"; \
321 if test "$(PACKAGE)" = "gettext-tools"; then \
322 dists="$$dists Makevars.template"; \
323 fi; \
324 if test -f $(srcdir)/$(DOMAIN).pot; then \
325 dists="$$dists $(DOMAIN).pot stamp-po"; \
326 fi; \
327 if test -f $(srcdir)/ChangeLog; then \
328 dists="$$dists ChangeLog"; \
329 fi; \
330 for i in 0 1 2 3 4 5 6 7 8 9; do \
331 if test -f $(srcdir)/ChangeLog.$$i; then \
332 dists="$$dists ChangeLog.$$i"; \
333 fi; \
334 done; \
335 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
336 for file in $$dists; do \
337 if test -f $$file; then \
338 cp -p $$file $(distdir) || exit 1; \
339 else \
340 cp -p $(srcdir)/$$file $(distdir) || exit 1; \
341 fi; \
342 done
343
344update-po: Makefile
345 $(MAKE) $(DOMAIN).pot-update
346 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
347 $(MAKE) update-gmo
348
349# General rule for creating PO files.
350
351.nop.po-create:
352 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
353 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
354 exit 1
355
356# General rule for updating PO files.
357
358.nop.po-update:
359 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
360 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
361 tmpdir=`pwd`; \
362 echo "$$lang:"; \
363 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
364 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
365 cd $(srcdir); \
366 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
367 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
368 rm -f $$tmpdir/$$lang.new.po; \
369 else \
370 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
371 :; \
372 else \
373 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
374 exit 1; \
375 fi; \
376 fi; \
377 else \
378 echo "msgmerge for $$lang.po failed!" 1>&2; \
379 rm -f $$tmpdir/$$lang.new.po; \
380 fi
381
382$(DUMMYPOFILES):
383
384update-gmo: Makefile $(GMOFILES)
385 @:
386
387Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
388 cd $(top_builddir) \
389 && $(SHELL) ./config.status $(subdir)/$@.in po-directories
390
391force:
392
393# Tell versions [3.59,3.63) of GNU make not to export all variables.
394# Otherwise a system limit (for SysV at least) may be exceeded.
395.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
deleted file mode 100644
index b35f5ad..0000000
--- a/po/Makevars
+++ /dev/null
@@ -1,29 +0,0 @@
1# Makefile variables for PO directory in any package using GNU gettext.
2
3# Usually the message domain is the same as the package name.
4DOMAIN = $(PACKAGE)
5
6# These two variables depend on the location of this directory.
7subdir = po
8top_builddir = ..
9
10# These options get passed to xgettext.
11XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --no-location
12
13# This is the copyright holder that gets inserted into the header of the
14# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15# package. (Note that the msgstr strings, extracted from the package's
16# sources, belong to the copyright holder of the package.) Translators are
17# expected to transfer the copyright for their translations to this person
18# or entity, or to disclaim their copyright. The empty string stands for
19# the public domain; in this case the translators are expected to disclaim
20# their copyright.
21COPYRIGHT_HOLDER = Monitoring Plugins Development Team
22
23# This is the list of locale categories, beyond LC_MESSAGES, for which the
24# message catalogs shall be used. It is usually empty.
25EXTRA_LOCALE_CATEGORIES =
26
27# Email address were to send bug report for the .po translation files
28PACKAGE_BUGREPORT = devel@monitoring-plugins.org
29
diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644
index 6e491d7..0000000
--- a/po/POTFILES.in
+++ /dev/null
@@ -1,44 +0,0 @@
1plugins/check_by_ssh.c
2plugins/check_cluster.c
3plugins/check_dig.c
4plugins/check_disk.c
5plugins/check_dns.c
6plugins/check_dummy.c
7plugins/check_fping.c
8plugins/check_game.c
9plugins/check_hpjd.c
10plugins/check_http.c
11plugins/check_ldap.c
12plugins/check_load.c
13plugins/check_mrtg.c
14plugins/check_mrtgtraf.c
15plugins/check_mysql.c
16plugins/check_nagios.c
17plugins/check_nt.c
18plugins/check_ntp.c
19plugins/check_ntp_peer.c
20plugins/check_ntp_time.c
21plugins/check_nwstat.c
22plugins/check_overcr.c
23plugins/check_pgsql.c
24plugins/check_ping.c
25plugins/check_procs.c
26plugins/check_radius.c
27plugins/check_real.c
28plugins/check_smtp.c
29plugins/check_snmp.c
30plugins/check_ssh.c
31plugins/check_swap.c
32plugins/check_tcp.c
33plugins/check_time.c
34plugins/check_ups.c
35plugins/check_users.c
36plugins/check_ide_smart.c
37plugins/negate.c
38plugins/netutils.c
39plugins/popen.c
40plugins/urlize.c
41plugins/utils.c
42plugins/utils.h
43plugins-root/check_dhcp.c
44plugins-root/check_icmp.c
diff --git a/po/de.po b/po/de.po
deleted file mode 100644
index d597203..0000000
--- a/po/de.po
+++ /dev/null
@@ -1,5393 +0,0 @@
1# translation of de.po to
2# German Language Translation File.
3# This file is distributed under the same license as the nagios-plugins package.
4# Copyright (C) 2023 Nagios Plugin Development Group.
5# Karl DeBisschop <kdebisschop@users.sourceforge.net>, 2003, 2004.
6#
7#
8msgid ""
9msgstr ""
10"Project-Id-Version: PACKAGE VERSION\n"
11"Report-Msgid-Bugs-To: devel@monitoring-plugins.org\n"
12"POT-Creation-Date: 2023-09-05 00:31+0200\n"
13"PO-Revision-Date: 2004-12-23 17:46+0100\n"
14"Last-Translator: \n"
15"Language-Team: Monitoring Plugin Development Team <devel@monitoring-plugins.org>\n"
16"Language: de\n"
17"MIME-Version: 1.0\n"
18"Content-Type: text/plain; charset=UTF-8\n"
19"Content-Transfer-Encoding: 8bit\n"
20"Plural-Forms: nplurals=2; plural=(n > 1);\n"
21"X-Generator: KBabel 1.3.1\n"
22
23msgid "Could not parse arguments"
24msgstr "Argumente konnten nicht ausgewertet werden"
25
26msgid "Cannot catch SIGALRM"
27msgstr "Konnte SIGALRM nicht erhalten"
28
29#, c-format
30msgid "SSH connection failed: %s\n"
31msgstr ""
32
33#, c-format
34msgid "Remote command execution failed: %s\n"
35msgstr ""
36
37#, c-format
38msgid "%s - check_by_ssh: Remote command '%s' returned status %d\n"
39msgstr ""
40
41#, c-format
42msgid "SSH WARNING: could not open %s\n"
43msgstr "SSH WARNING: Konnte %s nicht öffnen\n"
44
45#, c-format
46msgid "%s: Error parsing output\n"
47msgstr ""
48
49msgid "Timeout interval must be a positive integer"
50msgstr "Timeout interval muss ein positiver Integer sein"
51
52msgid "Port must be a positive integer"
53msgstr "Port muss ein positiver Integer sein"
54
55#, fuzzy
56msgid "skip-stdout argument must be an integer"
57msgstr "skip-stdout argument muss ein Integer sein"
58
59#, fuzzy
60msgid "skip-stderr argument must be an integer"
61msgstr "skip-stderr argument muss ein Integer sein"
62
63#, c-format
64msgid "%s: You must provide a host name\n"
65msgstr "%s: Hostname muss angegeben werden\n"
66
67msgid "No remotecmd"
68msgstr "Kein remotecm"
69
70#, c-format
71msgid "%s: Argument limit of %d exceeded\n"
72msgstr ""
73
74#, fuzzy
75msgid "Can not (re)allocate 'commargv' buffer\n"
76msgstr "Konnte·url·nicht·zuweisen\n"
77
78#, c-format
79msgid ""
80"%s: In passive mode, you must provide a service name for each command.\n"
81msgstr ""
82"%s: Im passive mode muss ein Servicename für jeden Befehl angegeben werden.\n"
83
84#, fuzzy, c-format
85msgid ""
86"%s: In passive mode, you must provide the host short name from the "
87"monitoring configs.\n"
88msgstr ""
89"%s: Im passive mode muss der \"host short name\" aus der Nagios "
90"Konfiguration angegeben werden\n"
91
92#, fuzzy, c-format
93msgid "This plugin uses SSH to execute commands on a remote host"
94msgstr ""
95"Dieses Plugin nutzt SSH um Befehle auf dem entfernten Rechner auszuführen\n"
96"\n"
97
98msgid "tell ssh to use Protocol 1 [optional]"
99msgstr ""
100
101msgid "tell ssh to use Protocol 2 [optional]"
102msgstr ""
103
104msgid "Ignore all or (if specified) first n lines on STDOUT [optional]"
105msgstr ""
106
107msgid "Ignore all or (if specified) first n lines on STDERR [optional]"
108msgstr ""
109
110msgid "Exit with an warning, if there is an output on STDERR"
111msgstr ""
112
113msgid ""
114"tells ssh to fork rather than create a tty [optional]. This will always "
115"return OK if ssh is executed"
116msgstr ""
117
118msgid "command to execute on the remote machine"
119msgstr ""
120
121msgid "SSH user name on remote host [optional]"
122msgstr ""
123
124msgid "identity of an authorized key [optional]"
125msgstr ""
126
127msgid "external command file for monitoring [optional]"
128msgstr ""
129
130msgid "list of monitoring service names, separated by ':' [optional]"
131msgstr ""
132
133msgid "short name of host in the monitoring configuration [optional]"
134msgstr ""
135
136msgid "Call ssh with '-o OPTION' (may be used multiple times) [optional]"
137msgstr ""
138
139msgid "Tell ssh to use this configfile [optional]"
140msgstr ""
141
142msgid "Tell ssh to suppress warning and diagnostic messages [optional]"
143msgstr ""
144
145msgid "Make connection problems return UNKNOWN instead of CRITICAL"
146msgstr ""
147
148msgid "The most common mode of use is to refer to a local identity file with"
149msgstr ""
150
151msgid "the '-i' option. In this mode, the identity pair should have a null"
152msgstr ""
153
154msgid "passphrase and the public key should be listed in the authorized_keys"
155msgstr ""
156
157msgid "file of the remote host. Usually the key will be restricted to running"
158msgstr ""
159
160msgid "only one command on the remote server. If the remote SSH server tracks"
161msgstr ""
162
163msgid "invocation arguments, the one remote program may be an agent that can"
164msgstr ""
165
166msgid "execute additional commands as proxy"
167msgstr ""
168
169msgid "To use passive mode, provide multiple '-C' options, and provide"
170msgstr ""
171
172msgid ""
173"all of -O, -s, and -n options (servicelist order must match '-C'options)"
174msgstr ""
175
176msgid "Examples:"
177msgstr ""
178
179msgid "Usage:"
180msgstr ""
181
182#, c-format
183msgid "Host/Service Cluster Plugin for Monitoring"
184msgstr ""
185
186msgid "Options:"
187msgstr ""
188
189msgid "Check service cluster status"
190msgstr ""
191
192msgid "Check host cluster status"
193msgstr ""
194
195msgid "Optional prepended text output (i.e. \"Host cluster\")"
196msgstr ""
197
198msgid "Specifies the range of hosts or services in cluster that must be in a"
199msgstr ""
200
201msgid "non-OK state in order to return a WARNING status level"
202msgstr ""
203
204msgid "non-OK state in order to return a CRITICAL status level"
205msgstr ""
206
207msgid "The status codes of the hosts or services in the cluster, separated by"
208msgstr ""
209
210msgid "commas"
211msgstr ""
212
213msgid "Notes:"
214msgstr ""
215
216msgid ""
217"Will alert critical if there are 3 or more service data points in a non-OK"
218msgstr ""
219
220msgid "state."
221msgstr ""
222
223#, c-format
224msgid "Looking for: '%s'\n"
225msgstr ""
226
227msgid "dig returned an error status"
228msgstr "dig hat einen Fehler zurückgegeben"
229
230msgid "Server not found in ANSWER SECTION"
231msgstr "Server nicht gefunden in ANSWER SECTION"
232
233msgid "No ANSWER SECTION found"
234msgstr "Keine ANSWER SECTION gefunden"
235
236#, fuzzy
237msgid "Probably a non-existent host/domain"
238msgstr "nicht existierender Host/Domain"
239
240#, fuzzy, c-format
241msgid "Port must be a positive integer - %s"
242msgstr "Port muss ein positiver Integer sein - %s"
243
244#, fuzzy, c-format
245msgid "Warning interval must be a positive integer - %s"
246msgstr "Warning interval muss ein positiver Integer sein - %s"
247
248#, fuzzy, c-format
249msgid "Critical interval must be a positive integer - %s"
250msgstr "Critical interval muss ein positiver Integer sein - %s"
251
252#, fuzzy, c-format
253msgid "Timeout interval must be a positive integer - %s"
254msgstr "Timeout interval muss ein positiver Integer sein - %s"
255
256#, fuzzy, c-format
257msgid "This plugin tests the DNS service on the specified host using dig"
258msgstr "Testet den DNS Dienst auf dem angegebenen Host mit dig"
259
260msgid "Force dig to only use IPv4 query transport"
261msgstr ""
262
263msgid "Force dig to only use IPv6 query transport"
264msgstr ""
265
266#, fuzzy
267msgid "Machine name to lookup"
268msgstr "zu prüfender Hostname"
269
270#, fuzzy
271msgid "Record type to lookup (default: A)"
272msgstr "abzufragender Datensatztyp (Default: A)"
273
274#, fuzzy
275msgid ""
276"An address expected to be in the answer section. If not set, uses whatever"
277msgstr ""
278"Adresse die in der ANSWER SECTION erwartet wird.wenn nicht gesetzt, "
279"ubernommen aus -l"
280
281msgid "was in -l"
282msgstr ""
283
284msgid "Pass STRING as argument(s) to dig"
285msgstr ""
286
287#, fuzzy, c-format
288msgid "DISK %s: %s not found\n"
289msgstr "%s [%s nicht gefunden]"
290
291#, c-format
292msgid "CRITICAL"
293msgstr "CRITICAL"
294
295#, c-format
296msgid "unit type %s not known\n"
297msgstr "unbekannter unit type: %s\n"
298
299#, c-format
300msgid "failed allocating storage for '%s'\n"
301msgstr "konnte keinen Speicher für '%s' reservieren\n"
302
303#, c-format
304msgid "UNKNOWN"
305msgstr "UNKNOWN"
306
307msgid "Must set a threshold value before using -p\n"
308msgstr ""
309
310msgid "Must set -E before selecting paths\n"
311msgstr ""
312
313msgid "Must set group value before selecting paths\n"
314msgstr ""
315
316msgid ""
317"Paths need to be selected before using -i/-I. Use -A to select all paths "
318"explicitly"
319msgstr ""
320
321msgid "Could not compile regular expression"
322msgstr ""
323
324msgid "Must set a threshold value before using -r/-R\n"
325msgstr ""
326
327msgid "Regular expression did not match any path or disk"
328msgstr ""
329
330#, fuzzy
331msgid "Unknown argument"
332msgstr "Unbekanntes Argument"
333
334#, c-format
335msgid " for %s\n"
336msgstr ""
337
338#, fuzzy
339msgid ""
340"This plugin checks the amount of used disk space on a mounted file system"
341msgstr ""
342"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem"
343
344#, fuzzy
345msgid ""
346"and generates an alert if free space is less than one of the threshold values"
347msgstr ""
348"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
349"unterschritten wird."
350
351msgid "Exit with WARNING status if less than INTEGER units of disk are free"
352msgstr ""
353
354msgid "Exit with WARNING status if less than PERCENT of disk space is free"
355msgstr ""
356
357msgid "Exit with CRITICAL status if less than INTEGER units of disk are free"
358msgstr ""
359
360msgid "Exit with CRITICAL status if less than PERCENT of disk space is free"
361msgstr ""
362
363msgid "Exit with WARNING status if less than PERCENT of inode space is free"
364msgstr ""
365
366msgid "Exit with CRITICAL status if less than PERCENT of inode space is free"
367msgstr ""
368
369msgid ""
370"Mount point or block device as emitted by the mount(8) command (may be "
371"repeated)"
372msgstr ""
373
374msgid "Ignore device (only works if -p unspecified)"
375msgstr ""
376
377msgid "Clear thresholds"
378msgstr ""
379
380msgid "For paths or partitions specified with -p, only check for exact paths"
381msgstr ""
382
383msgid "Display only devices/mountpoints with errors"
384msgstr ""
385
386msgid "Don't account root-reserved blocks into freespace in perfdata"
387msgstr ""
388
389msgid "Display inode usage in perfdata"
390msgstr ""
391
392msgid ""
393"Group paths. Thresholds apply to (free-)space of all partitions together"
394msgstr ""
395
396msgid "Same as '--units kB'"
397msgstr ""
398
399msgid "Only check local filesystems"
400msgstr ""
401
402msgid ""
403"Only check local filesystems against thresholds. Yet call stat on remote "
404"filesystems"
405msgstr ""
406
407msgid "to test if they are accessible (e.g. to detect Stale NFS Handles)"
408msgstr ""
409
410msgid "Display the (block) device instead of the mount point"
411msgstr ""
412
413msgid "Same as '--units MB'"
414msgstr ""
415
416msgid "Explicitly select all paths. This is equivalent to -R '.*'"
417msgstr ""
418
419msgid ""
420"Case insensitive regular expression for path/partition (may be repeated)"
421msgstr ""
422
423msgid "Regular expression for path or partition (may be repeated)"
424msgstr ""
425
426msgid ""
427"Regular expression to ignore selected path/partition (case insensitive) (may "
428"be repeated)"
429msgstr ""
430
431msgid ""
432"Regular expression to ignore selected path or partition (may be repeated)"
433msgstr ""
434
435msgid ""
436"Return OK if no filesystem matches, filesystem does not exist or is "
437"inaccessible."
438msgstr ""
439
440msgid "(Provide this option before -p / -r / --ereg-path if used)"
441msgstr ""
442
443msgid "Choose bytes, kB, MB, GB, TB (default: MB)"
444msgstr ""
445
446msgid "Ignore all filesystems of indicated type (may be repeated)"
447msgstr ""
448
449msgid "Check only filesystems of indicated type (may be repeated)"
450msgstr ""
451
452msgid "Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"
453msgstr ""
454
455msgid ""
456"Checks all filesystems not matching -r at 100M and 50M. The fs matching the -"
457"r regex"
458msgstr ""
459
460msgid ""
461"are grouped which means the freespace thresholds are applied to all disks "
462"together"
463msgstr ""
464
465msgid ""
466"Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use "
467"100M/50M"
468msgstr ""
469
470#, c-format
471msgid "%s %s: %s\n"
472msgstr ""
473
474msgid "is not accessible"
475msgstr ""
476
477#, fuzzy
478msgid "nslookup returned an error status"
479msgstr "nslookup hat einen Fehler zurückgegeben"
480
481msgid "Warning plugin error"
482msgstr "Warnung Plugin Fehler"
483
484#, fuzzy, c-format
485msgid "DNS CRITICAL - '%s' returned empty server string\n"
486msgstr "DNS CRITICAL - '%s' hat einen leeren Hostnamen zurückgegeben\n"
487
488#, fuzzy, c-format
489msgid "DNS CRITICAL - No response from DNS %s\n"
490msgstr "Keine Antwort von DNS %s\n"
491
492#, c-format
493msgid "DNS CRITICAL - '%s' returned empty host name string\n"
494msgstr "DNS CRITICAL - '%s' hat einen leeren Hostnamen zurückgegeben\n"
495
496msgid "Non-authoritative answer:"
497msgstr ""
498
499#, fuzzy, c-format
500msgid "Domain '%s' was not found by the server\n"
501msgstr "Domäne %s wurde vom Server nicht gefunden\n"
502
503#, fuzzy, c-format
504msgid "DNS CRITICAL - '%s' msg parsing exited with no address\n"
505msgstr "DNS CRITICAL - '%s' Ausgabeverarbeitung hat keine Adresse ergeben\n"
506
507#, fuzzy, c-format
508msgid "expected '%s' but got '%s'"
509msgstr "Erwartet: %s aber: %s erhalten"
510
511#, fuzzy, c-format
512msgid "Domain '%s' was found by the server: '%s'\n"
513msgstr "Domäne %s wurde vom Server nicht gefunden\n"
514
515#, c-format
516msgid "server %s is not authoritative for %s"
517msgstr "Server %s ist nicht autoritativ für %s"
518
519#, c-format
520msgid "OK"
521msgstr "OK"
522
523#, c-format
524msgid "WARNING"
525msgstr "WARNING"
526
527#, fuzzy, c-format
528msgid "%.3f second response time"
529msgid_plural "%.3f seconds response time"
530msgstr[0] "%.3f Sekunden Antwortzeit "
531msgstr[1] "%.3f Sekunden Antwortzeit "
532
533#, fuzzy, c-format
534msgid ". %s returns %s"
535msgstr "%s hat %s zurückgegeben"
536
537#, c-format
538msgid "DNS WARNING - %s\n"
539msgstr "DNS WARNING - %s\n"
540
541msgid " Probably a non-existent host/domain"
542msgstr "nicht existierender Host/Domain"
543
544#, c-format
545msgid "DNS CRITICAL - %s\n"
546msgstr "DNS CRITICAL - %s\n"
547
548#, fuzzy, c-format
549msgid "DNS UNKNOWN - %s\n"
550msgstr "DNS UNKNOWN - %s\n"
551
552msgid "Note: nslookup is deprecated and may be removed from future releases."
553msgstr ""
554
555msgid "Consider using the `dig' or `host' programs instead. Run nslookup with"
556msgstr ""
557
558msgid "the `-sil[ent]' option to prevent this message from appearing."
559msgstr ""
560
561#, c-format
562msgid "No response from DNS %s\n"
563msgstr "Keine Antwort von DNS %s\n"
564
565#, c-format
566msgid "DNS %s has no records\n"
567msgstr "Nameserver %s hat keine Datensätze\n"
568
569#, c-format
570msgid "Connection to DNS %s was refused\n"
571msgstr "Verbindung zum Nameserver %s wurde verweigert\n"
572
573#, c-format
574msgid "Query was refused by DNS server at %s\n"
575msgstr ""
576
577#, c-format
578msgid "No information returned by DNS server at %s\n"
579msgstr ""
580
581msgid "Network is unreachable\n"
582msgstr "Netzwerk nicht erreichbar\n"
583
584#, c-format
585msgid "DNS failure for %s\n"
586msgstr "DNS Fehler für %s\n"
587
588msgid "Input buffer overflow\n"
589msgstr "Eingabe-Pufferüberlauf\n"
590
591msgid ""
592"This plugin uses the nslookup program to obtain the IP address for the given "
593"host/domain query."
594msgstr ""
595
596msgid "An optional DNS server to use may be specified."
597msgstr ""
598
599msgid ""
600"If no DNS server is specified, the default server(s) specified in /etc/"
601"resolv.conf will be used."
602msgstr ""
603
604msgid "The name or address you want to query"
605msgstr ""
606
607msgid "Optional DNS server you want to use for the lookup"
608msgstr ""
609
610msgid ""
611"Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"
612msgstr ""
613
614msgid ""
615"with a dot (.). This option can be repeated multiple times (Returns OK if any"
616msgstr ""
617
618msgid "value matches)."
619msgstr ""
620
621msgid ""
622"Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"
623msgstr ""
624
625msgid "Cannot be used together with -a"
626msgstr ""
627
628msgid "Optionally expect the DNS server to be authoritative for the lookup"
629msgstr ""
630
631msgid "Return warning if elapsed time exceeds value. Default off"
632msgstr ""
633
634msgid "Return critical if elapsed time exceeds value. Default off"
635msgstr ""
636
637msgid ""
638"Return critical if the list of expected addresses does not match all "
639"addresses"
640msgstr ""
641
642msgid "returned. Default off"
643msgstr ""
644
645msgid "Arguments to check_dummy must be an integer"
646msgstr "Argument für check_dummy muss ein Integer sein"
647
648#, c-format
649msgid "Status %d is not a supported error state\n"
650msgstr "Status %d ist kein bekannter Fehlerstatus\n"
651
652msgid ""
653"This plugin will simply return the state corresponding to the numeric value"
654msgstr ""
655
656msgid "of the <state> argument with optional text"
657msgstr ""
658
659#, c-format
660msgid "Could not open pipe: %s\n"
661msgstr "Pipe: %s konnte nicht geöffnet werden\n"
662
663#, c-format
664msgid "Could not open stderr for %s\n"
665msgstr "Konnte stderr nicht öffnen für: %s\n"
666
667#, fuzzy
668msgid "FPING UNKNOWN - IP address not found\n"
669msgstr "FPING UNKNOWN - %s nicht gefunden\n"
670
671msgid "FPING UNKNOWN - invalid commandline argument\n"
672msgstr ""
673
674#, fuzzy
675msgid "FPING UNKNOWN - failed system call\n"
676msgstr "FPING UNKNOWN - %s nicht gefunden\n"
677
678#, fuzzy, c-format
679msgid "FPING %s - %s (rta=%f ms)|%s\n"
680msgstr "FPING %s - %s (verloren=%.0f%% )|%s\n"
681
682#, c-format
683msgid "FPING UNKNOWN - %s not found\n"
684msgstr "FPING UNKNOWN - %s nicht gefunden\n"
685
686#, c-format
687msgid "FPING CRITICAL - %s is unreachable\n"
688msgstr "FPING CRITICAL - %s ist nicht erreichbar\n"
689
690#, fuzzy, c-format
691msgid "FPING UNKNOWN - %s parameter error\n"
692msgstr "FPING UNKNOWN - %s nicht gefunden\n"
693
694#, c-format
695msgid "FPING CRITICAL - %s is down\n"
696msgstr "FPING CRITICAL - %s ist down\n"
697
698#, c-format
699msgid "FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"
700msgstr "FPING %s - %s (verloren=%.0f%%, rta=%f ms)|%s %s\n"
701
702#, c-format
703msgid "FPING %s - %s (loss=%.0f%% )|%s\n"
704msgstr "FPING %s - %s (verloren=%.0f%% )|%s\n"
705
706msgid "Invalid hostname/address"
707msgstr "Ungültige(r) Hostname/Adresse"
708
709msgid "IPv6 support not available\n"
710msgstr ""
711
712msgid "Packet size must be a positive integer"
713msgstr "Paketgröße muss ein positiver Integer sein"
714
715msgid "Packet count must be a positive integer"
716msgstr "Paketanzahl muss ein positiver Integer sein"
717
718#, fuzzy
719msgid "Target timeout must be a positive integer"
720msgstr "Warnung time muss ein positiver Integer sein"
721
722#, fuzzy
723msgid "Interval must be a positive integer"
724msgstr "Timeout interval muss ein positiver Integer sein"
725
726msgid "Hostname was not supplied"
727msgstr ""
728
729#, c-format
730msgid "%s: Only one threshold may be packet loss (%s)\n"
731msgstr "%s: Nur ein Wert darf für packet loss angegeben werden (%s)\n"
732
733#, c-format
734msgid "%s: Only one threshold must be packet loss (%s)\n"
735msgstr "%s: Nur ein Wert darf für packet loss angegeben werden (%s)\n"
736
737msgid ""
738"This plugin will use the fping command to ping the specified host for a fast "
739"check"
740msgstr ""
741
742msgid "Note that it is necessary to set the suid flag on fping."
743msgstr ""
744
745msgid ""
746"name or IP Address of host to ping (IP Address bypasses name lookup, "
747"reducing system load)"
748msgstr ""
749
750#, fuzzy
751msgid "warning threshold pair"
752msgstr "Warning threshold Integer sein"
753
754#, fuzzy
755msgid "critical threshold pair"
756msgstr "Critical threshold muss ein Integer sein"
757
758msgid "Return OK after first successful reply"
759msgstr ""
760
761msgid "size of ICMP packet"
762msgstr ""
763
764msgid "number of ICMP packets to send"
765msgstr ""
766
767msgid "Target timeout (ms)"
768msgstr ""
769
770msgid "Interval (ms) between sending packets"
771msgstr ""
772
773msgid "name or IP Address of sourceip"
774msgstr ""
775
776msgid "source interface name"
777msgstr ""
778
779#, c-format
780msgid ""
781"THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time "
782"(ms)"
783msgstr ""
784
785msgid ""
786"which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"
787msgstr ""
788
789msgid "packet loss to trigger an alarm state."
790msgstr ""
791
792msgid "IPv4 is used by default. Specify -6 to use IPv6."
793msgstr ""
794
795#, c-format
796msgid "CRITICAL - Host type parameter incorrect!\n"
797msgstr "CRITICAL - Host type parameter unkorrekt!\n"
798
799#, fuzzy, c-format
800msgid "CRITICAL - Host not found\n"
801msgstr "CRITICAL - Text nicht gefunden%s|%s %s\n"
802
803#, fuzzy, c-format
804msgid "CRITICAL - Game server down or unavailable\n"
805msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
806
807#, fuzzy, c-format
808msgid "CRITICAL - Game server timeout\n"
809msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
810
811#, c-format
812msgid "This plugin tests game server connections with the specified host."
813msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
814
815msgid "Optional port of which to connect"
816msgstr ""
817
818msgid "Field number in raw qstat output that contains game name"
819msgstr ""
820
821msgid "Field number in raw qstat output that contains map name"
822msgstr ""
823
824msgid "Field number in raw qstat output that contains ping time"
825msgstr ""
826
827#, fuzzy
828msgid ""
829"This plugin uses the 'qstat' command, the popular game server status query "
830"tool."
831msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
832
833msgid ""
834"If you don't have the package installed, you will need to download it from"
835msgstr ""
836
837msgid "https://github.com/multiplay/qstat before you can use this plugin."
838msgstr ""
839
840msgid "Paper Jam"
841msgstr "Papierstau"
842
843msgid "Out of Paper"
844msgstr "Kein Papier"
845
846msgid "Printer Offline"
847msgstr "Drucker ausgeschaltet"
848
849msgid "Peripheral Error"
850msgstr "Peripheriefehler"
851
852msgid "Intervention Required"
853msgstr "Eingriff benötigt"
854
855msgid "Toner Low"
856msgstr "Wenig Toner"
857
858msgid "Insufficient Memory"
859msgstr "Nicht genügend Speicher"
860
861msgid "A Door is Open"
862msgstr "Eine Abdeckung ist offen"
863
864msgid "Output Tray is Full"
865msgstr "Ausgabeschacht ist voll"
866
867msgid "Data too Slow for Engine"
868msgstr ""
869
870msgid "Unknown Paper Error"
871msgstr "Papierfehler"
872
873#, c-format
874msgid "Printer ok - (%s)\n"
875msgstr "Printer ok - (%s)\n"
876
877#, fuzzy
878msgid "Port must be a positive short integer"
879msgstr "Port muss ein positiver Integer sein"
880
881#, fuzzy
882msgid "This plugin tests the STATUS of an HP printer with a JetDirect card."
883msgstr ""
884"Dieses Plugin testet den STATUS eines HP Druckers mit einer JetDirect "
885"Karte.\n"
886"Net-snmp muss auf dem ausführenden Computer installiert sein.\n"
887"\n"
888
889#, fuzzy
890msgid "Net-snmp must be installed on the computer running the plugin."
891msgstr ""
892"Dieses Plugin testet den STATUS eines HP Druckers mit einer JetDirect "
893"Karte.\n"
894"Net-snmp muss auf dem ausführenden Computer installiert sein.\n"
895"\n"
896
897msgid "The SNMP community name "
898msgstr ""
899
900#, c-format
901msgid "(default=%s)"
902msgstr ""
903
904msgid "Specify the port to check "
905msgstr ""
906
907msgid "Disable paper check "
908msgstr ""
909
910msgid "file does not exist or is not readable"
911msgstr ""
912
913msgid "Invalid certificate expiration period"
914msgstr "Ungültiger Zertifikatsablauftermin"
915
916msgid ""
917"Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional "
918"'+' suffix)"
919msgstr ""
920
921#, fuzzy
922msgid "Invalid option - SSL is not available"
923msgstr "Ungültige Option - SSL ist nicht verfügbar\n"
924
925msgid "Invalid max_redirs count"
926msgstr ""
927
928msgid "Invalid onredirect option"
929msgstr ""
930
931#, c-format
932msgid "option f:%d \n"
933msgstr "Option f:%d \n"
934
935msgid "Invalid port number"
936msgstr "Ungültige Portnummer"
937
938#, c-format
939msgid "Could Not Compile Regular Expression: %s"
940msgstr ""
941
942msgid "IPv6 support not available"
943msgstr "IPv6 Unterstützung nicht vorhanden"
944
945msgid "You must specify a server address or host name"
946msgstr "Hostname oder Serveradresse muss angegeben werden"
947
948msgid ""
949"If you use a client certificate you must also specify a private key file"
950msgstr ""
951
952#, fuzzy
953msgid "HTTP UNKNOWN - Memory allocation error\n"
954msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
955
956#, fuzzy, c-format
957msgid "%sServer date unknown, "
958msgstr "HTTP UNKNOWN - Serverdatum unbekannt\n"
959
960#, fuzzy, c-format
961msgid "%sDocument modification date unknown, "
962msgstr "HTTP CRITICAL - Datum der letzten Änderung unbekannt\n"
963
964#, fuzzy, c-format
965msgid "%sServer date \"%100s\" unparsable, "
966msgstr "HTTP CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
967
968#, fuzzy, c-format
969msgid "%sDocument date \"%100s\" unparsable, "
970msgstr ""
971"HTTP CRITICAL - Dokumentendatum \"%100s\" konnte nicht verarbeitet werden"
972
973#, fuzzy, c-format
974msgid "%sDocument is %d seconds in the future, "
975msgstr "HTTP CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
976
977#, fuzzy, c-format
978msgid "%sLast modified %.1f days ago, "
979msgstr "HTTP CRITICAL - Letzte Änderung vor %.1f Tagen\n"
980
981#, fuzzy, c-format
982msgid "%sLast modified %d:%02d:%02d ago, "
983msgstr "HTTP CRITICAL - Letzte Änderung vor %d:%02d:%02d \n"
984
985msgid "HTTP CRITICAL - Unable to open TCP socket\n"
986msgstr "HTTP CRITICAL - Konnte TCP socket nicht öffnen\n"
987
988#, fuzzy
989msgid "HTTP UNKNOWN - Could not allocate memory for full_page\n"
990msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
991
992msgid "HTTP CRITICAL - Error on receive\n"
993msgstr "HTTP CRITICAL - Fehler beim Empfangen\n"
994
995#, fuzzy
996msgid "HTTP CRITICAL - No data received from host\n"
997msgstr "HTTP CRITICAL - Keine Daten empfangen\n"
998
999#, fuzzy, c-format
1000msgid "Invalid HTTP response received from host: %s\n"
1001msgstr "Ungültige HTTP Antwort von Host empfangen\n"
1002
1003#, fuzzy, c-format
1004msgid "Invalid HTTP response received from host on port %d: %s\n"
1005msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
1006
1007#, c-format
1008msgid ""
1009"%s\n"
1010"%s"
1011msgstr ""
1012
1013#, fuzzy, c-format
1014msgid "Status line output matched \"%s\" - "
1015msgstr "HTTP OK: Statusausgabe passt auf \"%s\"\n"
1016
1017#, c-format
1018msgid "HTTP CRITICAL: Invalid Status Line (%s)\n"
1019msgstr "HTTP CRITICAL: Ungültige Statusmeldung (%s)\n"
1020
1021#, c-format
1022msgid "HTTP CRITICAL: Invalid Status (%s)\n"
1023msgstr "HTTP CRITICAL: Ungültiger Status (%s)\n"
1024
1025#, c-format
1026msgid "%s - "
1027msgstr ""
1028
1029#, fuzzy, c-format
1030msgid "%sheader '%s' not found on '%s://%s:%d%s', "
1031msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
1032
1033#, fuzzy, c-format
1034msgid "%sstring '%s' not found on '%s://%s:%d%s', "
1035msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
1036
1037#, fuzzy, c-format
1038msgid "%spattern not found, "
1039msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
1040
1041#, fuzzy, c-format
1042msgid "%spattern found, "
1043msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
1044
1045#, fuzzy, c-format
1046msgid "%sExecute Error: %s, "
1047msgstr "HTTP CRITICAL - Fehler: %s\n"
1048
1049#, fuzzy, c-format
1050msgid "%spage size %d too large, "
1051msgstr "HTTP WARNING: Seitengröße %d zu klein%s|%s\n"
1052
1053#, fuzzy, c-format
1054msgid "%spage size %d too small, "
1055msgstr "HTTP WARNING: Seitengröße %d zu klein%s|%s\n"
1056
1057#, fuzzy, c-format
1058msgid "%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"
1059msgstr " - %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
1060
1061#, fuzzy, c-format
1062msgid "%s - %d bytes in %.3f second response time %s|%s %s"
1063msgstr " - %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
1064
1065msgid "HTTP UNKNOWN - Could not allocate addr\n"
1066msgstr "HTTP UNKNOWN - Konnte addr nicht zuweisen\n"
1067
1068#, fuzzy
1069msgid "HTTP UNKNOWN - Could not allocate URL\n"
1070msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
1071
1072#, c-format
1073msgid "HTTP UNKNOWN - Could not find redirect location - %s%s\n"
1074msgstr ""
1075
1076#, fuzzy, c-format
1077msgid "HTTP UNKNOWN - Empty redirect location%s\n"
1078msgstr "HTTP UNKNOWN - Serverdatum unbekannt\n"
1079
1080#, c-format
1081msgid "HTTP UNKNOWN - Could not parse redirect location - %s%s\n"
1082msgstr ""
1083
1084#, fuzzy, c-format
1085msgid "HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"
1086msgstr "HTTP WARNING - Umleitung verursacht eine Schleife - %s://%s:%d%s%s\n"
1087
1088#, fuzzy, c-format
1089msgid "HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"
1090msgstr "HTTP WARNING - Umleitung verursacht eine Schleife - %s://%s:%d%s%s\n"
1091
1092#, fuzzy, c-format
1093msgid "HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"
1094msgstr "HTTP WARNING - Umleitung verursacht eine Schleife - %s://%s:%d%s%s\n"
1095
1096#, c-format
1097msgid "Redirection to %s://%s:%d%s\n"
1098msgstr ""
1099
1100#, fuzzy
1101msgid "This plugin tests the HTTP service on the specified host. It can test"
1102msgstr ""
1103"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
1104"\n"
1105
1106msgid "normal (http) and secure (https) servers, follow redirects, search for"
1107msgstr ""
1108
1109msgid "strings and regular expressions, check connection times, and report on"
1110msgstr ""
1111
1112#, fuzzy
1113msgid "certificate expiration times."
1114msgstr "Clientzertifikat benötigt\n"
1115
1116#, c-format
1117msgid "In the first form, make an HTTP request."
1118msgstr ""
1119
1120#, c-format
1121msgid ""
1122"In the second form, connect to the server and check the TLS certificate."
1123msgstr ""
1124
1125#, c-format
1126msgid "NOTE: One or both of -H and -I must be specified"
1127msgstr ""
1128
1129msgid "Host name argument for servers using host headers (virtual host)"
1130msgstr ""
1131
1132msgid "Append a port to include it in the header (eg: example.com:5000)"
1133msgstr ""
1134
1135msgid ""
1136"IP address or name (use numeric address if possible to bypass DNS lookup)."
1137msgstr ""
1138
1139msgid "Port number (default: "
1140msgstr ""
1141
1142msgid ""
1143"Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"
1144msgstr ""
1145
1146msgid "auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"
1147msgstr ""
1148
1149msgid "1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."
1150msgstr ""
1151
1152msgid "Enable SSL/TLS hostname extension support (SNI)"
1153msgstr ""
1154
1155msgid ""
1156"Minimum number of days a certificate has to be valid. Port defaults to 443"
1157msgstr ""
1158
1159msgid ""
1160"(when this option is used the URL is not checked by default. You can use"
1161msgstr ""
1162
1163msgid " --continue-after-certificate to override this behavior)"
1164msgstr ""
1165
1166msgid ""
1167"Allows the HTTP check to continue after performing the certificate check."
1168msgstr ""
1169
1170msgid "Does nothing unless -C is used."
1171msgstr ""
1172
1173msgid "Name of file that contains the client certificate (PEM format)"
1174msgstr ""
1175
1176msgid "to be used in establishing the SSL session"
1177msgstr ""
1178
1179msgid "Name of file containing the private key (PEM format)"
1180msgstr ""
1181
1182msgid "matching the client certificate"
1183msgstr ""
1184
1185msgid "Comma-delimited list of strings, at least one of them is expected in"
1186msgstr ""
1187
1188msgid "the first (status) line of the server response (default: "
1189msgstr ""
1190
1191msgid ""
1192"If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
1193msgstr ""
1194
1195msgid "String to expect in the response headers"
1196msgstr ""
1197
1198msgid "String to expect in the content"
1199msgstr ""
1200
1201msgid "URL to GET or POST (default: /)"
1202msgstr ""
1203
1204msgid "URL encoded http POST data"
1205msgstr ""
1206
1207msgid "Set HTTP method."
1208msgstr ""
1209
1210msgid "Don't wait for document body: stop reading after headers."
1211msgstr ""
1212
1213msgid "(Note that this still does an HTTP GET or POST, not a HEAD.)"
1214msgstr ""
1215
1216msgid "Warn if document is more than SECONDS old. the number can also be of"
1217msgstr ""
1218
1219msgid "the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."
1220msgstr ""
1221
1222msgid "specify Content-Type header media type when POSTing\n"
1223msgstr ""
1224
1225msgid "Allow regex to span newlines (must precede -r or -R)"
1226msgstr ""
1227
1228msgid "Search page for regex STRING"
1229msgstr ""
1230
1231msgid "Search page for case-insensitive regex STRING"
1232msgstr ""
1233
1234msgid "Return CRITICAL if found, OK if not\n"
1235msgstr ""
1236
1237msgid "Username:password on sites with basic authentication"
1238msgstr ""
1239
1240msgid "Username:password on proxy-servers with basic authentication"
1241msgstr ""
1242
1243msgid "String to be sent in http header as \"User Agent\""
1244msgstr ""
1245
1246msgid ""
1247"Any other tags to be sent in http header. Use multiple times for additional "
1248"headers"
1249msgstr ""
1250
1251msgid "Print additional performance data"
1252msgstr ""
1253
1254msgid "Print body content below status line"
1255msgstr ""
1256
1257msgid "Wrap output in HTML link (obsoleted by urlize)"
1258msgstr ""
1259
1260msgid "How to handle redirected pages. sticky is like follow but stick to the"
1261msgstr ""
1262
1263msgid "specified IP address. stickyport also ensures port stays the same."
1264msgstr ""
1265
1266#, fuzzy
1267msgid "Maximal number of redirects (default: "
1268msgstr "Ungültige Portnummer"
1269
1270msgid "Minimum page size required (bytes) : Maximum page size required (bytes)"
1271msgstr ""
1272
1273#, fuzzy
1274msgid "This plugin will attempt to open an HTTP connection with the host."
1275msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
1276
1277msgid ""
1278"Successful connects return STATE_OK, refusals and timeouts return "
1279"STATE_CRITICAL"
1280msgstr ""
1281
1282msgid ""
1283"other errors return STATE_UNKNOWN. Successful connects, but incorrect "
1284"response"
1285msgstr ""
1286
1287msgid ""
1288"messages from the host result in STATE_WARNING return values. If you are"
1289msgstr ""
1290
1291msgid ""
1292"checking a virtual server that uses 'host headers' you must supply the FQDN"
1293msgstr ""
1294
1295msgid "(fully qualified domain name) as the [host_name] argument."
1296msgstr ""
1297
1298msgid "This plugin can also check whether an SSL enabled web server is able to"
1299msgstr ""
1300
1301msgid "serve content (optionally within a specified time) or whether the X509 "
1302msgstr ""
1303
1304msgid "certificate is still valid for the specified number of days."
1305msgstr ""
1306
1307#, fuzzy
1308msgid "Please note that this plugin does not check if the presented server"
1309msgstr ""
1310"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
1311"\n"
1312
1313msgid "certificate matches the hostname of the server, or if the certificate"
1314msgstr ""
1315
1316msgid "has a valid chain of trust to one of the locally installed CAs."
1317msgstr ""
1318
1319msgid ""
1320"When the 'www.verisign.com' server returns its content within 5 seconds,"
1321msgstr ""
1322
1323msgid ""
1324"a STATE_OK will be returned. When the server returns its content but exceeds"
1325msgstr ""
1326
1327msgid ""
1328"the 5-second threshold, a STATE_WARNING will be returned. When an error "
1329"occurs,"
1330msgstr ""
1331
1332msgid "a STATE_CRITICAL will be returned."
1333msgstr ""
1334
1335msgid ""
1336"When the certificate of 'www.verisign.com' is valid for more than 14 days,"
1337msgstr ""
1338
1339msgid ""
1340"a STATE_OK is returned. When the certificate is still valid, but for less "
1341"than"
1342msgstr ""
1343
1344msgid ""
1345"14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"
1346msgstr ""
1347
1348#, fuzzy
1349msgid "the certificate is expired."
1350msgstr "Clientzertifikat benötigt\n"
1351
1352msgid ""
1353"When the certificate of 'www.verisign.com' is valid for more than 30 days,"
1354msgstr ""
1355
1356msgid "30 days, but more than 14 days, a STATE_WARNING is returned."
1357msgstr ""
1358
1359msgid ""
1360"A STATE_CRITICAL will be returned when certificate expires in less than 14 "
1361"days"
1362msgstr ""
1363
1364msgid ""
1365"check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j "
1366"CONNECT -H www.verisign.com "
1367msgstr ""
1368
1369msgid ""
1370"all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -"
1371"S(sl) -j CONNECT -H <webserver>"
1372msgstr ""
1373
1374msgid ""
1375"a STATE_CRITICAL will be returned. By adding a colon to the method you can "
1376"set the method used"
1377msgstr ""
1378
1379msgid "inside the proxied connection: -j CONNECT:POST"
1380msgstr ""
1381
1382#, c-format
1383msgid "Could not connect to the server at port %i\n"
1384msgstr ""
1385
1386#, c-format
1387msgid "Could not set protocol version %d\n"
1388msgstr ""
1389
1390#, fuzzy, c-format
1391msgid "Could not init TLS at port %i!\n"
1392msgstr "Konnte stderr nicht öffnen für: %s\n"
1393
1394#, c-format
1395msgid "TLS not supported by the libraries!\n"
1396msgstr ""
1397
1398#, fuzzy, c-format
1399msgid "Could not init startTLS at port %i!\n"
1400msgstr "Konnte stderr nicht öffnen für: %s\n"
1401
1402#, c-format
1403msgid "startTLS not supported by the library, needs LDAPv3!\n"
1404msgstr ""
1405
1406#, c-format
1407msgid "Could not bind to the LDAP server\n"
1408msgstr ""
1409
1410#, c-format
1411msgid "Could not search/find objectclasses in %s\n"
1412msgstr ""
1413
1414#, fuzzy, c-format
1415msgid "LDAP %s - found %d entries in %.3f seconds|%s %s\n"
1416msgstr "HTTP OK %s - %.3f Sekunde Antwortzeit %s%s|%s %s\n"
1417
1418#, c-format
1419msgid "LDAP %s - %.3f seconds response time|%s\n"
1420msgstr ""
1421
1422#, c-format
1423msgid "%s cannot be combined with %s"
1424msgstr ""
1425
1426msgid "Please specify the host name\n"
1427msgstr ""
1428
1429msgid "Please specify the LDAP base\n"
1430msgstr ""
1431
1432msgid "ldap attribute to search (default: \"(objectclass=*)\""
1433msgstr ""
1434
1435msgid "ldap base (eg. ou=my unit, o=my org, c=at"
1436msgstr ""
1437
1438msgid "ldap bind DN (if required)"
1439msgstr ""
1440
1441msgid ""
1442"ldap password (if required, or set the password through environment variable "
1443"'LDAP_PASSWORD')"
1444msgstr ""
1445
1446msgid "use starttls mechanism introduced in protocol version 3"
1447msgstr ""
1448
1449msgid "use ldaps (ldap v2 ssl method). this also sets the default port to"
1450msgstr ""
1451
1452msgid "use ldap protocol version 2"
1453msgstr ""
1454
1455msgid "use ldap protocol version 3"
1456msgstr ""
1457
1458msgid "default protocol version:"
1459msgstr ""
1460
1461msgid "Number of found entries to result in warning status"
1462msgstr ""
1463
1464msgid "Number of found entries to result in critical status"
1465msgstr ""
1466
1467msgid "If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"
1468msgstr ""
1469
1470#, c-format
1471msgid ""
1472" implied (using default port %i) unless --port=636 is specified. In that "
1473"case\n"
1474msgstr ""
1475
1476msgid "'SSL on connect' will be used no matter how the plugin was called."
1477msgstr ""
1478
1479msgid ""
1480"This detection is deprecated, please use 'check_ldap' with the '--starttls' "
1481"or '--ssl' flags"
1482msgstr ""
1483
1484msgid "to define the behaviour explicitly instead."
1485msgstr ""
1486
1487msgid "The parameters --warn-entries and --crit-entries are optional."
1488msgstr ""
1489
1490msgid "Warning threshold must be float or float triplet!\n"
1491msgstr ""
1492
1493#, c-format
1494msgid "Error opening %s\n"
1495msgstr ""
1496
1497#, fuzzy, c-format
1498msgid "could not parse load from uptime %s: %d\n"
1499msgstr "Argumente konnten nicht ausgewertet werden"
1500
1501#, c-format
1502msgid "Error code %d returned in %s\n"
1503msgstr ""
1504
1505#, c-format
1506msgid "Error in getloadavg()\n"
1507msgstr ""
1508
1509#, c-format
1510msgid "Error processing %s\n"
1511msgstr ""
1512
1513#, c-format
1514msgid "load average: %.2f, %.2f, %.2f"
1515msgstr ""
1516
1517#, fuzzy, c-format
1518msgid "Critical threshold for %d-minute load average is not specified\n"
1519msgstr "Critical threshold muss ein positiver Integer sein\n"
1520
1521#, fuzzy, c-format
1522msgid "Warning threshold for %d-minute load average is not specified\n"
1523msgstr "Warning threshold muss ein positiver Integer sein\n"
1524
1525#, c-format
1526msgid ""
1527"Parameter inconsistency: %d-minute \"warning load\" is greater than "
1528"\"critical load\"\n"
1529msgstr ""
1530
1531#, c-format
1532msgid "This plugin tests the current system load average."
1533msgstr ""
1534
1535msgid "Exit with WARNING status if load average exceeds WLOADn"
1536msgstr ""
1537
1538msgid "Exit with CRITICAL status if load average exceed CLOADn"
1539msgstr ""
1540
1541msgid "the load average format is the same used by \"uptime\" and \"w\""
1542msgstr ""
1543
1544msgid "Divide the load averages by the number of CPUs (when possible)"
1545msgstr ""
1546
1547msgid "Number of processes to show when printing the top consuming processes."
1548msgstr ""
1549
1550msgid "NUMBER_OF_PROCS=0 disables this feature. Default value is 0"
1551msgstr ""
1552
1553#, c-format
1554msgid "'%s' exited with non-zero status.\n"
1555msgstr ""
1556
1557#, c-format
1558msgid "some error occurred getting procs list.\n"
1559msgstr ""
1560
1561msgid "Could not parse arguments\n"
1562msgstr ""
1563
1564#, c-format
1565msgid "Unable to open MRTG log file\n"
1566msgstr ""
1567
1568#, c-format
1569msgid "Unable to process MRTG log file\n"
1570msgstr ""
1571
1572#, c-format
1573msgid "MRTG data has expired (%d minutes old)\n"
1574msgstr ""
1575
1576msgid "Avg"
1577msgstr ""
1578
1579msgid "Max"
1580msgstr ""
1581
1582msgid "Invalid variable number"
1583msgstr ""
1584
1585#, c-format
1586msgid ""
1587"%s is not a valid expiration time\n"
1588"Use '%s -h' for additional help\n"
1589msgstr ""
1590
1591msgid "Invalid variable number\n"
1592msgstr ""
1593
1594msgid "You must supply the variable number"
1595msgstr ""
1596
1597msgid ""
1598"This plugin will check either the average or maximum value of one of the"
1599msgstr ""
1600
1601#, fuzzy
1602msgid "two variables recorded in an MRTG log file."
1603msgstr "Konnte MRTG Logfile nicht öffnen"
1604
1605msgid "The MRTG log file containing the data you want to monitor"
1606msgstr ""
1607
1608msgid "Minutes before MRTG data is considered to be too old"
1609msgstr ""
1610
1611msgid "Should we check average or maximum values?"
1612msgstr ""
1613
1614msgid "Which variable set should we inspect? (1 or 2)"
1615msgstr ""
1616
1617msgid "Threshold value for data to result in WARNING status"
1618msgstr ""
1619
1620msgid "Threshold value for data to result in CRITICAL status"
1621msgstr ""
1622
1623msgid "Type label for data (Examples: Conns, \"Processor Load\", In, Out)"
1624msgstr ""
1625
1626msgid "Option units label for data (Example: Packets/Sec, Errors/Sec,"
1627msgstr ""
1628
1629#, c-format
1630msgid "\"Bytes Per Second\", \"%% Utilization\")"
1631msgstr ""
1632
1633msgid ""
1634"If the value exceeds the <vwl> threshold, a WARNING status is returned. If"
1635msgstr ""
1636
1637msgid ""
1638"the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"
1639msgstr ""
1640
1641msgid "the data in the log file is older than <expire_minutes> old, a WARNING"
1642msgstr ""
1643
1644msgid "status is returned and a warning message is printed."
1645msgstr ""
1646
1647msgid ""
1648"This plugin is useful for monitoring MRTG data that does not correspond to"
1649msgstr ""
1650
1651msgid ""
1652"bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."
1653msgstr ""
1654
1655msgid ""
1656"It can be used to monitor any kind of data that MRTG is monitoring - errors,"
1657msgstr ""
1658
1659msgid ""
1660"packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"
1661msgstr ""
1662
1663msgid ""
1664"me to track processor utilization, user connections, drive space, etc and"
1665msgstr ""
1666
1667msgid "this plugin works well for monitoring that kind of data as well."
1668msgstr ""
1669
1670msgid ""
1671"- This plugin only monitors one of the two variables stored in the MRTG log"
1672msgstr ""
1673
1674msgid "file. If you want to monitor both values you will have to define two"
1675msgstr ""
1676
1677msgid "commands with different values for the <variable> argument. Of course,"
1678msgstr ""
1679
1680msgid "you can always hack the code to make this plugin work for you..."
1681msgstr ""
1682
1683msgid ""
1684"- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded "
1685"from"
1686msgstr ""
1687
1688msgid "Unable to open MRTG log file"
1689msgstr "Konnte MRTG Logfile nicht öffnen"
1690
1691msgid "Unable to process MRTG log file"
1692msgstr ""
1693
1694#, c-format
1695msgid "%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"
1696msgstr ""
1697
1698#, c-format
1699msgid "Traffic %s - %s\n"
1700msgstr ""
1701
1702msgid ""
1703"This plugin will check the incoming/outgoing transfer rates of a router,"
1704msgstr ""
1705
1706msgid "switch, etc recorded in an MRTG log. If the newest log entry is older"
1707msgstr ""
1708
1709msgid "than <expire_minutes>, a WARNING status is returned. If either the"
1710msgstr ""
1711
1712msgid "incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"
1713msgstr ""
1714
1715msgid "Bytes/sec), a CRITICAL status results. If either of the rates exceed"
1716msgstr ""
1717
1718msgid "the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."
1719msgstr ""
1720
1721msgid "File to read log from"
1722msgstr ""
1723
1724msgid "Minutes after which log expires"
1725msgstr ""
1726
1727msgid "Test average or maximum"
1728msgstr ""
1729
1730#, fuzzy
1731msgid "Warning threshold pair <incoming>,<outgoing>"
1732msgstr "Warning threshold Integer sein"
1733
1734#, fuzzy
1735msgid "Critical threshold pair <incoming>,<outgoing>"
1736msgstr "Critical threshold muss ein Integer sein"
1737
1738msgid ""
1739"- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"
1740msgstr ""
1741
1742msgid "- While MRTG can monitor things other than traffic rates, this"
1743msgstr ""
1744
1745msgid " plugin probably won't work with much else without modification."
1746msgstr ""
1747
1748msgid "- The calculated i/o rates are a little off from what MRTG actually"
1749msgstr ""
1750
1751msgid " reports. I'm not sure why this is right now, but will look into it"
1752msgstr ""
1753
1754msgid " for future enhancements of this plugin."
1755msgstr ""
1756
1757#, c-format
1758msgid "Usage"
1759msgstr ""
1760
1761#, c-format
1762msgid "status store_result error: %s\n"
1763msgstr ""
1764
1765#, c-format
1766msgid "slave query error: %s\n"
1767msgstr ""
1768
1769#, c-format
1770msgid "slave store_result error: %s\n"
1771msgstr ""
1772
1773msgid "No slaves defined"
1774msgstr ""
1775
1776#, c-format
1777msgid "slave fetch row error: %s\n"
1778msgstr ""
1779
1780#, c-format
1781msgid "Slave running: %s"
1782msgstr ""
1783
1784msgid "This program tests connections to a MySQL server"
1785msgstr ""
1786
1787msgid "Ignore authentication failure and check for mysql connectivity only"
1788msgstr ""
1789
1790msgid "Use the specified socket (has no effect if -H is used)"
1791msgstr ""
1792
1793msgid "Check database with indicated name"
1794msgstr ""
1795
1796msgid "Read from the specified client options file"
1797msgstr ""
1798
1799msgid "Use a client options group"
1800msgstr ""
1801
1802msgid "Connect using the indicated username"
1803msgstr ""
1804
1805msgid "Use the indicated password to authenticate the connection"
1806msgstr ""
1807
1808msgid "IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"
1809msgstr ""
1810
1811msgid "Your clear-text password could be visible as a process table entry"
1812msgstr ""
1813
1814msgid "Check if the slave thread is running properly."
1815msgstr ""
1816
1817msgid "Exit with WARNING status if slave server is more than INTEGER seconds"
1818msgstr ""
1819
1820msgid "behind master"
1821msgstr ""
1822
1823msgid "Exit with CRITICAL status if slave server is more then INTEGER seconds"
1824msgstr ""
1825
1826msgid "Use ssl encryption"
1827msgstr ""
1828
1829msgid "Path to CA signing the cert"
1830msgstr ""
1831
1832msgid "Path to SSL certificate"
1833msgstr ""
1834
1835msgid "Path to private SSL key"
1836msgstr ""
1837
1838msgid "Path to CA directory"
1839msgstr ""
1840
1841msgid "List of valid SSL ciphers"
1842msgstr ""
1843
1844msgid ""
1845"There are no required arguments. By default, the local database is checked"
1846msgstr ""
1847
1848msgid ""
1849"using the default unix socket. You can force TCP on localhost by using an"
1850msgstr ""
1851
1852msgid "IP address or FQDN ('localhost' will use the socket as well)."
1853msgstr ""
1854
1855msgid "You must specify -p with an empty string to force an empty password,"
1856msgstr ""
1857
1858msgid "overriding any my.cnf settings."
1859msgstr ""
1860
1861msgid "Cannot open status log for reading!"
1862msgstr ""
1863
1864#, c-format
1865msgid "Found process: %s %s\n"
1866msgstr ""
1867
1868msgid "Could not locate a running Nagios process!"
1869msgstr ""
1870
1871msgid "Cannot parse Nagios log file for valid time"
1872msgstr ""
1873
1874#, c-format
1875msgid "%d process"
1876msgid_plural "%d processes"
1877msgstr[0] ""
1878msgstr[1] ""
1879
1880#, c-format
1881msgid "status log updated %d second ago"
1882msgid_plural "status log updated %d seconds ago"
1883msgstr[0] ""
1884msgstr[1] ""
1885
1886#, fuzzy
1887msgid "Expiration time must be an integer (seconds)\n"
1888msgstr "skip lines muss ein Integer sein"
1889
1890#, fuzzy
1891msgid "Timeout must be an integer (seconds)\n"
1892msgstr "skip lines muss ein Integer sein"
1893
1894#, fuzzy
1895msgid "You must provide the status_log\n"
1896msgstr "%s: Hostname muss angegeben werden\n"
1897
1898#, fuzzy
1899msgid "You must provide a process string\n"
1900msgstr "%s: Hostname muss angegeben werden\n"
1901
1902#, fuzzy
1903msgid ""
1904"This plugin checks the status of the Nagios process on the local machine"
1905msgstr ""
1906"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem\n"
1907"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
1908"unterschritten wird.\n"
1909"\n"
1910
1911msgid ""
1912"The plugin will check to make sure the Nagios status log is no older than"
1913msgstr ""
1914
1915msgid "the number of minutes specified by the expires option."
1916msgstr ""
1917
1918msgid ""
1919"It also checks the process table for a process matching the command argument."
1920msgstr ""
1921
1922msgid "Name of the log file to check"
1923msgstr ""
1924
1925msgid "Minutes aging after which logfile is considered stale"
1926msgstr ""
1927
1928msgid "Substring to search for in process arguments"
1929msgstr ""
1930
1931msgid "Timeout for the plugin in seconds"
1932msgstr ""
1933
1934#, c-format
1935msgid "Wrong client version - running: %s, required: %s"
1936msgstr ""
1937
1938msgid "missing -l parameters"
1939msgstr ""
1940
1941msgid "wrong -l parameter."
1942msgstr ""
1943
1944msgid "CPU Load"
1945msgstr ""
1946
1947#, c-format
1948msgid " %lu%% (%lu min average)"
1949msgstr ""
1950
1951#, c-format
1952msgid " '%lu min avg Load'=%lu%%;%lu;%lu;0;100"
1953msgstr ""
1954
1955msgid "not enough values for -l parameters"
1956msgstr ""
1957
1958msgid "wrong -l argument"
1959msgstr ""
1960
1961#, c-format
1962msgid "System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"
1963msgstr ""
1964
1965#, c-format
1966msgid "%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"
1967msgstr ""
1968
1969#, c-format
1970msgid "'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"
1971msgstr ""
1972
1973msgid "Free disk space : Invalid drive"
1974msgstr ""
1975
1976msgid "No service/process specified"
1977msgstr ""
1978
1979msgid "could not fetch information from server\n"
1980msgstr ""
1981
1982#, c-format
1983msgid ""
1984"Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"
1985msgstr ""
1986
1987#, c-format
1988msgid "'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"
1989msgstr ""
1990
1991msgid "No counter specified"
1992msgstr ""
1993
1994msgid "Minimum value contains non-numbers"
1995msgstr ""
1996
1997msgid "Maximum value contains non-numbers"
1998msgstr ""
1999
2000msgid "No unit counter specified"
2001msgstr ""
2002
2003msgid "Please specify a variable to check"
2004msgstr ""
2005
2006#, fuzzy
2007msgid "Server port must be an integer\n"
2008msgstr "skip lines muss ein Integer sein"
2009
2010#, fuzzy
2011msgid "You must provide a server address or host name"
2012msgstr "Hostname oder Serveradresse muss angegeben werden"
2013
2014msgid "None"
2015msgstr ""
2016
2017msgid "This plugin collects data from the NSClient service running on a"
2018msgstr ""
2019
2020msgid "Windows NT/2000/XP/2003 server."
2021msgstr ""
2022
2023msgid "Name of the host to check"
2024msgstr ""
2025
2026#, fuzzy
2027msgid "Optional port number (default: "
2028msgstr "Ungültige Portnummer"
2029
2030msgid "Password needed for the request"
2031msgstr ""
2032
2033msgid "Threshold which will result in a warning status"
2034msgstr ""
2035
2036msgid "Threshold which will result in a critical status"
2037msgstr ""
2038
2039msgid "Seconds before connection attempt times out (default: "
2040msgstr ""
2041
2042msgid "Parameters passed to specified check (see below)"
2043msgstr ""
2044
2045msgid "Display options (currently only SHOWALL works)"
2046msgstr ""
2047
2048msgid "Return UNKNOWN on timeouts"
2049msgstr ""
2050
2051msgid "Print this help screen"
2052msgstr ""
2053
2054msgid "Print version information"
2055msgstr ""
2056
2057msgid "Variable to check"
2058msgstr ""
2059
2060msgid "Valid variables are:"
2061msgstr ""
2062
2063msgid "Get the NSClient version"
2064msgstr ""
2065
2066msgid "If -l <version> is specified, will return warning if versions differ."
2067msgstr ""
2068
2069msgid "Average CPU load on last x minutes."
2070msgstr ""
2071
2072msgid "Request a -l parameter with the following syntax:"
2073msgstr ""
2074
2075msgid "-l <minutes range>,<warning threshold>,<critical threshold>."
2076msgstr ""
2077
2078msgid "<minute range> should be less than 24*60."
2079msgstr ""
2080
2081msgid ""
2082"Thresholds are percentage and up to 10 requests can be done in one shot."
2083msgstr ""
2084
2085msgid "Get the uptime of the machine."
2086msgstr ""
2087
2088msgid "-l <unit> "
2089msgstr ""
2090
2091msgid "<unit> = seconds, minutes, hours, or days. (default: minutes)"
2092msgstr ""
2093
2094#, fuzzy
2095msgid "Thresholds will use the unit specified above."
2096msgstr ""
2097"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
2098"\n"
2099
2100msgid "Size and percentage of disk use."
2101msgstr ""
2102
2103msgid "Request a -l parameter containing the drive letter only."
2104msgstr ""
2105
2106msgid "Warning and critical thresholds can be specified with -w and -c."
2107msgstr ""
2108
2109msgid "Memory use."
2110msgstr ""
2111
2112msgid "Check the state of one or several services."
2113msgstr ""
2114
2115msgid "Request a -l parameters with the following syntax:"
2116msgstr ""
2117
2118msgid "-l <service1>,<service2>,<service3>,..."
2119msgstr ""
2120
2121msgid "You can specify -d SHOWALL in case you want to see working services"
2122msgstr ""
2123
2124msgid "in the returned string."
2125msgstr ""
2126
2127msgid "Check if one or several process are running."
2128msgstr ""
2129
2130msgid "Same syntax as SERVICESTATE."
2131msgstr ""
2132
2133msgid "Check any performance counter of Windows NT/2000."
2134msgstr ""
2135
2136msgid "-l \"\\\\<performance object>\\\\counter\",\"<description>"
2137msgstr ""
2138
2139msgid "The <description> parameter is optional and is given to a printf "
2140msgstr ""
2141
2142msgid "output command which requires a float parameter."
2143msgstr ""
2144
2145#, c-format
2146msgid "If <description> does not include \"%%\", it is used as a label."
2147msgstr ""
2148
2149msgid "Some examples:"
2150msgstr ""
2151
2152msgid "Check any performance counter object of Windows NT/2000."
2153msgstr ""
2154
2155msgid ""
2156"Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"
2157msgstr ""
2158
2159msgid "<counter object> is a Windows Perfmon Counter object (eg. Process),"
2160msgstr ""
2161
2162msgid "if it is two words, it should be enclosed in quotes"
2163msgstr ""
2164
2165msgid "The returned results will be a comma-separated list of instances on "
2166msgstr ""
2167
2168msgid " the selected computer for that object."
2169msgstr ""
2170
2171msgid ""
2172"The purpose of this is to be run from command line to determine what "
2173"instances"
2174msgstr ""
2175
2176msgid ""
2177" are available for monitoring without having to log onto the Windows server"
2178msgstr ""
2179
2180msgid " to run Perfmon directly."
2181msgstr ""
2182
2183msgid ""
2184"It can also be used in scripts that automatically create the monitoring "
2185"service"
2186msgstr ""
2187
2188msgid " configuration files."
2189msgstr ""
2190
2191msgid "check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"
2192msgstr ""
2193
2194msgid ""
2195"- The NSClient service should be running on the server to get any information"
2196msgstr ""
2197
2198msgid "- Critical thresholds should be lower than warning thresholds"
2199msgstr ""
2200
2201msgid "- Default port 1248 is sometimes in use by other services. The error"
2202msgstr ""
2203
2204msgid ""
2205"output when this happens contains \"Cannot map xxxxx to protocol number\"."
2206msgstr ""
2207
2208msgid "One fix for this is to change the port to something else on check_nt "
2209msgstr ""
2210
2211msgid "and on the client service it's connecting to."
2212msgstr ""
2213
2214#, c-format
2215msgid "jitter response too large (%lu bytes)\n"
2216msgstr ""
2217
2218msgid "NTP CRITICAL:"
2219msgstr "NTP CRITICAL:"
2220
2221msgid "NTP WARNING:"
2222msgstr "NTP WARNING:"
2223
2224msgid "NTP OK:"
2225msgstr "NTP OK:"
2226
2227msgid "NTP UNKNOWN:"
2228msgstr "NTP UNKNOWN:"
2229
2230msgid "Offset unknown"
2231msgstr ""
2232
2233msgid "Offset"
2234msgstr ""
2235
2236#, fuzzy
2237msgid "This plugin checks the selected ntp server"
2238msgstr ""
2239"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
2240"\n"
2241
2242msgid "Offset to result in warning status (seconds)"
2243msgstr ""
2244
2245msgid "Offset to result in critical status (seconds)"
2246msgstr ""
2247
2248#, fuzzy
2249msgid "Warning threshold for jitter"
2250msgstr "Warning threshold Integer sein"
2251
2252#, fuzzy
2253msgid "Critical threshold for jitter"
2254msgstr "Critical threshold muss ein Integer sein"
2255
2256msgid "Normal offset check:"
2257msgstr ""
2258
2259msgid ""
2260"Check jitter too, avoiding critical notifications if jitter isn't available"
2261msgstr ""
2262
2263msgid "(See Notes above for more details on thresholds formats):"
2264msgstr ""
2265
2266msgid "WARNING: check_ntp is deprecated. Please use check_ntp_peer or"
2267msgstr ""
2268
2269msgid "check_ntp_time instead."
2270msgstr ""
2271
2272msgid "Server not synchronized"
2273msgstr ""
2274
2275msgid "Server has the LI_ALARM bit set"
2276msgstr ""
2277
2278msgid ""
2279"Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"
2280msgstr ""
2281
2282#, fuzzy
2283msgid "Warning threshold for stratum of server's synchronization peer"
2284msgstr "Warning threshold Integer sein"
2285
2286#, fuzzy
2287msgid "Critical threshold for stratum of server's synchronization peer"
2288msgstr "Critical threshold muss ein Integer sein"
2289
2290#, fuzzy
2291msgid "Warning threshold for number of usable time sources (\"truechimers\")"
2292msgstr "Warning threshold muss ein positiver Integer sein\n"
2293
2294#, fuzzy
2295msgid "Critical threshold for number of usable time sources (\"truechimers\")"
2296msgstr "Critical threshold muss ein positiver Integer sein\n"
2297
2298msgid "This plugin checks an NTP server independent of any commandline"
2299msgstr ""
2300
2301msgid "programs or external libraries."
2302msgstr ""
2303
2304#, fuzzy
2305msgid "Use this plugin to check the health of an NTP server. It supports"
2306msgstr ""
2307"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
2308"\n"
2309
2310msgid "checking the offset with the sync peer, the jitter and stratum. This"
2311msgstr ""
2312
2313msgid "plugin will not check the clock offset between the local host and NTP"
2314msgstr ""
2315
2316msgid "server; please use check_ntp_time for that purpose."
2317msgstr ""
2318
2319msgid "Simple NTP server check:"
2320msgstr ""
2321
2322msgid "Only check the number of usable time sources (\"truechimers\"):"
2323msgstr ""
2324
2325msgid "Check only stratum:"
2326msgstr ""
2327
2328#, fuzzy
2329msgid "This plugin checks the clock offset with the ntp server"
2330msgstr ""
2331"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
2332"\n"
2333
2334msgid "Returns UNKNOWN instead of CRITICAL if offset cannot be found"
2335msgstr ""
2336
2337msgid "Expected offset of the ntp server relative to local server (seconds)"
2338msgstr ""
2339
2340#, fuzzy
2341msgid "This plugin checks the clock offset between the local host and a"
2342msgstr ""
2343"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem\n"
2344"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
2345"unterschritten wird.\n"
2346"\n"
2347
2348msgid "remote NTP server. It is independent of any commandline programs or"
2349msgstr ""
2350
2351msgid "external libraries."
2352msgstr ""
2353
2354msgid "If you'd rather want to monitor an NTP server, please use"
2355msgstr ""
2356
2357msgid "check_ntp_peer."
2358msgstr ""
2359
2360msgid "--time-offset is useful for compensating for servers with known"
2361msgstr ""
2362
2363msgid "and expected clock skew."
2364msgstr ""
2365
2366#, c-format
2367msgid "NetWare %s: "
2368msgstr ""
2369
2370#, c-format
2371msgid "Up %s,"
2372msgstr ""
2373
2374#, c-format
2375msgid "Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"
2376msgstr ""
2377
2378#, c-format
2379msgid "Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"
2380msgstr ""
2381
2382#, c-format
2383msgid "%s: Long term cache hits = %lu%%"
2384msgstr ""
2385
2386#, c-format
2387msgid "%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"
2388msgstr ""
2389
2390#, c-format
2391msgid "%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"
2392msgstr ""
2393
2394#, c-format
2395msgid "%s: LRU sitting time = %lu minutes"
2396msgstr ""
2397
2398#, c-format
2399msgid "CRITICAL - Volume '%s' does not exist!"
2400msgstr ""
2401
2402#, c-format
2403msgid "%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"
2404msgstr ""
2405
2406msgid "Only "
2407msgstr ""
2408
2409#, c-format
2410msgid "%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"
2411msgstr ""
2412
2413#, c-format
2414msgid "%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"
2415msgstr ""
2416
2417#, c-format
2418msgid ""
2419"%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"
2420msgstr ""
2421
2422#, c-format
2423msgid "Directory Services Database is %s (DS version %s)"
2424msgstr ""
2425
2426#, c-format
2427msgid "Logins are %s"
2428msgstr ""
2429
2430msgid "enabled"
2431msgstr ""
2432
2433msgid "disabled"
2434msgstr ""
2435
2436#, fuzzy
2437msgid "CRITICAL - NRM Status is bad!"
2438msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
2439
2440msgid "Warning - NRM Status is suspect!"
2441msgstr ""
2442
2443msgid "OK - NRM Status is good!"
2444msgstr ""
2445
2446#, c-format
2447msgid "%lu of %lu (%lu%%) packet receive buffers used"
2448msgstr ""
2449
2450#, c-format
2451msgid "%lu entries in SAP table"
2452msgstr ""
2453
2454#, c-format
2455msgid "%lu entries in SAP table for SAP type %d"
2456msgstr ""
2457
2458#, c-format
2459msgid "%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
2460msgstr ""
2461
2462#, c-format
2463msgid "%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
2464msgstr ""
2465
2466#, c-format
2467msgid "%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"
2468msgstr ""
2469
2470#, c-format
2471msgid "%s%lu KB not yet purgeable on volume %s"
2472msgstr ""
2473
2474#, c-format
2475msgid "%lu MB (%lu%%) not yet purgeable on volume %s"
2476msgstr ""
2477
2478#, c-format
2479msgid "%lu open files|Openfiles=%lu;%lu;%lu;0,0"
2480msgstr ""
2481
2482#, c-format
2483msgid "%lu abended threads|Abends=%lu;%lu;%lu;;"
2484msgstr ""
2485
2486#, c-format
2487msgid "%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"
2488msgstr ""
2489
2490msgid "CRITICAL - Time not in sync with network!"
2491msgstr ""
2492
2493msgid "OK - Time in sync with network!"
2494msgstr ""
2495
2496#, c-format
2497msgid "LRU sitting time = %lu seconds"
2498msgstr ""
2499
2500#, c-format
2501msgid "Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"
2502msgstr ""
2503
2504#, c-format
2505msgid "Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"
2506msgstr ""
2507
2508#, c-format
2509msgid "NDS Version %s"
2510msgstr ""
2511
2512#, c-format
2513msgid "Up %s"
2514msgstr ""
2515
2516#, c-format
2517msgid "Module %s version %s is loaded"
2518msgstr ""
2519
2520#, c-format
2521msgid "Module %s is not loaded"
2522msgstr ""
2523
2524#, fuzzy, c-format
2525msgid "CRITICAL - Value '%s' does not exist!"
2526msgstr "%s [%s nicht gefunden]"
2527
2528#, c-format
2529msgid "%s is %lu|%s=%lu;%lu;%lu;;"
2530msgstr ""
2531
2532msgid "Nothing to check!\n"
2533msgstr ""
2534
2535#, fuzzy
2536msgid "Server port an integer\n"
2537msgstr "skip lines muss ein Integer sein"
2538
2539msgid "This plugin attempts to contact the MRTGEXT NLM running on a"
2540msgstr ""
2541
2542msgid "Novell server to gather the requested system information."
2543msgstr ""
2544
2545msgid "Variable to check. Valid variables include:"
2546msgstr ""
2547
2548msgid "LOAD1 = 1 minute average CPU load"
2549msgstr ""
2550
2551msgid "LOAD5 = 5 minute average CPU load"
2552msgstr ""
2553
2554msgid "LOAD15 = 15 minute average CPU load"
2555msgstr ""
2556
2557msgid "CSPROCS = number of current service processes (NW 5.x only)"
2558msgstr ""
2559
2560msgid "ABENDS = number of abended threads (NW 5.x only)"
2561msgstr ""
2562
2563msgid "UPTIME = server uptime"
2564msgstr ""
2565
2566msgid "LTCH = percent long term cache hits"
2567msgstr ""
2568
2569msgid "CBUFF = current number of cache buffers"
2570msgstr ""
2571
2572msgid "CDBUFF = current number of dirty cache buffers"
2573msgstr ""
2574
2575msgid "DCB = dirty cache buffers as a percentage of the total"
2576msgstr ""
2577
2578msgid "TCB = dirty cache buffers as a percentage of the original"
2579msgstr ""
2580
2581msgid "OFILES = number of open files"
2582msgstr ""
2583
2584msgid " VMF<vol> = MB of free space on Volume <vol>"
2585msgstr ""
2586
2587msgid " VMU<vol> = MB used space on Volume <vol>"
2588msgstr ""
2589
2590msgid " VMP<vol> = MB of purgeable space on Volume <vol>"
2591msgstr ""
2592
2593msgid " VPF<vol> = percent free space on volume <vol>"
2594msgstr ""
2595
2596msgid " VKF<vol> = KB of free space on volume <vol>"
2597msgstr ""
2598
2599msgid " VPP<vol> = percent purgeable space on volume <vol>"
2600msgstr ""
2601
2602msgid " VKP<vol> = KB of purgeable space on volume <vol>"
2603msgstr ""
2604
2605msgid " VPNP<vol> = percent not yet purgeable space on volume <vol>"
2606msgstr ""
2607
2608msgid " VKNP<vol> = KB of not yet purgeable space on volume <vol>"
2609msgstr ""
2610
2611msgid " LRUM = LRU sitting time in minutes"
2612msgstr ""
2613
2614msgid " LRUS = LRU sitting time in seconds"
2615msgstr ""
2616
2617msgid " DSDB = check to see if DS Database is open"
2618msgstr ""
2619
2620msgid " DSVER = NDS version"
2621msgstr ""
2622
2623msgid " UPRB = used packet receive buffers"
2624msgstr ""
2625
2626msgid " PUPRB = percent (of max) used packet receive buffers"
2627msgstr ""
2628
2629msgid " SAPENTRIES = number of entries in the SAP table"
2630msgstr ""
2631
2632msgid " SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"
2633msgstr ""
2634
2635msgid " TSYNC = timesync status"
2636msgstr ""
2637
2638msgid " LOGINS = check to see if logins are enabled"
2639msgstr ""
2640
2641msgid " CONNS = number of currently licensed connections"
2642msgstr ""
2643
2644msgid " NRMH\t= NRM Summary Status"
2645msgstr ""
2646
2647msgid " NRMP<stat> = Returns the current value for a NRM health item"
2648msgstr ""
2649
2650msgid " NRMM<stat> = Returns the current memory stats from NRM"
2651msgstr ""
2652
2653msgid " NRMS<stat> = Returns the current Swapfile stats from NRM"
2654msgstr ""
2655
2656msgid " NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"
2657msgstr ""
2658
2659msgid " NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"
2660msgstr ""
2661
2662msgid " NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"
2663msgstr ""
2664
2665msgid " NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"
2666msgstr ""
2667
2668msgid " NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"
2669msgstr ""
2670
2671msgid ""
2672" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"
2673msgstr ""
2674
2675msgid " NLM:<nlm> = check if NLM is loaded and report version"
2676msgstr ""
2677
2678msgid " (e.g. NLM:TSANDS.NLM)"
2679msgstr ""
2680
2681msgid "Include server version string in results"
2682msgstr ""
2683
2684msgid "- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"
2685msgstr ""
2686
2687msgid ""
2688" extension for NetWare be loaded on the Novell servers you wish to check."
2689msgstr ""
2690
2691msgid " (available from http://www.engr.wisc.edu/~drews/mrtg/)"
2692msgstr ""
2693
2694msgid ""
2695"- Values for critical thresholds should be lower than warning thresholds"
2696msgstr ""
2697
2698msgid ""
2699" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "
2700msgstr ""
2701
2702msgid " TCB, LRUS and LRUM."
2703msgstr ""
2704
2705msgid "Unknown error fetching load data\n"
2706msgstr ""
2707
2708msgid "Invalid response from server - no load information\n"
2709msgstr ""
2710
2711msgid "Invalid response from server after load 1\n"
2712msgstr ""
2713
2714msgid "Invalid response from server after load 5\n"
2715msgstr ""
2716
2717#, c-format
2718msgid "Load %s - %s-min load average = %0.2f"
2719msgstr ""
2720
2721msgid "Unknown error fetching disk data\n"
2722msgstr ""
2723
2724msgid "Invalid response from server\n"
2725msgstr ""
2726
2727msgid "Unknown error fetching network status\n"
2728msgstr ""
2729
2730#, c-format
2731msgid "Net %s - %d connection%s on port %d"
2732msgstr ""
2733
2734msgid "Unknown error fetching process status\n"
2735msgstr ""
2736
2737#, c-format
2738msgid "Process %s - %d instance%s of %s running"
2739msgstr ""
2740
2741#, c-format
2742msgid "Uptime %s - Up %d days %d hours %d minutes"
2743msgstr ""
2744
2745msgid ""
2746"This plugin attempts to contact the Over-CR collector daemon running on the"
2747msgstr ""
2748
2749msgid "remote UNIX server in order to gather the requested system information."
2750msgstr ""
2751
2752msgid "LOAD1 = 1 minute average CPU load"
2753msgstr ""
2754
2755msgid "LOAD5 = 5 minute average CPU load"
2756msgstr ""
2757
2758msgid "LOAD15 = 15 minute average CPU load"
2759msgstr ""
2760
2761msgid "DPU<filesys> = percent used disk space on filesystem <filesys>"
2762msgstr ""
2763
2764msgid "PROC<process> = number of running processes with name <process>"
2765msgstr ""
2766
2767msgid "NET<port> = number of active connections on TCP port <port>"
2768msgstr ""
2769
2770msgid "UPTIME = system uptime in seconds"
2771msgstr ""
2772
2773msgid "This plugin requires that Eric Molitors' Over-CR collector daemon be"
2774msgstr ""
2775
2776msgid "running on the remote server."
2777msgstr ""
2778
2779msgid "Over-CR can be downloaded from http://www.molitor.org/overcr"
2780msgstr ""
2781
2782msgid "This plugin was tested with version 0.99.53 of the Over-CR collector"
2783msgstr ""
2784
2785msgid ""
2786"For the available options, the critical threshold value should always be"
2787msgstr ""
2788
2789msgid ""
2790"higher than the warning threshold value, EXCEPT with the uptime variable"
2791msgstr ""
2792
2793#, c-format
2794msgid "CRITICAL - no connection to '%s' (%s).\n"
2795msgstr ""
2796
2797#, c-format
2798msgid " %s - database %s (%f sec.)|%s\n"
2799msgstr ""
2800
2801msgid "Critical threshold must be a positive integer"
2802msgstr "Critical threshold muss ein positiver Integer sein"
2803
2804msgid "Warning threshold must be a positive integer"
2805msgstr "Warning threshold muss ein positiver Integer sein"
2806
2807msgid "Database name exceeds the maximum length"
2808msgstr ""
2809
2810msgid "User name is not valid"
2811msgstr ""
2812
2813#, c-format
2814msgid "Test whether a PostgreSQL Database is accepting connections."
2815msgstr ""
2816
2817msgid "Database to check "
2818msgstr ""
2819
2820#, c-format
2821msgid "(default: %s)\n"
2822msgstr ""
2823
2824msgid "Login name of user"
2825msgstr ""
2826
2827msgid "Password (BIG SECURITY ISSUE)"
2828msgstr ""
2829
2830msgid "Connection parameters (keyword = value), see below"
2831msgstr ""
2832
2833msgid "SQL query to run. Only first column in first row will be read"
2834msgstr ""
2835
2836msgid "A name for the query, this string is used instead of the query"
2837msgstr ""
2838
2839msgid "in the long output of the plugin"
2840msgstr ""
2841
2842msgid "SQL query value to result in warning status (double)"
2843msgstr ""
2844
2845msgid "SQL query value to result in critical status (double)"
2846msgstr ""
2847
2848msgid "All parameters are optional."
2849msgstr ""
2850
2851msgid ""
2852"This plugin tests a PostgreSQL DBMS to determine whether it is active and"
2853msgstr ""
2854
2855msgid "accepting queries. In its current operation, it simply connects to the"
2856msgstr ""
2857
2858msgid ""
2859"specified database, and then disconnects. If no database is specified, it"
2860msgstr ""
2861
2862msgid ""
2863"connects to the template1 database, which is present in every functioning"
2864msgstr ""
2865
2866msgid "PostgreSQL DBMS."
2867msgstr ""
2868
2869msgid "If a query is specified using the -q option, it will be executed after"
2870msgstr ""
2871
2872msgid "connecting to the server. The result from the query has to be numeric."
2873msgstr ""
2874
2875msgid ""
2876"Multiple SQL commands, separated by semicolon, are allowed but the result "
2877msgstr ""
2878
2879msgid "of the last command is taken into account only. The value of the first"
2880msgstr ""
2881
2882msgid ""
2883"column in the first row is used as the check result. If a second column is"
2884msgstr ""
2885
2886msgid "present in the result set, this is added to the plugin output with a"
2887msgstr ""
2888
2889msgid ""
2890"prefix of \"Extra Info:\". This information can be displayed in the system"
2891msgstr ""
2892
2893msgid "executing the plugin."
2894msgstr ""
2895
2896msgid ""
2897"See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"
2898msgstr ""
2899
2900msgid ""
2901"for details about how to access internal statistics of the database server."
2902msgstr ""
2903
2904msgid ""
2905"For a list of available connection parameters which may be used with the -o"
2906msgstr ""
2907
2908msgid ""
2909"command line option, see the documentation for PQconnectdb() in the chapter"
2910msgstr ""
2911
2912msgid ""
2913"\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"
2914msgstr ""
2915
2916msgid ""
2917"used to specify a service name in pg_service.conf to be used for additional"
2918msgstr ""
2919
2920msgid "connection parameters: -o 'service=<name>' or to specify the SSL mode:"
2921msgstr ""
2922
2923msgid "-o 'sslmode=require'."
2924msgstr ""
2925
2926msgid ""
2927"The plugin will connect to a local postmaster if no host is specified. To"
2928msgstr ""
2929
2930msgid ""
2931"connect to a remote host, be sure that the remote postmaster accepts TCP/IP"
2932msgstr ""
2933
2934msgid "connections (start the postmaster with the -i option)."
2935msgstr ""
2936
2937msgid ""
2938"Typically, the monitoring user (unless the --logname option is used) should "
2939"be"
2940msgstr ""
2941
2942msgid ""
2943"able to connect to the database without a password. The plugin can also send"
2944msgstr ""
2945
2946msgid "a password, but no effort is made to obscure or encrypt the password."
2947msgstr ""
2948
2949#, c-format
2950msgid "QUERY %s - %s: %s.\n"
2951msgstr ""
2952
2953msgid "Error with query"
2954msgstr ""
2955
2956msgid "No rows returned"
2957msgstr ""
2958
2959msgid "No columns returned"
2960msgstr ""
2961
2962#, fuzzy
2963msgid "No data returned"
2964msgstr "Keine Daten empfangen %s\n"
2965
2966msgid "Is not a numeric"
2967msgstr ""
2968
2969#, fuzzy, c-format
2970msgid "%s returned %f"
2971msgstr "%s hat %s zurückgegeben"
2972
2973#, fuzzy, c-format
2974msgid "'%s' returned %f"
2975msgstr "%s hat %s zurückgegeben"
2976
2977msgid "CRITICAL - Could not interpret output from ping command\n"
2978msgstr ""
2979
2980#, c-format
2981msgid "PING %s - %sPacket loss = %d%%"
2982msgstr ""
2983
2984#, c-format
2985msgid "PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"
2986msgstr ""
2987
2988msgid "Could not realloc() addresses\n"
2989msgstr ""
2990
2991#, c-format
2992msgid "<max_packets> (%s) must be a non-negative number\n"
2993msgstr ""
2994
2995#, c-format
2996msgid "<wpl> (%s) must be an integer percentage\n"
2997msgstr ""
2998
2999#, c-format
3000msgid "<cpl> (%s) must be an integer percentage\n"
3001msgstr ""
3002
3003#, c-format
3004msgid "<wrta> (%s) must be a non-negative number\n"
3005msgstr ""
3006
3007#, c-format
3008msgid "<crta> (%s) must be a non-negative number\n"
3009msgstr ""
3010
3011#, c-format
3012msgid ""
3013"%s: Warning threshold must be integer or percentage!\n"
3014"\n"
3015msgstr ""
3016
3017#, c-format
3018msgid "<wrta> was not set\n"
3019msgstr ""
3020
3021#, c-format
3022msgid "<crta> was not set\n"
3023msgstr ""
3024
3025#, c-format
3026msgid "<wpl> was not set\n"
3027msgstr ""
3028
3029#, c-format
3030msgid "<cpl> was not set\n"
3031msgstr ""
3032
3033#, c-format
3034msgid "<wrta> (%f) cannot be larger than <crta> (%f)\n"
3035msgstr ""
3036
3037#, c-format
3038msgid "<wpl> (%d) cannot be larger than <cpl> (%d)\n"
3039msgstr ""
3040
3041#, c-format
3042msgid "Cannot open stderr for %s\n"
3043msgstr ""
3044
3045msgid "System call sent warnings to stderr "
3046msgstr ""
3047
3048#, fuzzy, c-format
3049msgid "CRITICAL - Network Unreachable (%s)\n"
3050msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3051
3052#, fuzzy, c-format
3053msgid "CRITICAL - Host Unreachable (%s)\n"
3054msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3055
3056#, fuzzy, c-format
3057msgid "CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"
3058msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3059
3060#, fuzzy, c-format
3061msgid "CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"
3062msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3063
3064#, fuzzy, c-format
3065msgid "CRITICAL - Network Prohibited (%s)\n"
3066msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3067
3068#, fuzzy, c-format
3069msgid "CRITICAL - Host Prohibited (%s)\n"
3070msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3071
3072#, fuzzy, c-format
3073msgid "CRITICAL - Packet Filtered (%s)\n"
3074msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3075
3076#, fuzzy, c-format
3077msgid "CRITICAL - Host not found (%s)\n"
3078msgstr "CRITICAL - Text nicht gefunden%s|%s %s\n"
3079
3080#, fuzzy, c-format
3081msgid "CRITICAL - Time to live exceeded (%s)\n"
3082msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3083
3084#, fuzzy, c-format
3085msgid "CRITICAL - Destination Unreachable (%s)\n"
3086msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
3087
3088msgid "Unable to realloc warn_text\n"
3089msgstr ""
3090
3091#, c-format
3092msgid "Use ping to check connection statistics for a remote host."
3093msgstr ""
3094
3095msgid "host to ping"
3096msgstr ""
3097
3098msgid "number of ICMP ECHO packets to send"
3099msgstr ""
3100
3101#, c-format
3102msgid "(Default: %d)\n"
3103msgstr ""
3104
3105msgid "show HTML in the plugin output (obsoleted by urlize)"
3106msgstr ""
3107
3108msgid "THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"
3109msgstr ""
3110
3111msgid "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"
3112msgstr ""
3113
3114msgid "percentage of packet loss to trigger an alarm state."
3115msgstr ""
3116
3117#, fuzzy
3118msgid ""
3119"This plugin uses the ping command to probe the specified host for packet loss"
3120msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
3121
3122msgid ""
3123"(percentage) and round trip average (milliseconds). It can produce HTML "
3124"output"
3125msgstr ""
3126
3127msgid ""
3128"linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"
3129msgstr ""
3130
3131msgid "the contrib area of the downloads section at http://www.nagios.org/"
3132msgstr ""
3133
3134#, c-format
3135msgid "CMD: %s\n"
3136msgstr ""
3137
3138msgid "System call sent warnings to stderr"
3139msgstr ""
3140
3141#, c-format
3142msgid "Not parseable: %s"
3143msgstr ""
3144
3145#, c-format
3146msgid "Unable to read output\n"
3147msgstr ""
3148
3149#, c-format
3150msgid "%d warn out of "
3151msgstr ""
3152
3153#, c-format
3154msgid "%d crit, %d warn out of "
3155msgstr ""
3156
3157#, c-format
3158msgid " with %s"
3159msgstr ""
3160
3161#, fuzzy
3162msgid "Parent Process ID must be an integer!"
3163msgstr "Argument für check_dummy muss ein Integer sein"
3164
3165#, c-format
3166msgid "%s%sSTATE = %s"
3167msgstr ""
3168
3169#, fuzzy
3170msgid "UID was not found"
3171msgstr "%s [%s nicht gefunden]"
3172
3173#, fuzzy
3174msgid "User name was not found"
3175msgstr "%s [%s nicht gefunden]"
3176
3177#, c-format
3178msgid "%s%scommand name '%s'"
3179msgstr ""
3180
3181#, c-format
3182msgid "%s%sexclude progs '%s'"
3183msgstr ""
3184
3185#, fuzzy
3186msgid "RSS must be an integer!"
3187msgstr "skip lines muss ein Integer sein"
3188
3189#, fuzzy
3190msgid "VSZ must be an integer!"
3191msgstr "skip lines muss ein Integer sein"
3192
3193msgid "PCPU must be a float!"
3194msgstr ""
3195
3196msgid "Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"
3197msgstr ""
3198
3199msgid ""
3200"Checks all processes and generates WARNING or CRITICAL states if the "
3201"specified"
3202msgstr ""
3203
3204msgid ""
3205"metric is outside the required threshold ranges. The metric defaults to "
3206"number"
3207msgstr ""
3208
3209msgid ""
3210"of processes. Search filters can be applied to limit the processes to check."
3211msgstr ""
3212
3213msgid "Generate warning state if metric is outside this range"
3214msgstr ""
3215
3216msgid "Generate critical state if metric is outside this range"
3217msgstr ""
3218
3219msgid "Check thresholds against metric. Valid types:"
3220msgstr ""
3221
3222msgid "PROCS - number of processes (default)"
3223msgstr ""
3224
3225msgid "VSZ - virtual memory size"
3226msgstr ""
3227
3228msgid "RSS - resident set memory size"
3229msgstr ""
3230
3231msgid "CPU - percentage CPU"
3232msgstr ""
3233
3234msgid "ELAPSED - time elapsed in seconds"
3235msgstr ""
3236
3237msgid "Extra information. Up to 3 verbosity levels"
3238msgstr ""
3239
3240msgid "Filter own process the traditional way by PID instead of /proc/pid/exe"
3241msgstr ""
3242
3243msgid "Only scan for processes that have, in the output of `ps`, one or"
3244msgstr ""
3245
3246msgid "more of the status flags you specify (for example R, Z, S, RS,"
3247msgstr ""
3248
3249msgid "RSZDT, plus others based on the output of your 'ps' command)."
3250msgstr ""
3251
3252msgid "Only scan for children of the parent process ID indicated."
3253msgstr ""
3254
3255msgid "Only scan for processes with VSZ higher than indicated."
3256msgstr ""
3257
3258msgid "Only scan for processes with RSS higher than indicated."
3259msgstr ""
3260
3261msgid "Only scan for processes with PCPU higher than indicated."
3262msgstr ""
3263
3264msgid "Only scan for processes with user name or ID indicated."
3265msgstr ""
3266
3267msgid "Only scan for processes with args that contain STRING."
3268msgstr ""
3269
3270msgid "Only scan for processes with args that contain the regex STRING."
3271msgstr ""
3272
3273msgid "Only scan for exact matches of COMMAND (without path)."
3274msgstr ""
3275
3276msgid "Exclude processes which match this comma separated list"
3277msgstr ""
3278
3279msgid "Only scan for non kernel threads (works on Linux only)."
3280msgstr ""
3281
3282#, c-format
3283msgid ""
3284"\n"
3285"RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n"
3286"specified 'max:min', a warning status will be generated if the\n"
3287"count is inside the specified range\n"
3288"\n"
3289msgstr ""
3290
3291#, c-format
3292msgid ""
3293"This plugin checks the number of currently running processes and\n"
3294"generates WARNING or CRITICAL states if the process count is outside\n"
3295"the specified threshold ranges. The process count can be filtered by\n"
3296"process owner, parent process PID, current state (e.g., 'Z'), or may\n"
3297"be the total number of running processes\n"
3298"\n"
3299msgstr ""
3300
3301msgid "Warning if not two processes with command name portsentry."
3302msgstr ""
3303
3304msgid "Critical if < 2 or > 1024 processes"
3305msgstr ""
3306
3307msgid "Critical if not at least 1 process with command sshd"
3308msgstr ""
3309
3310msgid "Warning if > 1024 processes with command name sshd."
3311msgstr ""
3312
3313msgid "Critical if < 1 processes with command name sshd."
3314msgstr ""
3315
3316msgid "Warning alert if > 10 processes with command arguments containing"
3317msgstr ""
3318
3319msgid "'/usr/local/bin/perl' and owned by root"
3320msgstr ""
3321
3322msgid "Alert if VSZ of any processes over 50K or 100K"
3323msgstr ""
3324
3325msgid "Alert if CPU of any processes over 10% or 20%"
3326msgstr ""
3327
3328msgid "Config file error\n"
3329msgstr ""
3330
3331#, fuzzy
3332msgid "Out of Memory?\n"
3333msgstr "Kein Papier"
3334
3335#, fuzzy
3336msgid "Invalid NAS-Identifier\n"
3337msgstr "Ungültige(r) Hostname/Adresse"
3338
3339#, c-format
3340msgid "gethostname() failed!\n"
3341msgstr ""
3342
3343#, fuzzy
3344msgid "Invalid NAS-IP-Address\n"
3345msgstr "Ungültige(r) Hostname/Adresse"
3346
3347msgid "Timeout\n"
3348msgstr ""
3349
3350msgid "Auth Error\n"
3351msgstr ""
3352
3353#, fuzzy
3354msgid "Auth Failed\n"
3355msgstr "Fehlgeschlagen"
3356
3357msgid "Bad Response\n"
3358msgstr ""
3359
3360msgid "Auth OK\n"
3361msgstr ""
3362
3363#, fuzzy, c-format
3364msgid "Unexpected result code %d"
3365msgstr "Erwartet: %s aber: %s erhalten"
3366
3367msgid "Number of retries must be a positive integer"
3368msgstr ""
3369
3370msgid "User not specified"
3371msgstr ""
3372
3373msgid "Password not specified"
3374msgstr ""
3375
3376msgid "Configuration file not specified"
3377msgstr ""
3378
3379#, fuzzy
3380msgid "Tests to see if a RADIUS server is accepting connections."
3381msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
3382
3383msgid "The user to authenticate"
3384msgstr ""
3385
3386msgid "Password for authentication (SECURITY RISK)"
3387msgstr ""
3388
3389msgid "NAS identifier"
3390msgstr ""
3391
3392msgid "NAS IP Address"
3393msgstr ""
3394
3395msgid "Configuration file"
3396msgstr ""
3397
3398msgid "Response string to expect from the server"
3399msgstr ""
3400
3401msgid "Number of times to retry a failed connection"
3402msgstr ""
3403
3404#, fuzzy
3405msgid ""
3406"This plugin tests a RADIUS server to see if it is accepting connections."
3407msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
3408
3409msgid ""
3410"The server to test must be specified in the invocation, as well as a user"
3411msgstr ""
3412
3413msgid "name and password. A configuration file must be present. The format of"
3414msgstr ""
3415
3416msgid ""
3417"the configuration file is described in the radiusclient library sources."
3418msgstr ""
3419
3420msgid "The password option presents a substantial security issue because the"
3421msgstr ""
3422
3423msgid ""
3424"password can possibly be determined by careful watching of the command line"
3425msgstr ""
3426
3427msgid "in a process listing. This risk is exacerbated because the plugin will"
3428msgstr ""
3429
3430msgid ""
3431"typically be executed at regular predictable intervals. Please be sure that"
3432msgstr ""
3433
3434msgid "the password used does not allow access to sensitive system resources."
3435msgstr ""
3436
3437#, c-format
3438msgid "Unable to connect to %s on port %d\n"
3439msgstr ""
3440
3441#, c-format
3442msgid "No data received from %s\n"
3443msgstr ""
3444
3445#, fuzzy
3446msgid "Invalid REAL response received from host"
3447msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3448
3449#, c-format
3450msgid "Invalid REAL response received from host on port %d\n"
3451msgstr ""
3452
3453#, c-format
3454msgid "No data received from host\n"
3455msgstr ""
3456
3457#, c-format
3458msgid "REAL %s - %d second response time\n"
3459msgstr ""
3460
3461msgid "Warning time must be a positive integer"
3462msgstr "Warnung time muss ein positiver Integer sein"
3463
3464msgid "Critical time must be a positive integer"
3465msgstr "Critical time muss ein positiver Integer sein"
3466
3467#, fuzzy
3468msgid "You must provide a server to check"
3469msgstr "%s: Hostname muss angegeben werden\n"
3470
3471#, fuzzy
3472msgid "This plugin tests the REAL service on the specified host."
3473msgstr ""
3474"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
3475"\n"
3476
3477msgid "Connect to this url"
3478msgstr ""
3479
3480#, c-format
3481msgid "String to expect in first line of server response (default: %s)\n"
3482msgstr ""
3483
3484#, fuzzy
3485msgid "This plugin will attempt to open an RTSP connection with the host."
3486msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
3487
3488msgid "Successful connects return STATE_OK, refusals and timeouts return"
3489msgstr ""
3490
3491msgid ""
3492"STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"
3493msgstr ""
3494
3495msgid ""
3496"but incorrect response messages from the host result in STATE_WARNING return"
3497msgstr ""
3498
3499msgid "values."
3500msgstr ""
3501
3502#, c-format
3503msgid "malloc() failed!\n"
3504msgstr ""
3505
3506#, c-format
3507msgid "CRITICAL - Cannot create SSL context.\n"
3508msgstr ""
3509
3510#, c-format
3511msgid "recv() failed\n"
3512msgstr ""
3513
3514#, c-format
3515msgid "WARNING - TLS not supported by server\n"
3516msgstr ""
3517
3518#, c-format
3519msgid "Server does not support STARTTLS\n"
3520msgstr ""
3521
3522msgid "SMTP UNKNOWN - Cannot send EHLO command via TLS."
3523msgstr ""
3524
3525#, c-format
3526msgid "sent %s"
3527msgstr ""
3528
3529msgid "SMTP UNKNOWN - Cannot read EHLO response via TLS."
3530msgstr ""
3531
3532#, fuzzy, c-format
3533msgid "Invalid SMTP response received from host: %s\n"
3534msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3535
3536#, fuzzy, c-format
3537msgid "Invalid SMTP response received from host on port %d: %s\n"
3538msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
3539
3540#, c-format
3541msgid "Could Not Compile Regular Expression"
3542msgstr ""
3543
3544#, c-format
3545msgid "SMTP %s - Invalid response '%s' to command '%s'\n"
3546msgstr ""
3547
3548#, c-format
3549msgid "Execute Error: %s\n"
3550msgstr ""
3551
3552msgid "no authuser specified, "
3553msgstr ""
3554
3555msgid "no authpass specified, "
3556msgstr ""
3557
3558#, c-format
3559msgid "sent %s\n"
3560msgstr ""
3561
3562#, fuzzy
3563msgid "recv() failed after AUTH LOGIN, "
3564msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3565
3566#, fuzzy, c-format
3567msgid "received %s\n"
3568msgstr "Keine Daten empfangen %s\n"
3569
3570#, fuzzy
3571msgid "invalid response received after AUTH LOGIN, "
3572msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3573
3574msgid "recv() failed after sending authuser, "
3575msgstr ""
3576
3577#, fuzzy
3578msgid "invalid response received after authuser, "
3579msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3580
3581msgid "recv() failed after sending authpass, "
3582msgstr ""
3583
3584#, fuzzy
3585msgid "invalid response received after authpass, "
3586msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3587
3588msgid "only authtype LOGIN is supported, "
3589msgstr ""
3590
3591#, fuzzy, c-format
3592msgid "SMTP %s - %s%.3f sec. response time%s%s|%s\n"
3593msgstr " - %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
3594
3595#, c-format
3596msgid "Could not realloc() units [%d]\n"
3597msgstr ""
3598
3599#, fuzzy
3600msgid "Critical time must be a positive"
3601msgstr "Critical time muss ein positiver Integer sein"
3602
3603#, fuzzy
3604msgid "Warning time must be a positive"
3605msgstr "Warnung time muss ein positiver Integer sein"
3606
3607msgid "SSL support not available - install OpenSSL and recompile"
3608msgstr ""
3609
3610msgid "Set either -s/--ssl/--tls or -S/--starttls"
3611msgstr "Setze entweder -s/--ssl/--tls oder -S/--starttls"
3612
3613#, c-format
3614msgid "Connection closed by server before sending QUIT command\n"
3615msgstr ""
3616
3617#, fuzzy, c-format
3618msgid "recv() failed after QUIT."
3619msgstr "Ungültige HTTP Antwort von Host empfangen\n"
3620
3621#, c-format
3622msgid "Connection reset by peer."
3623msgstr ""
3624
3625#, fuzzy
3626msgid "This plugin will attempt to open an SMTP connection with the host."
3627msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
3628
3629#, c-format
3630msgid " String to expect in first line of server response (default: '%s')\n"
3631msgstr ""
3632
3633msgid "SMTP command (may be used repeatedly)"
3634msgstr ""
3635
3636msgid "Expected response to command (may be used repeatedly)"
3637msgstr ""
3638
3639msgid "FROM-address to include in MAIL command, required by Exchange 2000"
3640msgstr ""
3641
3642msgid "FQDN used for HELO"
3643msgstr ""
3644
3645msgid "Use PROXY protocol prefix for the connection."
3646msgstr "Benutze PROXY-Protokoll-Präfix für die Verbindung."
3647
3648msgid "Minimum number of days a certificate has to be valid."
3649msgstr ""
3650
3651#, fuzzy
3652msgid "Use SSL/TLS for the connection."
3653msgstr "Benutze SSL/TLS für die Verbindung."
3654
3655#, c-format
3656msgid " Sets default port to %d.\n"
3657msgstr " Setze den Default-Port auf %d.\n"
3658
3659msgid "Use STARTTLS for the connection."
3660msgstr "Benutze STARTTLS für die Verbindung."
3661
3662msgid "SMTP AUTH type to check (default none, only LOGIN supported)"
3663msgstr ""
3664
3665msgid "SMTP AUTH username"
3666msgstr ""
3667
3668msgid "SMTP AUTH password"
3669msgstr ""
3670
3671msgid "Send LHLO instead of HELO/EHLO"
3672msgstr ""
3673
3674msgid "Ignore failure when sending QUIT command to server"
3675msgstr ""
3676
3677msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"
3678msgstr ""
3679
3680msgid "connects, but incorrect response messages from the host result in"
3681msgstr ""
3682
3683msgid "STATE_WARNING return values."
3684msgstr ""
3685
3686msgid "Cannot malloc"
3687msgstr ""
3688
3689#, fuzzy, c-format
3690msgid "External command error: %s\n"
3691msgstr "Papierfehler"
3692
3693#, c-format
3694msgid "External command error with no output (return code: %d)\n"
3695msgstr ""
3696
3697#, fuzzy, c-format
3698msgid "No valid data returned (%s)\n"
3699msgstr "Keine Daten empfangen %s\n"
3700
3701msgid "Time duration between plugin calls is invalid"
3702msgstr ""
3703
3704msgid "Cannot asprintf()"
3705msgstr ""
3706
3707msgid "Cannot realloc()"
3708msgstr ""
3709
3710msgid "No previous data to calculate rate - assume okay"
3711msgstr ""
3712
3713#, fuzzy
3714msgid "Retries interval must be a positive integer"
3715msgstr "Time interval muss ein positiver Integer sein"
3716
3717#, fuzzy
3718msgid "Exit status must be a positive integer"
3719msgstr "Maxbytes muss ein positiver Integer sein"
3720
3721#, fuzzy, c-format
3722msgid "Could not reallocate labels[%d]"
3723msgstr "Konnte addr nicht zuweisen\n"
3724
3725#, fuzzy
3726msgid "Could not reallocate labels\n"
3727msgstr "Konnte·url·nicht·zuweisen\n"
3728
3729#, fuzzy, c-format
3730msgid "Could not reallocate units [%d]\n"
3731msgstr "Konnte·url·nicht·zuweisen\n"
3732
3733msgid "Could not realloc() units\n"
3734msgstr ""
3735
3736#, fuzzy
3737msgid "Rate multiplier must be a positive integer"
3738msgstr "Paketgröße muss ein positiver Integer sein"
3739
3740#, fuzzy
3741msgid "No host specified\n"
3742msgstr ""
3743"Kein Hostname angegeben\n"
3744"\n"
3745
3746#, fuzzy
3747msgid "No OIDs specified\n"
3748msgstr ""
3749"Kein Hostname angegeben\n"
3750"\n"
3751
3752#, c-format
3753msgid "Required parameter: %s\n"
3754msgstr ""
3755
3756msgid "Invalid seclevel"
3757msgstr ""
3758
3759msgid "Invalid SNMP version"
3760msgstr ""
3761
3762msgid "Unbalanced quotes\n"
3763msgstr ""
3764
3765#, c-format
3766msgid "multiplier set (%.1f), but input is not a number: %s"
3767msgstr ""
3768
3769msgid "Check status of remote machines and obtain system information via SNMP"
3770msgstr ""
3771
3772msgid "Use SNMP GETNEXT instead of SNMP GET"
3773msgstr ""
3774
3775msgid "SNMP protocol version"
3776msgstr ""
3777
3778msgid "SNMPv3 context"
3779msgstr ""
3780
3781msgid "SNMPv3 securityLevel"
3782msgstr ""
3783
3784msgid "SNMPv3 auth proto"
3785msgstr ""
3786
3787msgid "SNMPv3 priv proto (default DES)"
3788msgstr ""
3789
3790msgid "Optional community string for SNMP communication"
3791msgstr ""
3792
3793msgid "default is"
3794msgstr ""
3795
3796msgid "SNMPv3 username"
3797msgstr ""
3798
3799msgid "SNMPv3 authentication password"
3800msgstr ""
3801
3802msgid "SNMPv3 privacy password"
3803msgstr ""
3804
3805msgid "Object identifier(s) or SNMP variables whose value you wish to query"
3806msgstr ""
3807
3808msgid ""
3809"List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"
3810msgstr ""
3811
3812msgid "for symbolic OIDs.)"
3813msgstr ""
3814
3815msgid "Delimiter to use when parsing returned data. Default is"
3816msgstr ""
3817
3818msgid "Any data on the right hand side of the delimiter is considered"
3819msgstr ""
3820
3821msgid "to be the data that should be used in the evaluation."
3822msgstr ""
3823
3824msgid "If the check returns a 0 length string or NULL value"
3825msgstr ""
3826
3827msgid "This option allows you to choose what status you want it to exit"
3828msgstr ""
3829
3830msgid "Excluding this option renders the default exit of 3(STATE_UNKNOWN)"
3831msgstr ""
3832
3833msgid "0 = OK"
3834msgstr ""
3835
3836#, fuzzy
3837msgid "1 = WARNING"
3838msgstr "WARNING"
3839
3840#, fuzzy
3841msgid "2 = CRITICAL"
3842msgstr "CRITICAL"
3843
3844#, fuzzy
3845msgid "3 = UNKNOWN"
3846msgstr "UNKNOWN"
3847
3848#, fuzzy
3849msgid "Warning threshold range(s)"
3850msgstr "Warning threshold Integer sein"
3851
3852#, fuzzy
3853msgid "Critical threshold range(s)"
3854msgstr "Critical threshold muss ein Integer sein"
3855
3856msgid "Enable rate calculation. See 'Rate Calculation' below"
3857msgstr ""
3858
3859msgid ""
3860"Converts rate per second. For example, set to 60 to convert to per minute"
3861msgstr ""
3862
3863msgid "Add/subtract the specified OFFSET to numeric sensor data"
3864msgstr ""
3865
3866msgid "Return OK state (for that OID) if STRING is an exact match"
3867msgstr ""
3868
3869msgid ""
3870"Return OK state (for that OID) if extended regular expression REGEX matches"
3871msgstr ""
3872
3873msgid ""
3874"Return OK state (for that OID) if case-insensitive extended REGEX matches"
3875msgstr ""
3876
3877msgid "Invert search result (CRITICAL if found)"
3878msgstr ""
3879
3880msgid "Prefix label for output from plugin"
3881msgstr ""
3882
3883msgid "Units label(s) for output data (e.g., 'sec.')."
3884msgstr ""
3885
3886msgid "Separates output on multiple OID requests"
3887msgstr ""
3888
3889msgid "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
3890msgstr ""
3891
3892msgid "C-style format string for float values (see option -M)"
3893msgstr ""
3894
3895msgid ""
3896"NOTE the final timeout value is calculated using this formula: "
3897"timeout_interval * retries + 5"
3898msgstr ""
3899
3900msgid "Number of retries to be used in the requests, default: "
3901msgstr ""
3902
3903msgid "Label performance data with OIDs instead of --label's"
3904msgstr ""
3905
3906msgid "Tell snmpget to not print errors encountered when parsing MIB files"
3907msgstr ""
3908
3909msgid ""
3910"This plugin uses the 'snmpget' command included with the NET-SNMP package."
3911msgstr ""
3912
3913msgid ""
3914"if you don't have the package installed, you will need to download it from"
3915msgstr ""
3916
3917msgid "http://net-snmp.sourceforge.net before you can use this plugin."
3918msgstr ""
3919
3920msgid ""
3921"- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "
3922msgstr ""
3923
3924msgid "list (lists with internal spaces must be quoted)."
3925msgstr ""
3926
3927msgid ""
3928"- When checking multiple OIDs, separate ranges by commas like '-w "
3929"1:10,1:,:20'"
3930msgstr ""
3931
3932msgid "- Note that only one string and one regex may be checked at present"
3933msgstr ""
3934
3935msgid ""
3936"- All evaluation methods other than PR, STR, and SUBSTR expect that the value"
3937msgstr ""
3938
3939msgid "returned from the SNMP query is an unsigned integer."
3940msgstr ""
3941
3942msgid "Rate Calculation:"
3943msgstr ""
3944
3945msgid "In many places, SNMP returns counters that are only meaningful when"
3946msgstr ""
3947
3948msgid "calculating the counter difference since the last check. check_snmp"
3949msgstr ""
3950
3951msgid "saves the last state information in a file so that the rate per second"
3952msgstr ""
3953
3954msgid "can be calculated. Use the --rate option to save state information."
3955msgstr ""
3956
3957msgid ""
3958"On the first run, there will be no prior state - this will return with OK."
3959msgstr ""
3960
3961msgid "The state is uniquely determined by the arguments to the plugin, so"
3962msgstr ""
3963
3964msgid "changing the arguments will create a new state file."
3965msgstr ""
3966
3967#, fuzzy
3968msgid "Port number must be a positive integer"
3969msgstr "Port muss ein positiver Integer sein"
3970
3971#, c-format
3972msgid "Server answer: %s"
3973msgstr ""
3974
3975#, c-format
3976msgid "SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"
3977msgstr ""
3978
3979#, c-format
3980msgid ""
3981"SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"
3982msgstr ""
3983
3984#, c-format
3985msgid "SSH OK - %s (protocol %s) | %s\n"
3986msgstr ""
3987
3988msgid "Try to connect to an SSH server at specified server and port"
3989msgstr ""
3990
3991msgid ""
3992"Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
3993msgstr ""
3994
3995msgid "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
3996msgstr ""
3997
3998#, c-format
3999msgid "Command: %s\n"
4000msgstr ""
4001
4002#, c-format
4003msgid "Format: %s\n"
4004msgstr ""
4005
4006#, c-format
4007msgid "total=%.0f, used=%.0f, free=%.0f\n"
4008msgstr ""
4009
4010#, c-format
4011msgid "total=%.0f, free=%.0f\n"
4012msgstr ""
4013
4014msgid "Error getting swap devices\n"
4015msgstr ""
4016
4017msgid "SWAP OK: No swap devices defined\n"
4018msgstr ""
4019
4020msgid "swapctl failed: "
4021msgstr ""
4022
4023msgid "Error in swapctl call\n"
4024msgstr ""
4025
4026#, c-format
4027msgid "SWAP %s - %d%% free (%dMB out of %dMB) %s|"
4028msgstr ""
4029
4030#, fuzzy
4031msgid "Warning threshold percentage must be <= 100!"
4032msgstr "Warning threshold Integer sein"
4033
4034#, fuzzy
4035msgid "Warning threshold be positive integer or percentage!"
4036msgstr "Warning threshold muss ein Integer oder ein Prozentwert sein"
4037
4038#, fuzzy
4039msgid "Critical threshold percentage must be <= 100!"
4040msgstr "Critical threshold muss ein Integer sein"
4041
4042#, fuzzy
4043msgid "Critical threshold be positive integer or percentage!"
4044msgstr "Critical threshold muss ein Integer oder ein Prozentwert sein!"
4045
4046msgid ""
4047"no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
4048"or integer (0-3)."
4049msgstr ""
4050
4051#, fuzzy
4052msgid "Warning should be more than critical"
4053msgstr "Warning threshold muss ein Integer oder ein Prozentwert sein"
4054
4055msgid "Check swap space on local machine."
4056msgstr ""
4057
4058msgid ""
4059"Exit with WARNING status if less than INTEGER bytes of swap space are free"
4060msgstr ""
4061
4062msgid "Exit with WARNING status if less than PERCENT of swap space is free"
4063msgstr ""
4064
4065msgid ""
4066"Exit with CRITICAL status if less than INTEGER bytes of swap space are free"
4067msgstr ""
4068
4069msgid "Exit with CRITICAL status if less than PERCENT of swap space is free"
4070msgstr ""
4071
4072msgid "Conduct comparisons for all swap partitions, one by one"
4073msgstr ""
4074
4075msgid ""
4076"Resulting state when there is no swap regardless of thresholds. Default:"
4077msgstr ""
4078
4079msgid ""
4080"Both INTEGER and PERCENT thresholds can be specified, they are all checked."
4081msgstr ""
4082
4083msgid "On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."
4084msgstr ""
4085
4086msgid "CRITICAL - Generic check_tcp called with unknown service\n"
4087msgstr ""
4088
4089msgid "With UDP checks, a send/expect string must be specified."
4090msgstr ""
4091
4092msgid "No arguments found"
4093msgstr ""
4094
4095msgid "Maxbytes must be a positive integer"
4096msgstr "Maxbytes muss ein positiver Integer sein"
4097
4098msgid "Refuse must be one of ok, warn, crit"
4099msgstr ""
4100
4101msgid "Mismatch must be one of ok, warn, crit"
4102msgstr ""
4103
4104msgid "Delay must be a positive integer"
4105msgstr "Delay muss ein positiver Integer sein"
4106
4107#, fuzzy
4108msgid "You must provide a server address"
4109msgstr "%s: Hostname muss angegeben werden\n"
4110
4111#, fuzzy
4112msgid "Invalid hostname, address or socket"
4113msgstr "Ungültige(r) Hostname/Adresse"
4114
4115#, fuzzy, c-format
4116msgid ""
4117"This plugin tests %s connections with the specified host (or unix socket).\n"
4118"\n"
4119msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
4120
4121msgid ""
4122"Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send "
4123"or quit option"
4124msgstr ""
4125
4126msgid "Default: nothing added to send, \\r\\n added to end of quit"
4127msgstr ""
4128
4129msgid "String to send to the server"
4130msgstr ""
4131
4132msgid "String to expect in server response"
4133msgstr ""
4134
4135msgid "(may be repeated)"
4136msgstr ""
4137
4138msgid "All expect strings need to occur in server response. Default is any"
4139msgstr ""
4140
4141msgid "String to send server to initiate a clean close of the connection"
4142msgstr ""
4143
4144msgid "Accept TCP refusals with states ok, warn, crit (default: crit)"
4145msgstr ""
4146
4147msgid ""
4148"Accept expected string mismatches with states ok, warn, crit (default: warn)"
4149msgstr ""
4150
4151#, fuzzy
4152msgid "Hide output from TCP socket"
4153msgstr "Konnte TCP socket nicht öffnen\n"
4154
4155msgid "Close connection once more than this number of bytes are received"
4156msgstr ""
4157
4158msgid "Seconds to wait between sending string and polling for response"
4159msgstr ""
4160
4161msgid "1st is #days for warning, 2nd is critical (if not specified - 0)."
4162msgstr ""
4163
4164msgid "Use SSL for the connection."
4165msgstr ""
4166
4167msgid "SSL server_name"
4168msgstr ""
4169
4170#, c-format
4171msgid "TIME UNKNOWN - could not connect to server %s, port %d\n"
4172msgstr ""
4173
4174#, c-format
4175msgid "TIME UNKNOWN - could not send UDP request to server %s, port %d\n"
4176msgstr ""
4177
4178#, c-format
4179msgid "TIME UNKNOWN - no data received from server %s, port %d\n"
4180msgstr ""
4181
4182#, c-format
4183msgid "TIME %s - %d second response time|%s\n"
4184msgstr ""
4185
4186#, c-format
4187msgid "TIME %s - %lu second time difference|%s %s\n"
4188msgstr ""
4189
4190msgid "Warning thresholds must be a positive integer"
4191msgstr "Warning thresholds muss ein positiver Integer sein"
4192
4193msgid "Critical thresholds must be a positive integer"
4194msgstr "Critical thresholds muss ein positiver Integer sein"
4195
4196#, fuzzy
4197msgid "This plugin will check the time on the specified host."
4198msgstr ""
4199"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
4200"\n"
4201
4202msgid "Use UDP to connect, not TCP"
4203msgstr ""
4204
4205msgid "Time difference (sec.) necessary to result in a warning status"
4206msgstr ""
4207
4208msgid "Time difference (sec.) necessary to result in a critical status"
4209msgstr ""
4210
4211msgid "Response time (sec.) necessary to result in warning status"
4212msgstr ""
4213
4214msgid "Response time (sec.) necessary to result in critical status"
4215msgstr ""
4216
4217msgid "On Battery, Low Battery"
4218msgstr ""
4219
4220msgid "Online"
4221msgstr ""
4222
4223msgid "On Battery"
4224msgstr ""
4225
4226msgid ", Low Battery"
4227msgstr ""
4228
4229msgid ", Calibrating"
4230msgstr ""
4231
4232msgid ", Replace Battery"
4233msgstr ""
4234
4235msgid ", On Bypass"
4236msgstr ""
4237
4238msgid ", Overload"
4239msgstr ""
4240
4241msgid ", Trimming"
4242msgstr ""
4243
4244msgid ", Boosting"
4245msgstr ""
4246
4247msgid ", Charging"
4248msgstr ""
4249
4250msgid ", Discharging"
4251msgstr ""
4252
4253msgid ", Unknown"
4254msgstr ""
4255
4256#, fuzzy
4257msgid "UPS does not support any available options\n"
4258msgstr "IPv6 Unterstützung nicht vorhanden"
4259
4260#, fuzzy
4261msgid "Invalid response received from host"
4262msgstr "Ungültige HTTP Antwort von Host empfangen\n"
4263
4264msgid "UPS name to long for buffer"
4265msgstr ""
4266
4267#, fuzzy, c-format
4268msgid "CRITICAL - no such UPS '%s' on that host\n"
4269msgstr "%s [%s nicht gefunden]"
4270
4271#, fuzzy
4272msgid "CRITICAL - UPS data is stale"
4273msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
4274
4275#, fuzzy, c-format
4276msgid "Unknown error: %s\n"
4277msgstr "Papierfehler"
4278
4279msgid "Error: unable to parse variable"
4280msgstr ""
4281
4282msgid "Unrecognized UPS variable"
4283msgstr ""
4284
4285msgid "Error : no UPS indicated"
4286msgstr ""
4287
4288#, fuzzy
4289msgid ""
4290"This plugin tests the UPS service on the specified host. Network UPS Tools"
4291msgstr ""
4292"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
4293"\n"
4294
4295msgid "from www.networkupstools.org must be running for this plugin to work."
4296msgstr ""
4297
4298msgid "Name of UPS"
4299msgstr ""
4300
4301msgid "Output of temperatures in Celsius"
4302msgstr ""
4303
4304msgid "Valid values for STRING are"
4305msgstr ""
4306
4307msgid ""
4308"This plugin attempts to determine the status of a UPS (Uninterruptible Power"
4309msgstr ""
4310
4311msgid ""
4312"Supply) on a local or remote host. If the UPS is online or calibrating, the"
4313msgstr ""
4314
4315msgid ""
4316"plugin will return an OK state. If the battery is on it will return a WARNING"
4317msgstr ""
4318
4319msgid ""
4320"state. If the UPS is off or has a low battery the plugin will return a "
4321"CRITICAL"
4322msgstr ""
4323
4324msgid ""
4325"You may also specify a variable to check (such as temperature, utility "
4326"voltage,"
4327msgstr ""
4328
4329msgid ""
4330"battery load, etc.) as well as warning and critical thresholds for the value"
4331msgstr ""
4332
4333msgid ""
4334"of that variable. If the remote host has multiple UPS that are being "
4335"monitored"
4336msgstr ""
4337
4338msgid "you will have to use the --ups option to specify which UPS to check."
4339msgstr ""
4340
4341msgid ""
4342"This plugin requires that the UPSD daemon distributed with Russell Kroll's"
4343msgstr ""
4344
4345msgid ""
4346"Network UPS Tools be installed on the remote host. If you do not have the"
4347msgstr ""
4348
4349msgid "package installed on your system, you can download it from"
4350msgstr ""
4351
4352msgid "http://www.networkupstools.org"
4353msgstr ""
4354
4355#, fuzzy, c-format
4356msgid "Could not enumerate RD sessions: %d\n"
4357msgstr "Konnte·url·nicht·zuweisen\n"
4358
4359#, c-format
4360msgid "# users=%d"
4361msgstr ""
4362
4363msgid "Unable to read output"
4364msgstr ""
4365
4366#, c-format
4367msgid "USERS %s - %d users currently logged in |%s\n"
4368msgstr ""
4369
4370#, fuzzy
4371msgid "This plugin checks the number of users currently logged in on the local"
4372msgstr ""
4373"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem\n"
4374"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
4375"unterschritten wird.\n"
4376"\n"
4377
4378msgid ""
4379"system and generates an error if the number exceeds the thresholds specified."
4380msgstr ""
4381
4382msgid "Set WARNING status if more than INTEGER users are logged in"
4383msgstr ""
4384
4385msgid "Set CRITICAL status if more than INTEGER users are logged in"
4386msgstr ""
4387
4388msgid ""
4389"DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."
4390msgstr ""
4391
4392msgid "Nagios-compatible output is now always returned."
4393msgstr ""
4394
4395msgid "SMART commands are broken and have been disabled (See Notes in --help)."
4396msgstr ""
4397
4398msgid ""
4399"DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"
4400msgstr ""
4401
4402msgid "default and will be removed from future releases."
4403msgstr ""
4404
4405#, fuzzy, c-format
4406msgid "CRITICAL - Couldn't open device %s: %s\n"
4407msgstr "CRITICAL - Device konnte nicht geöffnet werden: %s\n"
4408
4409#, c-format
4410msgid "CRITICAL - SMART_CMD_ENABLE\n"
4411msgstr ""
4412
4413#, c-format
4414msgid "CRITICAL - SMART_READ_VALUES: %s\n"
4415msgstr ""
4416
4417#, c-format
4418msgid "CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"
4419msgstr ""
4420
4421#, c-format
4422msgid "WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"
4423msgstr ""
4424
4425#, c-format
4426msgid "OK - Operational (%d/%d tests passed)\n"
4427msgstr ""
4428
4429#, c-format
4430msgid "ERROR - Status '%d' unknown. %d/%d tests passed\n"
4431msgstr ""
4432
4433#, c-format
4434msgid "OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"
4435msgstr ""
4436
4437#, c-format
4438msgid "OffLineCapability=%d {%s %s %s}\n"
4439msgstr ""
4440
4441#, c-format
4442msgid "SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"
4443msgstr ""
4444
4445#, c-format
4446msgid "CRITICAL - %s: %s\n"
4447msgstr ""
4448
4449#, c-format
4450msgid "OK - Command sent (%s)\n"
4451msgstr ""
4452
4453#, c-format
4454msgid "CRITICAL - SMART_READ_THRESHOLDS: %s\n"
4455msgstr ""
4456
4457#, c-format
4458msgid ""
4459"This plugin checks a local hard drive with the (Linux specific) SMART "
4460"interface [http://smartlinux.sourceforge.net/smart/index.php]."
4461msgstr ""
4462
4463msgid "Select device DEVICE"
4464msgstr ""
4465
4466msgid ""
4467"Note: if the device is specified without this option, any further option will"
4468msgstr ""
4469
4470msgid "be ignored."
4471msgstr ""
4472
4473msgid ""
4474"The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"
4475msgstr ""
4476
4477msgid ""
4478"broken in an underhand manner and have been disabled. You can use smartctl"
4479msgstr ""
4480
4481msgid "instead:"
4482msgstr ""
4483
4484msgid "-0/--auto-off: use \"smartctl --offlineauto=off\""
4485msgstr ""
4486
4487msgid "-1/--auto-on: use \"smartctl --offlineauto=on\""
4488msgstr ""
4489
4490msgid "-i/--immediate: use \"smartctl --test=offline\""
4491msgstr ""
4492
4493#, fuzzy
4494msgid "No data returned from command\n"
4495msgstr "Keine Daten empfangen %s\n"
4496
4497msgid ""
4498"Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
4499"or integer (0-3)."
4500msgstr ""
4501
4502msgid ""
4503"Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer "
4504"(0-3)."
4505msgstr ""
4506
4507msgid ""
4508"Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4509"integer (0-3)."
4510msgstr ""
4511
4512msgid ""
4513"Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4514"integer (0-3)."
4515msgstr ""
4516
4517msgid ""
4518"Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4519"integer (0-3)."
4520msgstr ""
4521
4522msgid "Require path to command"
4523msgstr ""
4524
4525msgid ""
4526"Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."
4527msgstr ""
4528
4529msgid "Additional switches can be used to control which state becomes what."
4530msgstr ""
4531
4532msgid "Keep timeout longer than the plugin timeout to retain CRITICAL status."
4533msgstr ""
4534
4535msgid "Custom result on Negate timeouts; see below for STATUS definition\n"
4536msgstr ""
4537
4538#, c-format
4539msgid ""
4540" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"
4541msgstr ""
4542
4543#, c-format
4544msgid ""
4545" quotes. Numeric values are accepted. If nothing is specified, permutes\n"
4546msgstr ""
4547
4548#, c-format
4549msgid " OK and CRITICAL.\n"
4550msgstr ""
4551
4552#, c-format
4553msgid ""
4554" Substitute output text as well. Will only substitute text in CAPITALS\n"
4555msgstr ""
4556
4557msgid "Run check_ping and invert result. Must use full path to plugin"
4558msgstr ""
4559
4560msgid "This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"
4561msgstr ""
4562
4563msgid ""
4564"This plugin is a wrapper to take the output of another plugin and invert it."
4565msgstr ""
4566
4567msgid "The full path of the plugin must be provided."
4568msgstr ""
4569
4570msgid "If the wrapped plugin returns OK, the wrapper will return CRITICAL."
4571msgstr ""
4572
4573msgid "If the wrapped plugin returns CRITICAL, the wrapper will return OK."
4574msgstr ""
4575
4576msgid "Otherwise, the output state of the wrapped plugin is unchanged."
4577msgstr ""
4578
4579msgid ""
4580"Using timeout-result, it is possible to override the timeout behaviour or a"
4581msgstr ""
4582
4583msgid "plugin by setting the negate timeout a bit lower."
4584msgstr ""
4585
4586#, fuzzy, c-format
4587msgid "%s - Socket timeout after %d seconds\n"
4588msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
4589
4590#, fuzzy, c-format
4591msgid "%s - Abnormal timeout after %d seconds\n"
4592msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
4593
4594msgid "Send failed"
4595msgstr ""
4596
4597#, fuzzy
4598msgid "No data was received from host!"
4599msgstr "Keine Daten empfangen %s\n"
4600
4601msgid "Socket creation failed"
4602msgstr ""
4603
4604msgid "Supplied path too long unix domain socket"
4605msgstr ""
4606
4607msgid "Receive failed"
4608msgstr ""
4609
4610#, fuzzy, c-format
4611msgid "Invalid hostname/address - %s"
4612msgstr ""
4613"Ungültige(r) Name/Adresse: %s\n"
4614"\n"
4615
4616#, fuzzy
4617msgid "Could not malloc argv array in popen()"
4618msgstr "Konnte addr nicht zuweisen\n"
4619
4620#, fuzzy
4621msgid "CRITICAL - You need more args!!!"
4622msgstr "CRITICAL - Fehler: %s\n"
4623
4624#, fuzzy
4625msgid "Cannot catch SIGCHLD"
4626msgstr "Konnte SIGALRM nicht erhalten"
4627
4628#, fuzzy, c-format
4629msgid "CRITICAL - Plugin timed out after %d seconds\n"
4630msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
4631
4632msgid "CRITICAL - popen timeout received, but no child process"
4633msgstr ""
4634
4635#, c-format
4636msgid ""
4637"%s UNKNOWN - No data received from host\n"
4638"CMD: %s</A>\n"
4639msgstr ""
4640
4641msgid ""
4642"This plugin wraps the text output of another command (plugin) in HTML <A>"
4643msgstr ""
4644
4645msgid ""
4646"tags, thus displaying the child plugin's output as a clickable link in "
4647"compatible"
4648msgstr ""
4649
4650msgid ""
4651"monitoring status screen. This plugin returns the status of the invoked "
4652"plugin."
4653msgstr ""
4654
4655msgid ""
4656"Pay close attention to quoting to ensure that the shell passes the expected"
4657msgstr ""
4658
4659msgid "data to the plugin. For example, in:"
4660msgstr ""
4661
4662msgid "urlize http://example.com/ check_http -H example.com -r 'two words'"
4663msgstr ""
4664
4665msgid "the shell will remove the single quotes and urlize will see:"
4666msgstr ""
4667
4668msgid "urlize http://example.com/ check_http -H example.com -r two words"
4669msgstr ""
4670
4671msgid "You probably want:"
4672msgstr ""
4673
4674msgid "urlize http://example.com/ \"check_http -H example.com -r 'two words'\""
4675msgstr ""
4676
4677#, fuzzy
4678msgid "failed realloc in strpcpy\n"
4679msgstr "konnte keinen Speicher für '%s' reservieren\n"
4680
4681#, fuzzy
4682msgid "failed malloc in strscat\n"
4683msgstr "konnte keinen Speicher für '%s' reservieren\n"
4684
4685#, fuzzy
4686msgid "failed malloc in xvasprintf\n"
4687msgstr "konnte keinen Speicher für '%s' reservieren\n"
4688
4689msgid "sysconf error for _SC_OPEN_MAX\n"
4690msgstr ""
4691
4692#, c-format
4693msgid ""
4694" %s (-h | --help) for detailed help\n"
4695" %s (-V | --version) for version information\n"
4696msgstr ""
4697
4698msgid ""
4699"\n"
4700"Options:\n"
4701" -h, --help\n"
4702" Print detailed help screen\n"
4703" -V, --version\n"
4704" Print version information\n"
4705msgstr ""
4706
4707#, c-format
4708msgid ""
4709" -H, --hostname=ADDRESS\n"
4710" Host name, IP Address, or unix socket (must be an absolute path)\n"
4711" -%c, --port=INTEGER\n"
4712" Port number (default: %s)\n"
4713msgstr ""
4714
4715msgid ""
4716" -4, --use-ipv4\n"
4717" Use IPv4 connection\n"
4718" -6, --use-ipv6\n"
4719" Use IPv6 connection\n"
4720msgstr ""
4721
4722msgid ""
4723" -v, --verbose\n"
4724" Show details for command-line debugging (output may be truncated by\n"
4725" the monitoring system)\n"
4726msgstr ""
4727
4728msgid ""
4729" -w, --warning=DOUBLE\n"
4730" Response time to result in warning status (seconds)\n"
4731" -c, --critical=DOUBLE\n"
4732" Response time to result in critical status (seconds)\n"
4733msgstr ""
4734
4735msgid ""
4736" -w, --warning=RANGE\n"
4737" Warning range (format: start:end). Alert if outside this range\n"
4738" -c, --critical=RANGE\n"
4739" Critical range\n"
4740msgstr ""
4741
4742#, c-format
4743msgid ""
4744" -t, --timeout=INTEGER\n"
4745" Seconds before connection times out (default: %d)\n"
4746msgstr ""
4747
4748#, c-format
4749msgid ""
4750" -t, --timeout=INTEGER\n"
4751" Seconds before plugin times out (default: %d)\n"
4752msgstr ""
4753
4754msgid ""
4755" --extra-opts=[section][@file]\n"
4756" Read options from an ini file. See\n"
4757" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
4758" for usage and examples.\n"
4759msgstr ""
4760
4761msgid ""
4762" See:\n"
4763" https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"
4764" for THRESHOLD format and examples.\n"
4765msgstr ""
4766
4767msgid ""
4768"\n"
4769"Send email to help@monitoring-plugins.org if you have questions regarding\n"
4770"use of this software. To submit patches or suggest improvements, send email\n"
4771"to devel@monitoring-plugins.org\n"
4772"\n"
4773msgstr ""
4774
4775msgid ""
4776"\n"
4777"The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may "
4778"redistribute\n"
4779"copies of the plugins under the terms of the GNU General Public License.\n"
4780"For more information about these matters, see the file named COPYING.\n"
4781msgstr ""
4782
4783#, c-format
4784msgid "Error: Could not get hardware address of interface '%s'\n"
4785msgstr ""
4786
4787#, c-format
4788msgid "Error: if_nametoindex error - %s.\n"
4789msgstr ""
4790
4791#, c-format
4792msgid "Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"
4793msgstr ""
4794
4795#, c-format
4796msgid ""
4797"Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"
4798msgstr ""
4799
4800#, c-format
4801msgid "Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"
4802msgstr ""
4803
4804#, c-format
4805msgid ""
4806"Error: can't find unit number in interface_name (%s) - expecting TypeNumber "
4807"eg lnc0.\n"
4808msgstr ""
4809
4810#, c-format
4811msgid ""
4812"Error: can't read MAC address from DLPI streams interface for device %s unit "
4813"%d.\n"
4814msgstr ""
4815
4816#, c-format
4817msgid ""
4818"Error: can't get MAC address for this architecture. Use the --mac option.\n"
4819msgstr ""
4820
4821#, c-format
4822msgid "Error: Cannot determine IP address of interface %s\n"
4823msgstr ""
4824
4825#, c-format
4826msgid "Error: Cannot get interface IP address on this platform.\n"
4827msgstr ""
4828
4829#, c-format
4830msgid "Pretending to be relay client %s\n"
4831msgstr ""
4832
4833#, c-format
4834msgid "DHCPDISCOVER to %s port %d\n"
4835msgstr ""
4836
4837#, c-format
4838msgid "Result=ERROR\n"
4839msgstr ""
4840
4841#, c-format
4842msgid "Result=OK\n"
4843msgstr ""
4844
4845#, c-format
4846msgid "DHCPOFFER from IP address %s"
4847msgstr ""
4848
4849#, c-format
4850msgid " via %s\n"
4851msgstr ""
4852
4853#, c-format
4854msgid ""
4855"DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"
4856msgstr ""
4857
4858#, c-format
4859msgid "DHCPOFFER hardware address did not match our own - ignoring packet\n"
4860msgstr ""
4861
4862#, c-format
4863msgid "Total responses seen on the wire: %d\n"
4864msgstr ""
4865
4866#, fuzzy, c-format
4867msgid "Valid responses for this machine: %d\n"
4868msgstr "Keine Antwort vom Host \n"
4869
4870#, c-format
4871msgid "send_dhcp_packet result: %d\n"
4872msgstr ""
4873
4874#, fuzzy, c-format
4875msgid "No (more) data received (nfound: %d)\n"
4876msgstr "Keine Daten empfangen %s\n"
4877
4878#, c-format
4879msgid "recvfrom() failed, "
4880msgstr ""
4881
4882#, c-format
4883msgid "receive_dhcp_packet() result: %d\n"
4884msgstr ""
4885
4886#, c-format
4887msgid "receive_dhcp_packet() source: %s\n"
4888msgstr ""
4889
4890#, c-format
4891msgid "Error: Could not create socket!\n"
4892msgstr ""
4893
4894#, c-format
4895msgid "Error: Could not set reuse address option on DHCP socket!\n"
4896msgstr ""
4897
4898#, c-format
4899msgid "Error: Could not set broadcast option on DHCP socket!\n"
4900msgstr ""
4901
4902#, c-format
4903msgid ""
4904"Error: Could not bind socket to interface %s. Check your privileges...\n"
4905msgstr ""
4906
4907#, c-format
4908msgid ""
4909"Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"
4910msgstr ""
4911
4912#, c-format
4913msgid "Requested server address: %s\n"
4914msgstr ""
4915
4916#, c-format
4917msgid "Lease Time: Infinite\n"
4918msgstr ""
4919
4920#, c-format
4921msgid "Lease Time: %lu seconds\n"
4922msgstr ""
4923
4924#, c-format
4925msgid "Renewal Time: Infinite\n"
4926msgstr ""
4927
4928#, c-format
4929msgid "Renewal Time: %lu seconds\n"
4930msgstr ""
4931
4932#, c-format
4933msgid "Rebinding Time: Infinite\n"
4934msgstr ""
4935
4936#, c-format
4937msgid "Rebinding Time: %lu seconds\n"
4938msgstr ""
4939
4940#, c-format
4941msgid "Added offer from server @ %s"
4942msgstr ""
4943
4944#, c-format
4945msgid " of IP address %s\n"
4946msgstr ""
4947
4948#, c-format
4949msgid "DHCP Server Match: Offerer=%s"
4950msgstr ""
4951
4952#, c-format
4953msgid " Requested=%s"
4954msgstr ""
4955
4956#, c-format
4957msgid " (duplicate)"
4958msgstr ""
4959
4960#, c-format
4961msgid "\n"
4962msgstr ""
4963
4964#, c-format
4965msgid "No DHCPOFFERs were received.\n"
4966msgstr ""
4967
4968#, c-format
4969msgid "Received %d DHCPOFFER(s)"
4970msgstr ""
4971
4972#, c-format
4973msgid ", %s%d of %d requested servers responded"
4974msgstr ""
4975
4976#, c-format
4977msgid ", requested address (%s) was %soffered"
4978msgstr ""
4979
4980msgid "not "
4981msgstr ""
4982
4983#, c-format
4984msgid ", max lease time = "
4985msgstr ""
4986
4987#, c-format
4988msgid "Infinity"
4989msgstr ""
4990
4991msgid "Got unexpected non-option argument"
4992msgstr ""
4993
4994#, c-format
4995msgid "Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"
4996msgstr ""
4997
4998#, c-format
4999msgid "Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"
5000msgstr ""
5001
5002#, c-format
5003msgid "Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"
5004msgstr ""
5005
5006#, c-format
5007msgid ""
5008"Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"
5009msgstr ""
5010
5011#, c-format
5012msgid "Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"
5013msgstr ""
5014
5015#, c-format
5016msgid "Hardware address: "
5017msgstr ""
5018
5019msgid "This plugin tests the availability of DHCP servers on a network."
5020msgstr ""
5021
5022msgid "IP address of DHCP server that we must hear from"
5023msgstr ""
5024
5025msgid "IP address that should be offered by at least one DHCP server"
5026msgstr ""
5027
5028msgid "Seconds to wait for DHCPOFFER before timeout occurs"
5029msgstr ""
5030
5031msgid "Interface to to use for listening (i.e. eth0)"
5032msgstr ""
5033
5034msgid "MAC address to use in the DHCP request"
5035msgstr ""
5036
5037msgid "Unicast testing: mimic a DHCP relay, requires -s"
5038msgstr ""
5039
5040msgid "specify a target"
5041msgstr ""
5042
5043msgid "Use IPv4 (default) or IPv6 to communicate with the targets"
5044msgstr ""
5045
5046#, fuzzy
5047msgid "warning threshold (currently "
5048msgstr "Warning threshold Integer sein"
5049
5050#, fuzzy
5051msgid "critical threshold (currently "
5052msgstr "Critical threshold muss ein Integer sein"
5053
5054#, fuzzy
5055msgid "specify a source IP address or device name"
5056msgstr "Hostname oder Serveradresse muss angegeben werden"
5057
5058msgid "number of packets to send (currently "
5059msgstr ""
5060
5061msgid "max packet interval (currently "
5062msgstr ""
5063
5064msgid "max target interval (currently "
5065msgstr ""
5066
5067msgid "number of alive hosts required for success"
5068msgstr ""
5069
5070msgid "TTL on outgoing packets (currently "
5071msgstr ""
5072
5073msgid "timeout value (seconds, currently "
5074msgstr ""
5075
5076msgid "Number of icmp data bytes to send"
5077msgstr ""
5078
5079msgid "Packet size will be data bytes + icmp header (currently"
5080msgstr ""
5081
5082msgid "verbose"
5083msgstr ""
5084
5085msgid "The -H switch is optional. Naming a host (or several) to check is not."
5086msgstr ""
5087
5088msgid ""
5089"Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"
5090msgstr ""
5091
5092msgid "packet loss. The default values should work well for most users."
5093msgstr ""
5094
5095msgid ""
5096"You can specify different RTA factors using the standardized abbreviations"
5097msgstr ""
5098
5099msgid ""
5100"us (microseconds), ms (milliseconds, default) or just plain s for seconds."
5101msgstr ""
5102
5103msgid "The -v switch can be specified several times for increased verbosity."
5104msgstr ""
5105
5106#, fuzzy, c-format
5107#~ msgid "%s - Plugin timed out after %d seconds\n"
5108#~ msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
5109
5110#, fuzzy
5111#~ msgid "Critical Process Count must be an integer!"
5112#~ msgstr "Critical threshold muss ein Integer sein"
5113
5114#, fuzzy
5115#~ msgid "Warning Process Count must be an integer!"
5116#~ msgstr "Warning threshold Integer sein"
5117
5118#, fuzzy
5119#~ msgid "CRITICAL - Cannot retrieve server certificate."
5120#~ msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
5121
5122#~ msgid "CRITICAL - Cannot retrieve server certificate.\n"
5123#~ msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
5124
5125#~ msgid "Invalid HTTP response received from host\n"
5126#~ msgstr "Ungültige HTTP Antwort von Host empfangen\n"
5127
5128#~ msgid "Invalid HTTP response received from host on port %d\n"
5129#~ msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
5130
5131#~ msgid "HTTP CRITICAL: %s\n"
5132#~ msgstr "HTTP CRITICAL: %s\n"
5133
5134#~ msgid "HTTP WARNING: %s\n"
5135#~ msgstr "HTTP WARNING: %s\n"
5136
5137#~ msgid "HTTP UNKNOWN"
5138#~ msgstr "HTTP UNKNOWN"
5139
5140#~ msgid "HTTP OK"
5141#~ msgstr "HTTP OK"
5142
5143#~ msgid "HTTP WARNING"
5144#~ msgstr "HTTP WARNING"
5145
5146#~ msgid "HTTP CRITICAL"
5147#~ msgstr "HTTP CRITICAL"
5148
5149#, fuzzy
5150#~ msgid "HTTP OK %s - %.3f second response time %s|%s %s\n"
5151#~ msgstr "HTTP OK %s - %.3f Sekunde Antwortzeit %s%s|%s %s\n"
5152
5153#~ msgid "HTTP CRITICAL - string not found%s|%s %s\n"
5154#~ msgstr "HTTP CRITICAL - Text nicht gefunden%s|%s %s\n"
5155
5156#, fuzzy
5157#~ msgid "HTTP UNKNOWN - could not allocate url\n"
5158#~ msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
5159
5160#, fuzzy
5161#~ msgid "snmpget returned an error status"
5162#~ msgstr "dig hat einen Fehler zurückgegeben"
5163
5164#, fuzzy
5165#~ msgid "Invalid critical threshold"
5166#~ msgstr "Critical threshold muss ein Integer sein"
5167
5168#, fuzzy
5169#~ msgid "Invalid warning threshold"
5170#~ msgstr "Warning threshold Integer sein"
5171
5172#, fuzzy
5173#~ msgid "HTTP WARNING: %s - %.3f second response time %s|%s %s\n"
5174#~ msgstr "HTTP WARNING: %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
5175
5176#, fuzzy
5177#~ msgid "%s does not exist\n"
5178#~ msgstr "%s [%s nicht gefunden]"
5179
5180#, fuzzy
5181#~ msgid "Unknown error"
5182#~ msgstr "Papierfehler"
5183
5184#, fuzzy
5185#~ msgid "Unknown argument - %s"
5186#~ msgstr ""
5187#~ "%s: Unbekanntes Argument: %s\n"
5188#~ "\n"
5189
5190#~ msgid ""
5191#~ " -1, --proto1\n"
5192#~ " tell ssh to use Protocol 1\n"
5193#~ " -2, --proto2\n"
5194#~ " tell ssh to use Protocol 2\n"
5195#~ " -S, --skiplines=n\n"
5196#~ " Ignore first n lines on STDERR (to suppress a logon banner)\n"
5197#~ " -f\n"
5198#~ " tells ssh to fork rather than create a tty\n"
5199#~ msgstr ""
5200#~ " -1, --proto1\n"
5201#~ " ssh anweisen Protokoll 1 zu verwenden\n"
5202#~ " -2, --proto2\n"
5203#~ " ssh anweisen Protokoll 2 zu verwenden\n"
5204#~ " -S, --skiplines=n\n"
5205#~ " Ignoriere die ersten n Zeilen auf STDERR (um Logon Banner zu "
5206#~ "unterdrücken)\n"
5207#~ " -f\n"
5208#~ " ssh anweisen fork zu nutzen statt ein tty zu erzeugen\n"
5209
5210#~ msgid ""
5211#~ " -C, --command='COMMAND STRING'\n"
5212#~ " command to execute on the remote machine\n"
5213#~ " -l, --logname=USERNAME\n"
5214#~ " SSH user name on remote host [optional]\n"
5215#~ " -i, --identity=KEYFILE\n"
5216#~ " identity of an authorized key [optional]\n"
5217#~ " -O, --output=FILE\n"
5218#~ " external command file for nagios [optional]\n"
5219#~ " -s, --services=LIST\n"
5220#~ " list of nagios service names, separated by ':' [optional]\n"
5221#~ " -n, --name=NAME\n"
5222#~ " short name of host in nagios configuration [optional]\n"
5223#~ msgstr ""
5224#~ " -C, --command='COMMAND STRING'\n"
5225#~ " Befehl der auf der entfernten Maschine ausgeführt werden soll\n"
5226#~ " -l, --logname=USERNAME\n"
5227#~ " SSH user name auf dem entfernten Host [optional]\n"
5228#~ " -i, --identity=KEYFILE\n"
5229#~ " zu verwendende Schlüsseldatei [optional]\n"
5230#~ " -O, --output=FILE\n"
5231#~ " externe Befehlsdatei für nagios [optional]\n"
5232#~ " -s, --services=LIST\n"
5233#~ " Liste von nagios Servicenamen, getrennt durch ':' [optional]\n"
5234#~ " -n, --name=NAME\n"
5235#~ " Shortname des Hosts in der nagios Konfiguration [optional]\n"
5236
5237#, fuzzy
5238#~ msgid "Warning inode threshold must be percentage!\n"
5239#~ msgstr "Warning threshold muss ein Integer oder ein Prozentwert sein!\n"
5240
5241#, fuzzy
5242#~ msgid "Critical inode threshold must be percentage!\n"
5243#~ msgstr "Critical threshold muss ein Integer oder ein Prozentwert sein!\n"
5244
5245#~ msgid "INPUT ERROR: No thresholds specified"
5246#~ msgstr "FEHLER: Kein Schwellwert angegeben"
5247
5248#~ msgid ""
5249#~ "INPUT ERROR: C_DFP (%f) should be less than W_DFP (%.1f) and both should "
5250#~ "be between zero and 100 percent, inclusive"
5251#~ msgstr ""
5252#~ "INPUT ERROR: C_DFP (%f) sollte kleiner sein als W_DFP (%.1f) und beide "
5253#~ "sollten zwischen 0 und 100 Prozent liegen"
5254
5255#, fuzzy
5256#~ msgid ""
5257#~ "INPUT ERROR: C_IDFP (%f) should be less than W_IDFP (%.1f) and both "
5258#~ "should be between zero and 100 percent, inclusive"
5259#~ msgstr ""
5260#~ "INPUT ERROR: C_DFP (%f) sollte kleiner sein als W_DFP (%.1f) und beide "
5261#~ "sollten zwischen 0 und 100 Prozent liegen"
5262
5263#~ msgid ""
5264#~ "INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be "
5265#~ "greater than zero"
5266#~ msgstr ""
5267#~ "INPUT ERROR: C_DF (%lu) sollte kleiner sein als W_DF (%lu) und beide "
5268#~ "sollten größer als 0 sein"
5269
5270#, fuzzy
5271#~ msgid "No response from host on port %d\n"
5272#~ msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
5273
5274#, fuzzy
5275#~ msgid "Invalid response received from host on port %d\n"
5276#~ msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
5277
5278#~ msgid "%.3f seconds response time (%s)"
5279#~ msgstr "%.3f Sekunden Antwortzeit (%s)"
5280
5281#~ msgid ""
5282#~ " -w, --warning=INTEGER\n"
5283#~ " Exit with WARNING status if less than INTEGER --units of disk are "
5284#~ "free\n"
5285#~ " -w, --warning=PERCENT%%\n"
5286#~ " Exit with WARNING status if less than PERCENT of disk space is free\n"
5287#~ " -c, --critical=INTEGER\n"
5288#~ " Exit with CRITICAL status if less than INTEGER --units of disk are "
5289#~ "free\n"
5290#~ " -c, --critical=PERCENT%%\n"
5291#~ " Exit with CRITICAL status if less than PERCENT of disk space is free\n"
5292#~ " -C, --clear\n"
5293#~ " Clear thresholds\n"
5294#~ msgstr ""
5295#~ " -w, --warning=INTEGER\n"
5296#~ " meldet Status WARNING, wenn weniger als INTEGER --Einheiten frei\n"
5297#~ " -w, --warning=PERCENT%%\n"
5298#~ " meldet Status WARNING, wenn weniger als PERCENT --Plattenplatz frei\n"
5299#~ " -c, --critical=INTEGER\n"
5300#~ " meldet Status CRITICAL, wenn weniger als INTEGER --Einheiten frei\n"
5301#~ " -c, --critical=PERCENT%%\n"
5302#~ " meldet Status CRITICAL, wenn weniger als PERCENT --Plattenplatz frei\n"
5303#~ " -C, --clear\n"
5304#~ " Schwellwerte löschen\n"
5305
5306#~ msgid ""
5307#~ "Examples:\n"
5308#~ " check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n"
5309#~ " Checks /tmp and /var at 10%,5% and / at 100MB, 50MB\n"
5310#~ msgstr ""
5311#~ "Beispiel:\n"
5312#~ " check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n"
5313#~ " Prüft /tmp und /var mit 10%,5% und / mit 100MB, 50MB\n"
5314
5315#~ msgid ""
5316#~ "This plugin uses the nslookup program to obtain the IP address\n"
5317#~ "for the given host/domain query. A optional DNS server to use may\n"
5318#~ "be specified. If no DNS server is specified, the default server(s)\n"
5319#~ "specified in /etc/resolv.conf will be used.\n"
5320#~ "\n"
5321#~ msgstr ""
5322#~ "Dieses Plugin nutzt nslookup, um die IP-Adresse des angegebenen\n"
5323#~ "Hosts zu erfragen. Optional kann ein DNS-Server angegeben werden\n"
5324#~ "Wenn kein DNS-Server angegeben wird, so wird der Standardserver aus\n"
5325#~ "/etc/resolv.conf genutzt.\n"
5326#~ "\n"
5327
5328#~ msgid "HTTP CRITICAL - Could not make SSL connection\n"
5329#~ msgstr "HTTP CRITICAL - Konnte keine SSL Verbindung herstellen\n"
5330
5331#~ msgid "Client Certificate Required\n"
5332#~ msgstr "Clientzertifikat benötigt\n"
5333
5334#~ msgid "CRITICAL - Cannot create SSL context.\n"
5335#~ msgstr "CRITICAL - Konnte SSL Kontext nicht erzeugen.\n"
5336
5337#~ msgid "CRITICAL - Cannot initiate SSL handshake.\n"
5338#~ msgstr "CRITICAL - Konnte SSL Handshake nicht starten.\n"
5339
5340#, fuzzy
5341#~ msgid "Failed to allocate memory for hostname"
5342#~ msgstr "konnte keinen Speicher für '%s' reservieren\n"
5343
5344#, fuzzy
5345#~ msgid "CRITICAL - %d of %d hosts are alive\n"
5346#~ msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
5347
5348#, fuzzy
5349#~ msgid "%s has no address data\n"
5350#~ msgstr "Nameserver %s hat keine Datensätze\n"
5351
5352#, fuzzy
5353#~ msgid "CRITICAL - Could not make SSL connection\n"
5354#~ msgstr "HTTP CRITICAL - Konnte keine SSL Verbindung herstellen\n"
5355
5356#, fuzzy
5357#~ msgid "Unexpected response from host: %s\n"
5358#~ msgstr "Keine Antwort vom Host \n"
5359
5360#, fuzzy
5361#~ msgid "Certificate expires today (%s).\n"
5362#~ msgstr "Clientzertifikat benötigt\n"
5363
5364#, fuzzy
5365#~ msgid "ERROR: Cannot create SSL context.\n"
5366#~ msgstr "CRITICAL - Konnte SSL Kontext nicht erzeugen.\n"
5367
5368#, fuzzy
5369#~ msgid "ERROR: Cannot retrieve server certificate.\n"
5370#~ msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
5371
5372#, fuzzy
5373#~ msgid "ERROR: Cannot initiate SSL handshake.\n"
5374#~ msgstr "CRITICAL - Konnte SSL Handshake nicht starten.\n"
5375
5376#~ msgid ""
5377#~ "%s: Unknown argument: %s\n"
5378#~ "\n"
5379#~ msgstr ""
5380#~ "%s: Unbekanntes Argument: %s\n"
5381#~ "\n"
5382
5383#~ msgid "Critical time must be a nonnegative integer"
5384#~ msgstr "Critical time muss ein positiver Integer sein"
5385
5386#~ msgid "Time interval must be a nonnegative integer"
5387#~ msgstr "Time interval muss ein positiver Integer sein"
5388
5389#~ msgid "check_http: invalid option - SSL is not available\n"
5390#~ msgstr "check_http: ungültige Option - SSL ist nicht verfügbar\n"
5391
5392#~ msgid "invalid hostname/address"
5393#~ msgstr "Ungültige(r) Hostname/Adresse"
diff --git a/po/fr.po b/po/fr.po
deleted file mode 100644
index dfc2c5d..0000000
--- a/po/fr.po
+++ /dev/null
@@ -1,5384 +0,0 @@
1# translation of fr.po to
2# Messages français pour Nagios Plugins
3# Copyright (C) 2003-2023 Nagios Plugin Development Group
4# This file is distributed under the same license as the nagiosplug package.
5#
6# Karl DeBisschop <kdebisschop@users.sourceforge.net>, 2003.
7# Benoit Mortier <benoit.mortier@opensides.be>, 2004, 2006, 2007.
8# Thomas Guyot-Sionnest <dermoth@aei.ca>, 2007.
9msgid ""
10msgstr ""
11"Project-Id-Version: PACKAGE VERSION\n"
12"Report-Msgid-Bugs-To: devel@monitoring-plugins.org\n"
13"POT-Creation-Date: 2023-09-05 00:31+0200\n"
14"PO-Revision-Date: 2010-04-21 23:38-0400\n"
15"Last-Translator: \n"
16"Language-Team: Monitoring Plugin Development Team <devel@monitoring-plugins.org>\n"
17"Language: fr\n"
18"MIME-Version: 1.0\n"
19"Content-Type: text/plain; charset=UTF-8\n"
20"Content-Transfer-Encoding: 8bit\n"
21"Plural-Forms: nplurals=2; plural=(n != 1);\n"
22"X-Generator: KBabel 1.11.4\n"
23
24msgid "Could not parse arguments"
25msgstr "Impossible de décomposer les arguments"
26
27msgid "Cannot catch SIGALRM"
28msgstr "Impossible d'obtenir le signal SIGALRM"
29
30#, fuzzy, c-format
31msgid "SSH connection failed: %s\n"
32msgstr "L'exécution de la commande à distance %s à échoué\n"
33
34#, c-format
35msgid "Remote command execution failed: %s\n"
36msgstr "L'exécution de la commande à distance %s à échoué\n"
37
38#, c-format
39msgid "%s - check_by_ssh: Remote command '%s' returned status %d\n"
40msgstr ""
41
42#, c-format
43msgid "SSH WARNING: could not open %s\n"
44msgstr "SSH AVERTISSEMENT: impossible d'ouvrir %s\n"
45
46#, c-format
47msgid "%s: Error parsing output\n"
48msgstr "%s: Erreur d'analyse du résultat\n"
49
50msgid "Timeout interval must be a positive integer"
51msgstr "Le délai d'attente doit être un entier positif"
52
53msgid "Port must be a positive integer"
54msgstr "Le numéro du port doit être un entier positif"
55
56msgid "skip-stdout argument must be an integer"
57msgstr "Le nombres de lignes à sauter (skip-stdout) doit être un entier"
58
59msgid "skip-stderr argument must be an integer"
60msgstr "Le nombres de lignes à sauter (skip-stderr) doit être un entier"
61
62#, c-format
63msgid "%s: You must provide a host name\n"
64msgstr "%s: Vous devez fournir un nom d'hôte\n"
65
66msgid "No remotecmd"
67msgstr "Pas de commande distante"
68
69#, c-format
70msgid "%s: Argument limit of %d exceeded\n"
71msgstr ""
72
73msgid "Can not (re)allocate 'commargv' buffer\n"
74msgstr "Impossible de réallouer le tampon 'commargv'\n"
75
76#, c-format
77msgid ""
78"%s: In passive mode, you must provide a service name for each command.\n"
79msgstr ""
80"%s: En mode passif, vous devez fournir un service pour chaque commande.\n"
81
82#, fuzzy, c-format
83msgid ""
84"%s: In passive mode, you must provide the host short name from the "
85"monitoring configs.\n"
86msgstr ""
87"%s: En mode passif, vous devez fournir le nom court du hôte mentionné dans "
88"la configuration de nagios.\n"
89
90#, c-format
91msgid "This plugin uses SSH to execute commands on a remote host"
92msgstr "Ce plugin utilise SSH pour exécuter des commandes sur un hôte distant"
93
94msgid "tell ssh to use Protocol 1 [optional]"
95msgstr "dire à ssh d'utiliser le protocole version 1 [optionnel]"
96
97msgid "tell ssh to use Protocol 2 [optional]"
98msgstr "dire à ssh d'utiliser le protocole 2 [optionnel]"
99
100msgid "Ignore all or (if specified) first n lines on STDOUT [optional]"
101msgstr ""
102
103msgid "Ignore all or (if specified) first n lines on STDERR [optional]"
104msgstr ""
105
106msgid "Exit with an warning, if there is an output on STDERR"
107msgstr ""
108
109msgid ""
110"tells ssh to fork rather than create a tty [optional]. This will always "
111"return OK if ssh is executed"
112msgstr ""
113
114msgid "command to execute on the remote machine"
115msgstr "commande à exécuter sur la machine distante"
116
117msgid "SSH user name on remote host [optional]"
118msgstr "Nom d'utilisateur ssh sur la machine distante [optionnel]"
119
120msgid "identity of an authorized key [optional]"
121msgstr "Identité de la clé autorisée [optionnel]"
122
123#, fuzzy
124msgid "external command file for monitoring [optional]"
125msgstr "commande externe pour nagios [optionnel]"
126
127#, fuzzy
128msgid "list of monitoring service names, separated by ':' [optional]"
129msgstr "liste des services nagios, séparés par ':' [optionnel] "
130
131#, fuzzy
132msgid "short name of host in the monitoring configuration [optional]"
133msgstr "nom court de l'hôte dans la configuration nagios [optionnel]"
134
135msgid "Call ssh with '-o OPTION' (may be used multiple times) [optional]"
136msgstr ""
137"appelle ssh avec '-o OPTION' (peut être utilisé plusieurs fois) [optionnel]"
138
139#, fuzzy
140msgid "Tell ssh to use this configfile [optional]"
141msgstr "dire à ssh d'utiliser le protocole version 1 [optionnel]"
142
143msgid "Tell ssh to suppress warning and diagnostic messages [optional]"
144msgstr ""
145"dire à ssh de supprimer les messages d'erreurs et de diagnostic [optionnel]"
146
147msgid "Make connection problems return UNKNOWN instead of CRITICAL"
148msgstr ""
149
150msgid "The most common mode of use is to refer to a local identity file with"
151msgstr ""
152
153msgid "the '-i' option. In this mode, the identity pair should have a null"
154msgstr ""
155
156msgid "passphrase and the public key should be listed in the authorized_keys"
157msgstr ""
158
159msgid "file of the remote host. Usually the key will be restricted to running"
160msgstr ""
161
162msgid "only one command on the remote server. If the remote SSH server tracks"
163msgstr ""
164
165msgid "invocation arguments, the one remote program may be an agent that can"
166msgstr ""
167
168msgid "execute additional commands as proxy"
169msgstr ""
170
171msgid "To use passive mode, provide multiple '-C' options, and provide"
172msgstr "Pour utiliser le mode passif, utilisez plusieurs fois l'option '-C',et"
173
174msgid ""
175"all of -O, -s, and -n options (servicelist order must match '-C'options)"
176msgstr ""
177"et les options -O, -s, n (l'ordre des services doit correspondre aux "
178"multiples options '-C)"
179
180msgid "Examples:"
181msgstr "Exemples:"
182
183msgid "Usage:"
184msgstr "Utilisation:"
185
186#, fuzzy, c-format
187msgid "Host/Service Cluster Plugin for Monitoring"
188msgstr "Plugin de Cluster d'Hôte/Service pour Nagios 2"
189
190msgid "Options:"
191msgstr "Options:"
192
193msgid "Check service cluster status"
194msgstr "Vérifie l'état d'un cluster de services"
195
196msgid "Check host cluster status"
197msgstr "Vérifie l'état d'un cluster d'hôtes"
198
199msgid "Optional prepended text output (i.e. \"Host cluster\")"
200msgstr "Texte optionnel accolé à la sortie (i.e. \"Cluster d'hôtes\")"
201
202msgid "Specifies the range of hosts or services in cluster that must be in a"
203msgstr "Défini le nombre d'hôtes ou de services du cluster qui doivent être"
204
205msgid "non-OK state in order to return a WARNING status level"
206msgstr "dans un état non-OK pour retourner un état AVERTISSEMENT"
207
208msgid "non-OK state in order to return a CRITICAL status level"
209msgstr "dans un état non-OK pour retourner un état CRITIQUE"
210
211msgid "The status codes of the hosts or services in the cluster, separated by"
212msgstr "Les codes d'état des hôtes ou des services du cluster, séparés par des"
213
214msgid "commas"
215msgstr "virgules"
216
217msgid "Notes:"
218msgstr "Notes:"
219
220msgid ""
221"Will alert critical if there are 3 or more service data points in a non-OK"
222msgstr ""
223
224msgid "state."
225msgstr ""
226
227#, c-format
228msgid "Looking for: '%s'\n"
229msgstr "Recherche de: '%s'\n"
230
231msgid "dig returned an error status"
232msgstr "dig à renvoyé un état d'erreur"
233
234msgid "Server not found in ANSWER SECTION"
235msgstr "Le serveur n'a pas été trouvé dans l'ANSWER SECTION"
236
237msgid "No ANSWER SECTION found"
238msgstr "Pas d' ANSWER SECTION trouvé"
239
240msgid "Probably a non-existent host/domain"
241msgstr "Probablement un hôte/domaine inexistant"
242
243#, c-format
244msgid "Port must be a positive integer - %s"
245msgstr "Le numéro du port doit être un entier positif - %s"
246
247#, c-format
248msgid "Warning interval must be a positive integer - %s"
249msgstr "Le seuil d'avertissement doit être un entier positif - %s"
250
251#, c-format
252msgid "Critical interval must be a positive integer - %s"
253msgstr "Le seuil critique doit être un entier positif - %s"
254
255#, c-format
256msgid "Timeout interval must be a positive integer - %s"
257msgstr "Le délai d'attente doit être un entier positif - %s"
258
259#, fuzzy, c-format
260msgid "This plugin tests the DNS service on the specified host using dig"
261msgstr "Ce plugin teste le service DNS sur l'hôte spécifié en utilisant dig"
262
263msgid "Force dig to only use IPv4 query transport"
264msgstr ""
265
266msgid "Force dig to only use IPv6 query transport"
267msgstr ""
268
269msgid "Machine name to lookup"
270msgstr "Nom de machine à rechercher"
271
272msgid "Record type to lookup (default: A)"
273msgstr "Type d'enregistrement à rechercher (par défaut: A)"
274
275msgid ""
276"An address expected to be in the answer section. If not set, uses whatever"
277msgstr ""
278"Une adresse qui devrait se trouver dans la section réponce. Si omit, utilise"
279
280msgid "was in -l"
281msgstr "ce qui est passé au paramètre -l"
282
283msgid "Pass STRING as argument(s) to dig"
284msgstr ""
285
286#, c-format
287msgid "DISK %s: %s not found\n"
288msgstr "DISK %s: %s non trouvé\n"
289
290#, c-format
291msgid "CRITICAL"
292msgstr "CRITIQUE"
293
294#, c-format
295msgid "unit type %s not known\n"
296msgstr "unité de type %s inconnue\n"
297
298#, c-format
299msgid "failed allocating storage for '%s'\n"
300msgstr "Impossible d'allouer de l'espace pour '%s'\n"
301
302#, c-format
303msgid "UNKNOWN"
304msgstr "INCONNU"
305
306msgid "Must set a threshold value before using -p\n"
307msgstr ""
308
309msgid "Must set -E before selecting paths\n"
310msgstr ""
311
312msgid "Must set group value before selecting paths\n"
313msgstr ""
314
315msgid ""
316"Paths need to be selected before using -i/-I. Use -A to select all paths "
317"explicitly"
318msgstr ""
319
320msgid "Could not compile regular expression"
321msgstr "Impossible de compiler l'expression rationnelle"
322
323msgid "Must set a threshold value before using -r/-R\n"
324msgstr ""
325
326msgid "Regular expression did not match any path or disk"
327msgstr ""
328
329msgid "Unknown argument"
330msgstr "Argument inconnu"
331
332#, c-format
333msgid " for %s\n"
334msgstr " pour %s\n"
335
336msgid ""
337"This plugin checks the amount of used disk space on a mounted file system"
338msgstr "Ce plugin vérifie la place utilisé sur un système de fichier monté"
339
340msgid ""
341"and generates an alert if free space is less than one of the threshold values"
342msgstr ""
343"et génère une alerte si la place disponible est plus petite qu'un des seuils "
344"fourni"
345
346msgid "Exit with WARNING status if less than INTEGER units of disk are free"
347msgstr ""
348"Sortir avec un résultat AVERTISSEMENT si moins de X unités de disques sont "
349"libres"
350
351msgid "Exit with WARNING status if less than PERCENT of disk space is free"
352msgstr ""
353"Sortir avec un résultat AVERTISSEMENT si moins de X pour-cent du disque est "
354"libre"
355
356msgid "Exit with CRITICAL status if less than INTEGER units of disk are free"
357msgstr ""
358"Sortir avec un résultat CRITIQUE si moins de X unités du disque sont libres"
359
360#, fuzzy
361msgid "Exit with CRITICAL status if less than PERCENT of disk space is free"
362msgstr ""
363"Sortir avec un résultat CRITIQUE si moins de X pour-cent du disque est libre"
364
365msgid "Exit with WARNING status if less than PERCENT of inode space is free"
366msgstr ""
367"Sortir avec un résultat AVERTISSEMENT si moins de X pour-cent des inodes "
368"sont libres"
369
370msgid "Exit with CRITICAL status if less than PERCENT of inode space is free"
371msgstr ""
372"Sortir avec un résultat CRITIQUE si moins de X pour-cent des inodes sont "
373"libres"
374
375msgid ""
376"Mount point or block device as emitted by the mount(8) command (may be "
377"repeated)"
378msgstr ""
379
380msgid "Ignore device (only works if -p unspecified)"
381msgstr "Ignorer le périphérique (marche seulement lorsque -p est utilisé)"
382
383msgid "Clear thresholds"
384msgstr "Effacer les seuils"
385
386msgid "For paths or partitions specified with -p, only check for exact paths"
387msgstr ""
388
389msgid "Display only devices/mountpoints with errors"
390msgstr "Afficher seulement les périphériques/point de montage avec des erreurs"
391
392msgid "Don't account root-reserved blocks into freespace in perfdata"
393msgstr ""
394
395msgid "Display inode usage in perfdata"
396msgstr ""
397
398msgid ""
399"Group paths. Thresholds apply to (free-)space of all partitions together"
400msgstr ""
401
402msgid "Same as '--units kB'"
403msgstr "Pareil à '--units kB'"
404
405msgid "Only check local filesystems"
406msgstr "Vérifier seulement les systèmes de fichiers locaux"
407
408msgid ""
409"Only check local filesystems against thresholds. Yet call stat on remote "
410"filesystems"
411msgstr ""
412
413msgid "to test if they are accessible (e.g. to detect Stale NFS Handles)"
414msgstr ""
415
416#, fuzzy
417msgid "Display the (block) device instead of the mount point"
418msgstr "Afficher le point de montage au lieu de la partition"
419
420msgid "Same as '--units MB'"
421msgstr "Pareil à '--units MB'"
422
423msgid "Explicitly select all paths. This is equivalent to -R '.*'"
424msgstr ""
425
426msgid ""
427"Case insensitive regular expression for path/partition (may be repeated)"
428msgstr ""
429"Expression rationnelle indépendante de la case pour un répertoire ou une "
430"partition (peut être utilisé plusieurs fois)"
431
432msgid "Regular expression for path or partition (may be repeated)"
433msgstr ""
434"Expression rationnelle pour un répertoire ou une partition (peut être "
435"utilisé plusieurs fois)"
436
437msgid ""
438"Regular expression to ignore selected path/partition (case insensitive) (may "
439"be repeated)"
440msgstr ""
441"Expression rationnelle pour ignorer un répertoire ou une partition (peut "
442"être utilisé plusieurs fois)"
443
444msgid ""
445"Regular expression to ignore selected path or partition (may be repeated)"
446msgstr ""
447"Expression rationnelle pour ignorer un répertoire ou une partition (peut "
448"être utilisé plusieurs fois)"
449
450msgid ""
451"Return OK if no filesystem matches, filesystem does not exist or is "
452"inaccessible."
453msgstr ""
454
455msgid "(Provide this option before -p / -r / --ereg-path if used)"
456msgstr ""
457
458msgid "Choose bytes, kB, MB, GB, TB (default: MB)"
459msgstr "Choisissez octets, kb, MB, GB, TB (par défaut: MB)"
460
461msgid "Ignore all filesystems of indicated type (may be repeated)"
462msgstr ""
463"Ignorer tout les systèmes de fichiers qui correspondent au type indiqué "
464"(peut être utilisé plusieurs fois)"
465
466#, fuzzy
467msgid "Check only filesystems of indicated type (may be repeated)"
468msgstr ""
469"Ignorer tout les systèmes de fichiers qui correspondent au type indiqué "
470"(peut être utilisé plusieurs fois)"
471
472msgid "Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"
473msgstr "Vérifie /tmp à 10% et /var à 5% et / à 100MB et 50MB"
474
475msgid ""
476"Checks all filesystems not matching -r at 100M and 50M. The fs matching the -"
477"r regex"
478msgstr ""
479
480msgid ""
481"are grouped which means the freespace thresholds are applied to all disks "
482"together"
483msgstr ""
484
485msgid ""
486"Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use "
487"100M/50M"
488msgstr ""
489
490#, c-format
491msgid "%s %s: %s\n"
492msgstr ""
493
494msgid "is not accessible"
495msgstr ""
496
497msgid "nslookup returned an error status"
498msgstr "nslookup à retourné un code d'erreur"
499
500msgid "Warning plugin error"
501msgstr "Alerte erreur de plugin"
502
503#, fuzzy, c-format
504msgid "DNS CRITICAL - '%s' returned empty server string\n"
505msgstr "DNS CRITIQUE - '%s' à retourné un nom d'hôte vide\n"
506
507#, fuzzy, c-format
508msgid "DNS CRITICAL - No response from DNS %s\n"
509msgstr "Pas de réponse du DNS %s\n"
510
511#, c-format
512msgid "DNS CRITICAL - '%s' returned empty host name string\n"
513msgstr "DNS CRITIQUE - '%s' à retourné un nom d'hôte vide\n"
514
515msgid "Non-authoritative answer:"
516msgstr "Réponse non autoritative:"
517
518#, fuzzy, c-format
519msgid "Domain '%s' was not found by the server\n"
520msgstr "Le domaine %s n'a pas été trouvé par le serveur\n"
521
522#, c-format
523msgid "DNS CRITICAL - '%s' msg parsing exited with no address\n"
524msgstr "DNS CRITIQUE - '%s' n'a pas retourné d'adresse\n"
525
526#, c-format
527msgid "expected '%s' but got '%s'"
528msgstr "j'attendais '%s' mais j'ai reçu '%s'"
529
530#, fuzzy, c-format
531msgid "Domain '%s' was found by the server: '%s'\n"
532msgstr "Le domaine %s n'a pas été trouvé par le serveur\n"
533
534#, c-format
535msgid "server %s is not authoritative for %s"
536msgstr "serveur %s n'est pas autoritaire pour %s"
537
538#, c-format
539msgid "OK"
540msgstr "OK"
541
542#, c-format
543msgid "WARNING"
544msgstr "AVERTISSEMENT"
545
546#, c-format
547msgid "%.3f second response time"
548msgid_plural "%.3f seconds response time"
549msgstr[0] "%.3f secondes de temps de réponse "
550msgstr[1] "%.3f secondes de temps de réponse "
551
552#, c-format
553msgid ". %s returns %s"
554msgstr ". %s renvoie %s"
555
556#, c-format
557msgid "DNS WARNING - %s\n"
558msgstr "DNS AVERTISSEMENT - %s\n"
559
560msgid " Probably a non-existent host/domain"
561msgstr " Probablement un hôte/domaine inexistant"
562
563#, c-format
564msgid "DNS CRITICAL - %s\n"
565msgstr "DNS CRITIQUE - %s\n"
566
567#, c-format
568msgid "DNS UNKNOWN - %s\n"
569msgstr "DNS INCONNU - %s\n"
570
571msgid "Note: nslookup is deprecated and may be removed from future releases."
572msgstr ""
573"Note: nslookup est obsolète et pourra être retiré dans les prochaines "
574"versions."
575
576msgid "Consider using the `dig' or `host' programs instead. Run nslookup with"
577msgstr ""
578"Veuillez utiliser le programme 'dig' ou 'host' à la place. Faire fonctionner "
579"nslookup avec"
580
581msgid "the `-sil[ent]' option to prevent this message from appearing."
582msgstr "L'option '-sil[ent]' empêche l'apparition de ce message."
583
584#, c-format
585msgid "No response from DNS %s\n"
586msgstr "Pas de réponse du DNS %s\n"
587
588#, c-format
589msgid "DNS %s has no records\n"
590msgstr "Le DNS %s n'a pas d'enregistrements\n"
591
592#, c-format
593msgid "Connection to DNS %s was refused\n"
594msgstr "La connexion au DNS %s à été refusée\n"
595
596#, c-format
597msgid "Query was refused by DNS server at %s\n"
598msgstr "La requête à été refusée par le serveur DNS %s\n"
599
600#, c-format
601msgid "No information returned by DNS server at %s\n"
602msgstr "Pas d'information renvoyée par le serveur DNS %s\n"
603
604msgid "Network is unreachable\n"
605msgstr "Le réseau est inaccessible\n"
606
607#, c-format
608msgid "DNS failure for %s\n"
609msgstr "DNS à échoué pour %s\n"
610
611msgid "Input buffer overflow\n"
612msgstr "Le tampon d'entrée a débordé\n"
613
614msgid ""
615"This plugin uses the nslookup program to obtain the IP address for the given "
616"host/domain query."
617msgstr ""
618"Ce plugin utilise le programme nslookup pour obtenir l'adresse IP de l'hôte/"
619"domaine à interroger."
620
621msgid "An optional DNS server to use may be specified."
622msgstr "Un serveur DNS à utiliser peut être indiqué."
623
624msgid ""
625"If no DNS server is specified, the default server(s) specified in /etc/"
626"resolv.conf will be used."
627msgstr ""
628"Si aucun serveur DNS n'est spécifié, les serveurs spécifiés dans /etc/resolv."
629"conf seront utilisé."
630
631msgid "The name or address you want to query"
632msgstr "Le nom ou l'adresse que vous voulez interroger"
633
634msgid "Optional DNS server you want to use for the lookup"
635msgstr "Serveur DNS que vous voulez utiliser pour la recherche"
636
637#, fuzzy
638msgid ""
639"Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"
640msgstr ""
641"Adresse IP que le serveur DNS doit retourner. Les hôtes doivent se terminer "
642
643#, fuzzy
644msgid ""
645"with a dot (.). This option can be repeated multiple times (Returns OK if any"
646msgstr "avec un point (.). Cette option peut être répétée (Retourne OK si une"
647
648msgid "value matches)."
649msgstr ""
650
651msgid ""
652"Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"
653msgstr ""
654
655msgid "Cannot be used together with -a"
656msgstr ""
657
658msgid "Optionally expect the DNS server to be authoritative for the lookup"
659msgstr "Serveur DNS qui doit normalement être autoritaire pour la recherche"
660
661msgid "Return warning if elapsed time exceeds value. Default off"
662msgstr ""
663"Renvoie une alerte si le temps écoulé dépasse la valeur indiquée. Désactivé "
664"par défaut"
665
666msgid "Return critical if elapsed time exceeds value. Default off"
667msgstr ""
668"Renvoie critique si le temps utilisé dépasse la valeur indiquée. Désactivé "
669"par défaut"
670
671msgid ""
672"Return critical if the list of expected addresses does not match all "
673"addresses"
674msgstr ""
675
676msgid "returned. Default off"
677msgstr ""
678
679msgid "Arguments to check_dummy must be an integer"
680msgstr "Les arguments pour check_dummy doivent être des entiers"
681
682#, c-format
683msgid "Status %d is not a supported error state\n"
684msgstr "Le résultat %d n'est pas un résultat supporté\n"
685
686msgid ""
687"This plugin will simply return the state corresponding to the numeric value"
688msgstr ""
689"Ce plugin renverra simplement l'état correspondant à la valeur numérique"
690
691msgid "of the <state> argument with optional text"
692msgstr "du paramètre <state> avec un texte optionnel"
693
694#, c-format
695msgid "Could not open pipe: %s\n"
696msgstr "Impossible d'ouvrir le pipe: %s\n"
697
698#, c-format
699msgid "Could not open stderr for %s\n"
700msgstr "Impossible d'ouvrir la sortie d'erreur standard pour %s\n"
701
702#, fuzzy
703msgid "FPING UNKNOWN - IP address not found\n"
704msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
705
706msgid "FPING UNKNOWN - invalid commandline argument\n"
707msgstr ""
708
709#, fuzzy
710msgid "FPING UNKNOWN - failed system call\n"
711msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
712
713#, fuzzy, c-format
714msgid "FPING %s - %s (rta=%f ms)|%s\n"
715msgstr "FPING %s - %s (perte=%.0f%% )|%s\n"
716
717#, c-format
718msgid "FPING UNKNOWN - %s not found\n"
719msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
720
721#, c-format
722msgid "FPING CRITICAL - %s is unreachable\n"
723msgstr "PING CRITIQUE - Hôte inaccessible (%s)\n"
724
725#, fuzzy, c-format
726msgid "FPING UNKNOWN - %s parameter error\n"
727msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
728
729#, c-format
730msgid "FPING CRITICAL - %s is down\n"
731msgstr "FPING CRITIQUE - %s est en panne\n"
732
733#, c-format
734msgid "FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"
735msgstr "FPING %s - %s (perte=%.0f%%, rta=%f ms)|%s %s\n"
736
737#, c-format
738msgid "FPING %s - %s (loss=%.0f%% )|%s\n"
739msgstr "FPING %s - %s (perte=%.0f%% )|%s\n"
740
741msgid "Invalid hostname/address"
742msgstr "Adresse/Nom d'hôte invalide"
743
744msgid "IPv6 support not available\n"
745msgstr "Support IPv6 non disponible\n"
746
747msgid "Packet size must be a positive integer"
748msgstr "La taille du paquet doit être un entier positif"
749
750msgid "Packet count must be a positive integer"
751msgstr "Le nombre de paquets doit être un entier positif"
752
753msgid "Target timeout must be a positive integer"
754msgstr "Le seuil d'avertissement doit être un entier positif"
755
756msgid "Interval must be a positive integer"
757msgstr "Le délai d'attente doit être un entier positif"
758
759msgid "Hostname was not supplied"
760msgstr "Le nom de l'hôte n'a pas été spécifié"
761
762#, c-format
763msgid "%s: Only one threshold may be packet loss (%s)\n"
764msgstr ""
765"%s: Seulement un seuil peut être utilisé pour les pertes de paquets (%s)\n"
766
767#, c-format
768msgid "%s: Only one threshold must be packet loss (%s)\n"
769msgstr ""
770"%s: Seulement un seuil doit être utilisé pour les pertes de paquets (%s)\n"
771
772msgid ""
773"This plugin will use the fping command to ping the specified host for a fast "
774"check"
775msgstr ""
776"Ce plugin va utiliser la commande fping pour pinger l'hôte de manière rapide."
777
778msgid "Note that it is necessary to set the suid flag on fping."
779msgstr ""
780"Veuillez noter qu'il est nécessaire de mettre le bit suid sur le programme "
781"fping."
782
783msgid ""
784"name or IP Address of host to ping (IP Address bypasses name lookup, "
785"reducing system load)"
786msgstr ""
787"nom ou adresse IP des hôtes à pinger (l'indication d'un adresse IP évite une "
788"recherche sur le nom, ce qui réduit la charge système)"
789
790msgid "warning threshold pair"
791msgstr "Valeurs pour le seuil d'avertissement"
792
793msgid "critical threshold pair"
794msgstr "Valeurs pour le seuil critique"
795
796msgid "Return OK after first successful reply"
797msgstr ""
798
799msgid "size of ICMP packet"
800msgstr "taille du paquet ICMP"
801
802msgid "number of ICMP packets to send"
803msgstr "nombre de paquets ICMP à envoyer"
804
805msgid "Target timeout (ms)"
806msgstr ""
807
808msgid "Interval (ms) between sending packets"
809msgstr ""
810
811msgid "name or IP Address of sourceip"
812msgstr ""
813
814msgid "source interface name"
815msgstr ""
816
817#, c-format
818msgid ""
819"THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time "
820"(ms)"
821msgstr ""
822"Le seuil est <rta>,<pl>%% ou <rta> est le temps moyen pour l'aller retour "
823"(ms)"
824
825msgid ""
826"which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"
827msgstr ""
828"qui déclenche résultat AVERTISSEMENT ou CRITIQUE, et <pl> est le pourcentage "
829"de"
830
831msgid "packet loss to trigger an alarm state."
832msgstr "paquets perdu pour déclencher une alarme."
833
834msgid "IPv4 is used by default. Specify -6 to use IPv6."
835msgstr ""
836
837#, c-format
838msgid "CRITICAL - Host type parameter incorrect!\n"
839msgstr "CRITIQUE - Argument de type hôte incorrect!\n"
840
841#, c-format
842msgid "CRITICAL - Host not found\n"
843msgstr "CRITIQUE - Hôte non trouvé\n"
844
845#, c-format
846msgid "CRITICAL - Game server down or unavailable\n"
847msgstr "CRITIQUE - Serveur de jeux en panne ou non disponible\n"
848
849#, c-format
850msgid "CRITICAL - Game server timeout\n"
851msgstr "CRITIQUE - Temps d'attente pour le serveur de jeux dépassé\n"
852
853#, c-format
854msgid "This plugin tests game server connections with the specified host."
855msgstr "Le plugin teste la connexion au serveur de jeux avec l'hôte spécifié."
856
857msgid "Optional port of which to connect"
858msgstr ""
859
860msgid "Field number in raw qstat output that contains game name"
861msgstr ""
862
863msgid "Field number in raw qstat output that contains map name"
864msgstr ""
865
866msgid "Field number in raw qstat output that contains ping time"
867msgstr ""
868
869msgid ""
870"This plugin uses the 'qstat' command, the popular game server status query "
871"tool."
872msgstr ""
873"Ce plugin utilise la commande 'qstat', un programme répandu pour questioner "
874"les serveurs de jeux."
875
876msgid ""
877"If you don't have the package installed, you will need to download it from"
878msgstr ""
879"Si vous n'avez pas le programme installé, vous devrez le télécharger depuis"
880
881#, fuzzy
882msgid "https://github.com/multiplay/qstat before you can use this plugin."
883msgstr ""
884"http://www.activesw.com/people/steve/qstat.html avant de pouvoir utiliser ce "
885"plugin."
886
887msgid "Paper Jam"
888msgstr "Bourrage Papier"
889
890msgid "Out of Paper"
891msgstr "Plus de Papier"
892
893msgid "Printer Offline"
894msgstr "Imprimante hors ligne"
895
896msgid "Peripheral Error"
897msgstr "Erreur du périphérique"
898
899msgid "Intervention Required"
900msgstr "Intervention Requise"
901
902msgid "Toner Low"
903msgstr "Toner Faible"
904
905msgid "Insufficient Memory"
906msgstr "Mémoire Insuffisante"
907
908msgid "A Door is Open"
909msgstr "Une porte est ouverte"
910
911msgid "Output Tray is Full"
912msgstr "Le bac de sortie est plein"
913
914msgid "Data too Slow for Engine"
915msgstr "Le données arrivent trop lentement pour l'imprimante"
916
917msgid "Unknown Paper Error"
918msgstr "Erreur de papier inconnue"
919
920#, c-format
921msgid "Printer ok - (%s)\n"
922msgstr "Imprimante ok - (%s)\n"
923
924#, fuzzy
925msgid "Port must be a positive short integer"
926msgstr "Le numéro du port doit être un entier positif"
927
928msgid "This plugin tests the STATUS of an HP printer with a JetDirect card."
929msgstr "Ce plugin teste l'état d'une imprimante HP avec une carte JetDirect."
930
931msgid "Net-snmp must be installed on the computer running the plugin."
932msgstr "Net-snmp doit être installé sur l'ordinateur qui exécute le plugin."
933
934msgid "The SNMP community name "
935msgstr "Le nom de la communauté SNMP "
936
937#, c-format
938msgid "(default=%s)"
939msgstr "(défaut=%s)"
940
941#, fuzzy
942msgid "Specify the port to check "
943msgstr "Nom de l'hôte à vérifier"
944
945#, fuzzy
946msgid "Disable paper check "
947msgstr "Variable a vérifier"
948
949msgid "file does not exist or is not readable"
950msgstr ""
951
952msgid "Invalid certificate expiration period"
953msgstr "Période d'expiration du certificat invalide"
954
955msgid ""
956"Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional "
957"'+' suffix)"
958msgstr ""
959
960msgid "Invalid option - SSL is not available"
961msgstr "Option invalide - SSL n'est pas disponible"
962
963msgid "Invalid max_redirs count"
964msgstr ""
965
966msgid "Invalid onredirect option"
967msgstr ""
968
969#, c-format
970msgid "option f:%d \n"
971msgstr "option f:%d \n"
972
973msgid "Invalid port number"
974msgstr "Numéro de port invalide"
975
976#, c-format
977msgid "Could Not Compile Regular Expression: %s"
978msgstr "Impossible de compiler l'expression rationnelle: %s"
979
980msgid "IPv6 support not available"
981msgstr "Support IPv6 non disponible"
982
983msgid "You must specify a server address or host name"
984msgstr "Vous devez spécifier une adresse ou un nom d'hôte"
985
986msgid ""
987"If you use a client certificate you must also specify a private key file"
988msgstr ""
989
990msgid "HTTP UNKNOWN - Memory allocation error\n"
991msgstr "HTTP INCONNU - Impossible d'allouer la mémoire\n"
992
993#, c-format
994msgid "%sServer date unknown, "
995msgstr "%sDate du serveur inconnue, "
996
997#, c-format
998msgid "%sDocument modification date unknown, "
999msgstr "%sDate de modification du document inconnue, "
1000
1001#, c-format
1002msgid "%sServer date \"%100s\" unparsable, "
1003msgstr "%sDate du serveur \"%100s\" illisible, "
1004
1005#, c-format
1006msgid "%sDocument date \"%100s\" unparsable, "
1007msgstr "%sDate du document \"%100s\" illisible, "
1008
1009#, c-format
1010msgid "%sDocument is %d seconds in the future, "
1011msgstr "%sLa date du document est %d secondes dans le futur, "
1012
1013#, c-format
1014msgid "%sLast modified %.1f days ago, "
1015msgstr "%sDernière modification %.1f jours auparavant, "
1016
1017#, c-format
1018msgid "%sLast modified %d:%02d:%02d ago, "
1019msgstr "%sDernière modification %d:%02d:%02d auparavant, "
1020
1021msgid "HTTP CRITICAL - Unable to open TCP socket\n"
1022msgstr "HTTP CRITIQUE - Impossible d'ouvrir un socket TCP\n"
1023
1024#, fuzzy
1025msgid "HTTP UNKNOWN - Could not allocate memory for full_page\n"
1026msgstr "HTTP INCONNU - Impossible d'allouer une adresse\n"
1027
1028msgid "HTTP CRITICAL - Error on receive\n"
1029msgstr "HTTP CRITIQUE - Erreur dans la réception\n"
1030
1031msgid "HTTP CRITICAL - No data received from host\n"
1032msgstr "HTTP CRITIQUE - Pas de données reçues de l'hôte\n"
1033
1034#, c-format
1035msgid "Invalid HTTP response received from host: %s\n"
1036msgstr "Réponse HTTP reçue de l'hôte invalide: %s\n"
1037
1038#, c-format
1039msgid "Invalid HTTP response received from host on port %d: %s\n"
1040msgstr "Réponse HTTP reçue de l'hôte sur le port %d invalide: %s\n"
1041
1042#, c-format
1043msgid ""
1044"%s\n"
1045"%s"
1046msgstr ""
1047
1048#, c-format
1049msgid "Status line output matched \"%s\" - "
1050msgstr "La ligne d'état correspond à \"%s\" - "
1051
1052#, c-format
1053msgid "HTTP CRITICAL: Invalid Status Line (%s)\n"
1054msgstr "HTTP CRITIQUE: Ligne d'état non valide (%s)\n"
1055
1056#, c-format
1057msgid "HTTP CRITICAL: Invalid Status (%s)\n"
1058msgstr "HTTP CRITIQUE: Etat Invalide (%s)\n"
1059
1060#, c-format
1061msgid "%s - "
1062msgstr ""
1063
1064#, fuzzy, c-format
1065msgid "%sheader '%s' not found on '%s://%s:%d%s', "
1066msgstr "%schaîne non trouvée, "
1067
1068#, fuzzy, c-format
1069msgid "%sstring '%s' not found on '%s://%s:%d%s', "
1070msgstr "%schaîne non trouvée, "
1071
1072#, c-format
1073msgid "%spattern not found, "
1074msgstr "%sexpression non trouvée, "
1075
1076#, c-format
1077msgid "%spattern found, "
1078msgstr "%sexpression trouvée, "
1079
1080#, c-format
1081msgid "%sExecute Error: %s, "
1082msgstr "%sErreur d'exécution: %s, "
1083
1084#, c-format
1085msgid "%spage size %d too large, "
1086msgstr "%sla taille de la page est trop grande (%d), "
1087
1088#, c-format
1089msgid "%spage size %d too small, "
1090msgstr "%sla taille de la page est trop petite (%d), "
1091
1092#, fuzzy, c-format
1093msgid "%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"
1094msgstr "%s - %d octets en %.3f secondes de temps de réponse %s|%s %s"
1095
1096#, c-format
1097msgid "%s - %d bytes in %.3f second response time %s|%s %s"
1098msgstr "%s - %d octets en %.3f secondes de temps de réponse %s|%s %s"
1099
1100msgid "HTTP UNKNOWN - Could not allocate addr\n"
1101msgstr "HTTP INCONNU - Impossible d'allouer une adresse\n"
1102
1103msgid "HTTP UNKNOWN - Could not allocate URL\n"
1104msgstr "HTTP INCONNU - Impossible d'allouer l'URL\n"
1105
1106#, c-format
1107msgid "HTTP UNKNOWN - Could not find redirect location - %s%s\n"
1108msgstr ""
1109"HTTP INCONNU - Impossible de trouver l'endroit de la redirection - %s%s\n"
1110
1111#, c-format
1112msgid "HTTP UNKNOWN - Empty redirect location%s\n"
1113msgstr "HTTP INCONNU - endroit de redirection vide%s\n"
1114
1115#, c-format
1116msgid "HTTP UNKNOWN - Could not parse redirect location - %s%s\n"
1117msgstr ""
1118"HTTP INCONNU - Impossible de définir l'endroit de la redirection - %s%s\n"
1119
1120#, c-format
1121msgid "HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"
1122msgstr ""
1123"HTTP AVERTISSEMENT - le niveau maximum de redirection %d à été dépassé - "
1124"%s://%s:%d%s%s\n"
1125
1126#, fuzzy, c-format
1127msgid "HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"
1128msgstr ""
1129"HTTP AVERTISSEMENT - la redirection crée une boucle infinie - %s://%s:"
1130"%d%s%s\n"
1131
1132#, c-format
1133msgid "HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"
1134msgstr "HTTP INCONNU - Redirection à un port supérieur à %d - %s://%s:%d%s%s\n"
1135
1136#, c-format
1137msgid "Redirection to %s://%s:%d%s\n"
1138msgstr "Redirection vers %s://%s:%d%s\n"
1139
1140msgid "This plugin tests the HTTP service on the specified host. It can test"
1141msgstr ""
1142"Ce plugin teste le service HTTP sur l'hôte spécifié. Il peut tester les"
1143
1144msgid "normal (http) and secure (https) servers, follow redirects, search for"
1145msgstr ""
1146"serveurs normaux (http) et sécurisés (https), suivre les redirections, "
1147"rechercher des"
1148
1149msgid "strings and regular expressions, check connection times, and report on"
1150msgstr ""
1151"chaînes de caractères et expressions rationnelles, vérifier le temps de "
1152"réponse"
1153
1154msgid "certificate expiration times."
1155msgstr "et rapporter la date d'expiration du certificat."
1156
1157#, c-format
1158msgid "In the first form, make an HTTP request."
1159msgstr ""
1160
1161#, c-format
1162msgid ""
1163"In the second form, connect to the server and check the TLS certificate."
1164msgstr ""
1165
1166#, c-format
1167msgid "NOTE: One or both of -H and -I must be specified"
1168msgstr "NOTE: les paramètres -H et -I peuvent être spécifiés"
1169
1170msgid "Host name argument for servers using host headers (virtual host)"
1171msgstr ""
1172
1173msgid "Append a port to include it in the header (eg: example.com:5000)"
1174msgstr ""
1175
1176msgid ""
1177"IP address or name (use numeric address if possible to bypass DNS lookup)."
1178msgstr ""
1179
1180msgid "Port number (default: "
1181msgstr "Numéro du port (défaut: "
1182
1183msgid ""
1184"Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"
1185msgstr ""
1186
1187msgid "auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"
1188msgstr ""
1189
1190msgid "1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."
1191msgstr ""
1192
1193msgid "Enable SSL/TLS hostname extension support (SNI)"
1194msgstr ""
1195
1196msgid ""
1197"Minimum number of days a certificate has to be valid. Port defaults to 443"
1198msgstr ""
1199"Nombre de jours minimum pour que le certificat soit valide. Port par défaut "
1200"443"
1201
1202msgid ""
1203"(when this option is used the URL is not checked by default. You can use"
1204msgstr ""
1205
1206msgid " --continue-after-certificate to override this behavior)"
1207msgstr ""
1208
1209msgid ""
1210"Allows the HTTP check to continue after performing the certificate check."
1211msgstr ""
1212
1213msgid "Does nothing unless -C is used."
1214msgstr ""
1215
1216msgid "Name of file that contains the client certificate (PEM format)"
1217msgstr ""
1218
1219msgid "to be used in establishing the SSL session"
1220msgstr ""
1221
1222msgid "Name of file containing the private key (PEM format)"
1223msgstr ""
1224
1225msgid "matching the client certificate"
1226msgstr ""
1227
1228msgid "Comma-delimited list of strings, at least one of them is expected in"
1229msgstr ""
1230"Liste the chaines de charactères séparées par des virgules, au moins une "
1231"d'elles"
1232
1233msgid "the first (status) line of the server response (default: "
1234msgstr "est attendue dans la première ligne de réponse du serveur (défaut: "
1235
1236msgid ""
1237"If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
1238msgstr ""
1239"Si spécifié, surpasse toute autre logique de status (ex: 3xx, 4xx, 5xx)"
1240
1241#, fuzzy
1242msgid "String to expect in the response headers"
1243msgstr "Chaîne de caractères à attendre en réponse"
1244
1245msgid "String to expect in the content"
1246msgstr "Chaîne de caractère attendue dans le contenu"
1247
1248msgid "URL to GET or POST (default: /)"
1249msgstr "URL pour le GET ou le POST (défaut: /)"
1250
1251msgid "URL encoded http POST data"
1252msgstr ""
1253
1254msgid "Set HTTP method."
1255msgstr ""
1256
1257msgid "Don't wait for document body: stop reading after headers."
1258msgstr ""
1259"Ne pas attendre pour le corps du document: arrêter de lire après les entêtes"
1260
1261msgid "(Note that this still does an HTTP GET or POST, not a HEAD.)"
1262msgstr "(Veuillez noter qu'un HTTP GET ou POST est effectué, pas un HEAD.)"
1263
1264msgid "Warn if document is more than SECONDS old. the number can also be of"
1265msgstr ""
1266
1267msgid "the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."
1268msgstr ""
1269
1270msgid "specify Content-Type header media type when POSTing\n"
1271msgstr ""
1272
1273msgid "Allow regex to span newlines (must precede -r or -R)"
1274msgstr ""
1275
1276msgid "Search page for regex STRING"
1277msgstr ""
1278
1279msgid "Search page for case-insensitive regex STRING"
1280msgstr ""
1281
1282msgid "Return CRITICAL if found, OK if not\n"
1283msgstr ""
1284
1285msgid "Username:password on sites with basic authentication"
1286msgstr ""
1287
1288msgid "Username:password on proxy-servers with basic authentication"
1289msgstr ""
1290
1291msgid "String to be sent in http header as \"User Agent\""
1292msgstr ""
1293
1294msgid ""
1295"Any other tags to be sent in http header. Use multiple times for additional "
1296"headers"
1297msgstr ""
1298
1299msgid "Print additional performance data"
1300msgstr ""
1301
1302msgid "Print body content below status line"
1303msgstr ""
1304
1305msgid "Wrap output in HTML link (obsoleted by urlize)"
1306msgstr ""
1307
1308msgid "How to handle redirected pages. sticky is like follow but stick to the"
1309msgstr ""
1310
1311msgid "specified IP address. stickyport also ensures port stays the same."
1312msgstr ""
1313
1314#, fuzzy
1315msgid "Maximal number of redirects (default: "
1316msgstr "PROCS - nombre de processus (défaut)"
1317
1318msgid "Minimum page size required (bytes) : Maximum page size required (bytes)"
1319msgstr ""
1320
1321msgid "This plugin will attempt to open an HTTP connection with the host."
1322msgstr "Ce plugin va essayer d'ouvrir un connexion SMTP avec l'hôte."
1323
1324msgid ""
1325"Successful connects return STATE_OK, refusals and timeouts return "
1326"STATE_CRITICAL"
1327msgstr ""
1328
1329msgid ""
1330"other errors return STATE_UNKNOWN. Successful connects, but incorrect "
1331"response"
1332msgstr ""
1333
1334msgid ""
1335"messages from the host result in STATE_WARNING return values. If you are"
1336msgstr ""
1337
1338msgid ""
1339"checking a virtual server that uses 'host headers' you must supply the FQDN"
1340msgstr ""
1341
1342msgid "(fully qualified domain name) as the [host_name] argument."
1343msgstr ""
1344
1345msgid "This plugin can also check whether an SSL enabled web server is able to"
1346msgstr ""
1347
1348msgid "serve content (optionally within a specified time) or whether the X509 "
1349msgstr ""
1350
1351msgid "certificate is still valid for the specified number of days."
1352msgstr ""
1353
1354#, fuzzy
1355msgid "Please note that this plugin does not check if the presented server"
1356msgstr "Ce plugin vérifie le service ntp sur l'hôte"
1357
1358msgid "certificate matches the hostname of the server, or if the certificate"
1359msgstr ""
1360
1361msgid "has a valid chain of trust to one of the locally installed CAs."
1362msgstr ""
1363
1364msgid ""
1365"When the 'www.verisign.com' server returns its content within 5 seconds,"
1366msgstr ""
1367
1368msgid ""
1369"a STATE_OK will be returned. When the server returns its content but exceeds"
1370msgstr ""
1371
1372msgid ""
1373"the 5-second threshold, a STATE_WARNING will be returned. When an error "
1374"occurs,"
1375msgstr ""
1376
1377msgid "a STATE_CRITICAL will be returned."
1378msgstr ""
1379
1380msgid ""
1381"When the certificate of 'www.verisign.com' is valid for more than 14 days,"
1382msgstr ""
1383
1384msgid ""
1385"a STATE_OK is returned. When the certificate is still valid, but for less "
1386"than"
1387msgstr ""
1388
1389msgid ""
1390"14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"
1391msgstr ""
1392
1393msgid "the certificate is expired."
1394msgstr "le certificat est expiré."
1395
1396msgid ""
1397"When the certificate of 'www.verisign.com' is valid for more than 30 days,"
1398msgstr ""
1399
1400msgid "30 days, but more than 14 days, a STATE_WARNING is returned."
1401msgstr ""
1402
1403msgid ""
1404"A STATE_CRITICAL will be returned when certificate expires in less than 14 "
1405"days"
1406msgstr ""
1407
1408msgid ""
1409"check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j "
1410"CONNECT -H www.verisign.com "
1411msgstr ""
1412
1413msgid ""
1414"all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -"
1415"S(sl) -j CONNECT -H <webserver>"
1416msgstr ""
1417
1418msgid ""
1419"a STATE_CRITICAL will be returned. By adding a colon to the method you can "
1420"set the method used"
1421msgstr ""
1422
1423msgid "inside the proxied connection: -j CONNECT:POST"
1424msgstr ""
1425
1426#, c-format
1427msgid "Could not connect to the server at port %i\n"
1428msgstr "Impossible de se connecter au serveur port %i\n"
1429
1430#, c-format
1431msgid "Could not set protocol version %d\n"
1432msgstr "Impossible d'utiliser le protocole version %d\n"
1433
1434#, c-format
1435msgid "Could not init TLS at port %i!\n"
1436msgstr "Impossible d'initialiser TLS sur le port %i!\n"
1437
1438#, c-format
1439msgid "TLS not supported by the libraries!\n"
1440msgstr "TLS n'est pas supporté!\n"
1441
1442#, c-format
1443msgid "Could not init startTLS at port %i!\n"
1444msgstr "Impossible d'initialiser startTLS sur le port %i!\n"
1445
1446#, c-format
1447msgid "startTLS not supported by the library, needs LDAPv3!\n"
1448msgstr ""
1449"startTLS n'est pas supporté par la librairie LDAP, j'ai besoin de LDAPv3!\n"
1450
1451#, c-format
1452msgid "Could not bind to the LDAP server\n"
1453msgstr "Impossible de se connecter au serveur LDAP\n"
1454
1455#, c-format
1456msgid "Could not search/find objectclasses in %s\n"
1457msgstr "Impossible de chercher/trouver les objectclasses dans %s\n"
1458
1459#, fuzzy, c-format
1460msgid "LDAP %s - found %d entries in %.3f seconds|%s %s\n"
1461msgstr "%s - %d octets en %.3f secondes de temps de réponse %s|%s %s"
1462
1463#, c-format
1464msgid "LDAP %s - %.3f seconds response time|%s\n"
1465msgstr "LDAP %s - %.3f secondes de temps de réponse|%s\n"
1466
1467#, c-format
1468msgid "%s cannot be combined with %s"
1469msgstr ""
1470
1471msgid "Please specify the host name\n"
1472msgstr "Veuillez spécifier le nom de l'hôte\n"
1473
1474msgid "Please specify the LDAP base\n"
1475msgstr "Veuillez spécifier la base LDAP\n"
1476
1477msgid "ldap attribute to search (default: \"(objectclass=*)\""
1478msgstr ""
1479
1480msgid "ldap base (eg. ou=my unit, o=my org, c=at"
1481msgstr ""
1482
1483msgid "ldap bind DN (if required)"
1484msgstr ""
1485
1486msgid ""
1487"ldap password (if required, or set the password through environment variable "
1488"'LDAP_PASSWORD')"
1489msgstr ""
1490
1491msgid "use starttls mechanism introduced in protocol version 3"
1492msgstr "utiliser le fonctionnement starttls du protocole version 3"
1493
1494msgid "use ldaps (ldap v2 ssl method). this also sets the default port to"
1495msgstr ""
1496
1497msgid "use ldap protocol version 2"
1498msgstr "utiliser le protocole ldap version 2"
1499
1500msgid "use ldap protocol version 3"
1501msgstr "utiliser le protocole ldap version 3"
1502
1503msgid "default protocol version:"
1504msgstr "version du protocole par défaut:"
1505
1506#, fuzzy
1507msgid "Number of found entries to result in warning status"
1508msgstr "Décalage résultant en un avertissement (secondes)"
1509
1510#, fuzzy
1511msgid "Number of found entries to result in critical status"
1512msgstr "Décalage résultant en un état critique (secondes)"
1513
1514msgid "If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"
1515msgstr ""
1516
1517#, c-format
1518msgid ""
1519" implied (using default port %i) unless --port=636 is specified. In that "
1520"case\n"
1521msgstr ""
1522
1523msgid "'SSL on connect' will be used no matter how the plugin was called."
1524msgstr ""
1525
1526msgid ""
1527"This detection is deprecated, please use 'check_ldap' with the '--starttls' "
1528"or '--ssl' flags"
1529msgstr ""
1530
1531msgid "to define the behaviour explicitly instead."
1532msgstr ""
1533
1534msgid "The parameters --warn-entries and --crit-entries are optional."
1535msgstr ""
1536
1537msgid "Warning threshold must be float or float triplet!\n"
1538msgstr "Le seuil d'alerte doit être un nombre à virgule flottante!\n"
1539
1540#, c-format
1541msgid "Error opening %s\n"
1542msgstr "Erreur à l'ouverture de %s\n"
1543
1544#, fuzzy, c-format
1545msgid "could not parse load from uptime %s: %d\n"
1546msgstr "Lecture des arguments impossible\n"
1547
1548#, c-format
1549msgid "Error code %d returned in %s\n"
1550msgstr "Le code erreur %d à été retourné par %s\n"
1551
1552#, c-format
1553msgid "Error in getloadavg()\n"
1554msgstr "Erreur dans la fonction getloadavg()\n"
1555
1556#, c-format
1557msgid "Error processing %s\n"
1558msgstr "Erreur lors de l'utilisation de %s\n"
1559
1560#, c-format
1561msgid "load average: %.2f, %.2f, %.2f"
1562msgstr "Charge moyenne: %.2f, %.2f, %.2f"
1563
1564#, c-format
1565msgid "Critical threshold for %d-minute load average is not specified\n"
1566msgstr ""
1567"Le seuil critique pour la charge système après %d minutes n'est pas "
1568"spécifié\n"
1569
1570#, c-format
1571msgid "Warning threshold for %d-minute load average is not specified\n"
1572msgstr ""
1573"Le seuil d'avertissement pour la charge système après %d minutes n'est pas "
1574"spécifié\n"
1575
1576#, c-format
1577msgid ""
1578"Parameter inconsistency: %d-minute \"warning load\" is greater than "
1579"\"critical load\"\n"
1580msgstr ""
1581"Arguments Incorrects: %d-minute \"alerte charge système\" est plus grand que "
1582"\"alerte critique charge système\"\n"
1583
1584#, c-format
1585msgid "This plugin tests the current system load average."
1586msgstr "Ce plugin teste la charge système actuelle."
1587
1588msgid "Exit with WARNING status if load average exceeds WLOADn"
1589msgstr ""
1590"Sortir avec un résultat AVERTISSEMENT si la charge moyenne dépasse WLOAD"
1591
1592msgid "Exit with CRITICAL status if load average exceed CLOADn"
1593msgstr "Sortir avec un résultat CRITIQUE si la charge moyenne excède CLOAD"
1594
1595msgid "the load average format is the same used by \"uptime\" and \"w\""
1596msgstr ""
1597
1598msgid "Divide the load averages by the number of CPUs (when possible)"
1599msgstr ""
1600
1601msgid "Number of processes to show when printing the top consuming processes."
1602msgstr ""
1603
1604msgid "NUMBER_OF_PROCS=0 disables this feature. Default value is 0"
1605msgstr ""
1606
1607#, c-format
1608msgid "'%s' exited with non-zero status.\n"
1609msgstr ""
1610
1611#, c-format
1612msgid "some error occurred getting procs list.\n"
1613msgstr ""
1614
1615msgid "Could not parse arguments\n"
1616msgstr "Lecture des arguments impossible\n"
1617
1618#, c-format
1619msgid "Unable to open MRTG log file\n"
1620msgstr "Impossible d'ouvrir le fichier de log de MRTG\n"
1621
1622#, c-format
1623msgid "Unable to process MRTG log file\n"
1624msgstr "Impossible de traiter le fichier de log de MRTG\n"
1625
1626#, c-format
1627msgid "MRTG data has expired (%d minutes old)\n"
1628msgstr "Les données de MRTG on expirées (vieilles de %d minutes)\n"
1629
1630msgid "Avg"
1631msgstr "Moyenne"
1632
1633msgid "Max"
1634msgstr "Max"
1635
1636msgid "Invalid variable number"
1637msgstr "Numéro de la variable invalide"
1638
1639#, c-format
1640msgid ""
1641"%s is not a valid expiration time\n"
1642"Use '%s -h' for additional help\n"
1643msgstr ""
1644"%s n'est pas un temps d'expiration valide\n"
1645"Utilisez '%s -h' pour de l'aide supplémentaire\n"
1646
1647msgid "Invalid variable number\n"
1648msgstr "Numéro de la variable invalide\n"
1649
1650msgid "You must supply the variable number"
1651msgstr "Vous devez fournir le numéro de la variable"
1652
1653msgid ""
1654"This plugin will check either the average or maximum value of one of the"
1655msgstr "Ce plugin va vérifier la moyenne ou le maximum d'une "
1656
1657msgid "two variables recorded in an MRTG log file."
1658msgstr "deux variables du fichier de log de MRTG."
1659
1660msgid "The MRTG log file containing the data you want to monitor"
1661msgstr ""
1662
1663msgid "Minutes before MRTG data is considered to be too old"
1664msgstr ""
1665
1666msgid "Should we check average or maximum values?"
1667msgstr ""
1668
1669msgid "Which variable set should we inspect? (1 or 2)"
1670msgstr ""
1671
1672msgid "Threshold value for data to result in WARNING status"
1673msgstr ""
1674
1675msgid "Threshold value for data to result in CRITICAL status"
1676msgstr ""
1677
1678msgid "Type label for data (Examples: Conns, \"Processor Load\", In, Out)"
1679msgstr ""
1680
1681msgid "Option units label for data (Example: Packets/Sec, Errors/Sec,"
1682msgstr ""
1683
1684#, c-format
1685msgid "\"Bytes Per Second\", \"%% Utilization\")"
1686msgstr ""
1687
1688msgid ""
1689"If the value exceeds the <vwl> threshold, a WARNING status is returned. If"
1690msgstr ""
1691
1692msgid ""
1693"the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"
1694msgstr ""
1695
1696msgid "the data in the log file is older than <expire_minutes> old, a WARNING"
1697msgstr ""
1698
1699msgid "status is returned and a warning message is printed."
1700msgstr ""
1701
1702msgid ""
1703"This plugin is useful for monitoring MRTG data that does not correspond to"
1704msgstr ""
1705
1706msgid ""
1707"bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."
1708msgstr ""
1709
1710msgid ""
1711"It can be used to monitor any kind of data that MRTG is monitoring - errors,"
1712msgstr ""
1713
1714msgid ""
1715"packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"
1716msgstr ""
1717
1718msgid ""
1719"me to track processor utilization, user connections, drive space, etc and"
1720msgstr ""
1721
1722msgid "this plugin works well for monitoring that kind of data as well."
1723msgstr ""
1724
1725msgid ""
1726"- This plugin only monitors one of the two variables stored in the MRTG log"
1727msgstr ""
1728"- Ce plugin vérifie seulement une ou deux variables écrites dans un fichier "
1729"de log MRTG"
1730
1731msgid "file. If you want to monitor both values you will have to define two"
1732msgstr ""
1733
1734msgid "commands with different values for the <variable> argument. Of course,"
1735msgstr ""
1736
1737msgid "you can always hack the code to make this plugin work for you..."
1738msgstr ""
1739
1740msgid ""
1741"- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded "
1742"from"
1743msgstr ""
1744
1745msgid "Unable to open MRTG log file"
1746msgstr "Impossible d'ouvrir le fichier de log de MRTG"
1747
1748msgid "Unable to process MRTG log file"
1749msgstr "Impossible de traiter le fichier de log de MRTG"
1750
1751#, fuzzy, c-format
1752msgid "%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"
1753msgstr "%s. Entrée = %0.1f %s, %s. Sortie = %0.1f %s|%s %s\n"
1754
1755#, c-format
1756msgid "Traffic %s - %s\n"
1757msgstr "Trafic %s - %s\n"
1758
1759msgid ""
1760"This plugin will check the incoming/outgoing transfer rates of a router,"
1761msgstr ""
1762"Ce plugin va vérifier le taux de transfert en entrée/sortie d'un routeur,"
1763
1764msgid "switch, etc recorded in an MRTG log. If the newest log entry is older"
1765msgstr ""
1766
1767msgid "than <expire_minutes>, a WARNING status is returned. If either the"
1768msgstr ""
1769
1770msgid "incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"
1771msgstr ""
1772
1773msgid "Bytes/sec), a CRITICAL status results. If either of the rates exceed"
1774msgstr ""
1775
1776msgid "the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."
1777msgstr ""
1778
1779msgid "File to read log from"
1780msgstr ""
1781
1782msgid "Minutes after which log expires"
1783msgstr ""
1784
1785msgid "Test average or maximum"
1786msgstr ""
1787
1788msgid "Warning threshold pair <incoming>,<outgoing>"
1789msgstr "Paire de seuils d'avertissement <entrant>,<sortant>"
1790
1791msgid "Critical threshold pair <incoming>,<outgoing>"
1792msgstr "Paire de seuils critique <entrant>,<sortant>"
1793
1794msgid ""
1795"- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"
1796msgstr ""
1797
1798msgid "- While MRTG can monitor things other than traffic rates, this"
1799msgstr ""
1800
1801msgid " plugin probably won't work with much else without modification."
1802msgstr ""
1803
1804msgid "- The calculated i/o rates are a little off from what MRTG actually"
1805msgstr ""
1806
1807msgid " reports. I'm not sure why this is right now, but will look into it"
1808msgstr ""
1809
1810msgid " for future enhancements of this plugin."
1811msgstr ""
1812
1813#, c-format
1814msgid "Usage"
1815msgstr "Utilisation"
1816
1817#, fuzzy, c-format
1818msgid "status store_result error: %s\n"
1819msgstr "erreur slave store_result: %s\n"
1820
1821#, c-format
1822msgid "slave query error: %s\n"
1823msgstr "erreur de requête de l'esclave: %s\n"
1824
1825#, c-format
1826msgid "slave store_result error: %s\n"
1827msgstr "erreur slave store_result: %s\n"
1828
1829msgid "No slaves defined"
1830msgstr "Pas d'esclave spécifié"
1831
1832#, c-format
1833msgid "slave fetch row error: %s\n"
1834msgstr "erreur esclave lecture d'une ligne: %s\n"
1835
1836#, c-format
1837msgid "Slave running: %s"
1838msgstr "L'esclave fonctionne: %s"
1839
1840msgid "This program tests connections to a MySQL server"
1841msgstr "Ce plugin teste une connexion vers un serveur MySQL"
1842
1843msgid "Ignore authentication failure and check for mysql connectivity only"
1844msgstr ""
1845
1846msgid "Use the specified socket (has no effect if -H is used)"
1847msgstr ""
1848
1849msgid "Check database with indicated name"
1850msgstr ""
1851
1852msgid "Read from the specified client options file"
1853msgstr ""
1854
1855msgid "Use a client options group"
1856msgstr ""
1857
1858msgid "Connect using the indicated username"
1859msgstr ""
1860
1861msgid "Use the indicated password to authenticate the connection"
1862msgstr ""
1863
1864msgid "IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"
1865msgstr ""
1866
1867msgid "Your clear-text password could be visible as a process table entry"
1868msgstr ""
1869
1870msgid "Check if the slave thread is running properly."
1871msgstr ""
1872
1873msgid "Exit with WARNING status if slave server is more than INTEGER seconds"
1874msgstr ""
1875"Sortir avec un résultat AVERTISSEMENT si le serveur esclave est plus de X "
1876
1877msgid "behind master"
1878msgstr "secondes en retard sur le maître"
1879
1880msgid "Exit with CRITICAL status if slave server is more then INTEGER seconds"
1881msgstr "Sortir avec un résultat CRITIQUE si le serveur esclave est plus de X "
1882
1883msgid "Use ssl encryption"
1884msgstr ""
1885
1886msgid "Path to CA signing the cert"
1887msgstr ""
1888
1889msgid "Path to SSL certificate"
1890msgstr ""
1891
1892msgid "Path to private SSL key"
1893msgstr ""
1894
1895msgid "Path to CA directory"
1896msgstr ""
1897
1898msgid "List of valid SSL ciphers"
1899msgstr ""
1900
1901msgid ""
1902"There are no required arguments. By default, the local database is checked"
1903msgstr ""
1904"Il n'y a pas d'arguments nécessaires. Par défaut la base de donnée locale "
1905"est testée"
1906
1907msgid ""
1908"using the default unix socket. You can force TCP on localhost by using an"
1909msgstr ""
1910
1911msgid "IP address or FQDN ('localhost' will use the socket as well)."
1912msgstr ""
1913
1914msgid "You must specify -p with an empty string to force an empty password,"
1915msgstr ""
1916
1917msgid "overriding any my.cnf settings."
1918msgstr ""
1919
1920msgid "Cannot open status log for reading!"
1921msgstr "Impossible d'ouvrir le fichier status log en lecture!"
1922
1923#, c-format
1924msgid "Found process: %s %s\n"
1925msgstr "Processus trouvé: %s %s\n"
1926
1927msgid "Could not locate a running Nagios process!"
1928msgstr "Impossible de trouver un processus Nagios actif!"
1929
1930msgid "Cannot parse Nagios log file for valid time"
1931msgstr ""
1932"Impossible de trouver une date/heure valide dans le fichier de log de Nagios"
1933
1934#, c-format
1935msgid "%d process"
1936msgid_plural "%d processes"
1937msgstr[0] "%d processus"
1938msgstr[1] "%d processus"
1939
1940#, c-format
1941msgid "status log updated %d second ago"
1942msgid_plural "status log updated %d seconds ago"
1943msgstr[0] "status log mis à jour %d secondes auparavant"
1944msgstr[1] "status log mis à jour %d secondes auparavant"
1945
1946msgid "Expiration time must be an integer (seconds)\n"
1947msgstr "Le délai d'expiration doit être un entier (en secondes)\n"
1948
1949#, fuzzy
1950msgid "Timeout must be an integer (seconds)\n"
1951msgstr "Le délai d'expiration doit être un entier (en secondes)\n"
1952
1953msgid "You must provide the status_log\n"
1954msgstr "Vous devez fournir le status_log\n"
1955
1956msgid "You must provide a process string\n"
1957msgstr "Vous devez fournir un nom de processus\n"
1958
1959msgid ""
1960"This plugin checks the status of the Nagios process on the local machine"
1961msgstr "Ce plugin vérifie l'état du processus Nagios sur la machine locale."
1962
1963msgid ""
1964"The plugin will check to make sure the Nagios status log is no older than"
1965msgstr "Ce plugin vérifie que le status log de Nagios n'est pas plus vieux que"
1966
1967msgid "the number of minutes specified by the expires option."
1968msgstr "le nombre de minutes spécifies par l'option expire."
1969
1970msgid ""
1971"It also checks the process table for a process matching the command argument."
1972msgstr ""
1973
1974msgid "Name of the log file to check"
1975msgstr "Nom du fichier log à vérifier"
1976
1977msgid "Minutes aging after which logfile is considered stale"
1978msgstr ""
1979
1980msgid "Substring to search for in process arguments"
1981msgstr ""
1982
1983msgid "Timeout for the plugin in seconds"
1984msgstr ""
1985
1986#, c-format
1987msgid "Wrong client version - running: %s, required: %s"
1988msgstr "Mauvaise version du client utilisée: %s, nécessaire: %s"
1989
1990msgid "missing -l parameters"
1991msgstr "Arguments -l manquants"
1992
1993msgid "wrong -l parameter."
1994msgstr "Arguments -l erronés."
1995
1996msgid "CPU Load"
1997msgstr "Charge CPU"
1998
1999#, c-format
2000msgid " %lu%% (%lu min average)"
2001msgstr " %lu%% (%lu moyenne minimale)"
2002
2003#, c-format
2004msgid " '%lu min avg Load'=%lu%%;%lu;%lu;0;100"
2005msgstr " '%lu Charge moyenne minimale'=%lu%%;%lu;%lu;0;100"
2006
2007msgid "not enough values for -l parameters"
2008msgstr "pas assez de valeur pour l'argument -l"
2009
2010msgid "wrong -l argument"
2011msgstr "Argument -l erroné"
2012
2013#, fuzzy, c-format
2014msgid "System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"
2015msgstr "Système démarré - %u jour(s) %u heure(s) %u minute(s)"
2016
2017#, c-format
2018msgid "%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"
2019msgstr ""
2020"%s:\\ - total: %.2f Gb - utilisé: %.2f Gb (%.0f%%) - libre %.2f Gb (%.0f%%)"
2021
2022#, c-format
2023msgid "'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"
2024msgstr "'%s:\\ Espace Utilisé'=%.2fGb;%.2f;%.2f;0.00;%.2f"
2025
2026msgid "Free disk space : Invalid drive"
2027msgstr "Espace disque libre : Lecteur invalide"
2028
2029msgid "No service/process specified"
2030msgstr "Pas de service/processus spécifié"
2031
2032msgid "could not fetch information from server\n"
2033msgstr "Impossible d'obtenir l'information depuis le serveur\n"
2034
2035#, fuzzy, c-format
2036msgid ""
2037"Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"
2038msgstr ""
2039"Mémoire utilisée: total:%.2f Mb - utilisée: %.2f Mb (%.0f%%) - libre: %.2f "
2040"Mb (%.0f%%)"
2041
2042#, fuzzy, c-format
2043msgid "'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"
2044msgstr "'Mémoire utilisée'=%.2fMb;%.2f;%.2f;0.00;%.2f"
2045
2046msgid "No counter specified"
2047msgstr "Pas de compteur spécifié"
2048
2049msgid "Minimum value contains non-numbers"
2050msgstr "La valeur minimum contient des caractères non numériques"
2051
2052msgid "Maximum value contains non-numbers"
2053msgstr "La valeur maximum contient des caractères non numériques"
2054
2055msgid "No unit counter specified"
2056msgstr "Pas de compteur spécifié"
2057
2058msgid "Please specify a variable to check"
2059msgstr "Veuillez préciser une variable a vérifier"
2060
2061msgid "Server port must be an integer\n"
2062msgstr "Le port du serveur doit être un nombre entier\n"
2063
2064msgid "You must provide a server address or host name"
2065msgstr "Vous devez spécifier une adresse ou un nom d'hôte"
2066
2067msgid "None"
2068msgstr "Aucun"
2069
2070msgid "This plugin collects data from the NSClient service running on a"
2071msgstr ""
2072"Ce plugin collecte les données depuis le service NSClient tournant sur un"
2073
2074msgid "Windows NT/2000/XP/2003 server."
2075msgstr "Serveur Windows NT/2000/XP/2003."
2076
2077msgid "Name of the host to check"
2078msgstr "Nom de l'hôte à vérifier"
2079
2080msgid "Optional port number (default: "
2081msgstr "Numéro de port optionnel (défaut: "
2082
2083msgid "Password needed for the request"
2084msgstr "Mot de passe nécessaire pour la requête"
2085
2086msgid "Threshold which will result in a warning status"
2087msgstr ""
2088
2089msgid "Threshold which will result in a critical status"
2090msgstr ""
2091
2092msgid "Seconds before connection attempt times out (default: "
2093msgstr ""
2094
2095msgid "Parameters passed to specified check (see below)"
2096msgstr ""
2097
2098msgid "Display options (currently only SHOWALL works)"
2099msgstr ""
2100
2101msgid "Return UNKNOWN on timeouts"
2102msgstr ""
2103
2104msgid "Print this help screen"
2105msgstr "Afficher l'écran d'aide"
2106
2107msgid "Print version information"
2108msgstr "Afficher la version"
2109
2110msgid "Variable to check"
2111msgstr "Variable a vérifier"
2112
2113msgid "Valid variables are:"
2114msgstr "Les variables valides sont"
2115
2116msgid "Get the NSClient version"
2117msgstr "Obtenir la version de NSClient"
2118
2119msgid "If -l <version> is specified, will return warning if versions differ."
2120msgstr ""
2121"si l'argument -l <version> est spécifié, une alerte AVERTISSEMENT sera "
2122"renvoyée, si les versions sont différentes."
2123
2124msgid "Average CPU load on last x minutes."
2125msgstr "Moyenne de la charge CPU sur les dernières x minutes."
2126
2127msgid "Request a -l parameter with the following syntax:"
2128msgstr "Demande un paramètre -l avec la syntaxe suivante:"
2129
2130msgid "-l <minutes range>,<warning threshold>,<critical threshold>."
2131msgstr "-l <plage de minutes>,<seuil d'avertissement>,<seuil critique>."
2132
2133msgid "<minute range> should be less than 24*60."
2134msgstr "<plage de minutes> devrait être inférieur à 24*60."
2135
2136msgid ""
2137"Thresholds are percentage and up to 10 requests can be done in one shot."
2138msgstr ""
2139"Les seuils sonts en pourcentage et un maximum de 10 requêtes peuvent être "
2140"effectuées à la fois."
2141
2142msgid "Get the uptime of the machine."
2143msgstr "Obtenir le temps de service de la machine."
2144
2145msgid "-l <unit> "
2146msgstr ""
2147
2148msgid "<unit> = seconds, minutes, hours, or days. (default: minutes)"
2149msgstr ""
2150
2151#, fuzzy
2152msgid "Thresholds will use the unit specified above."
2153msgstr "Ce plugin va vérifier l'heure sur l'hôte spécifié."
2154
2155msgid "Size and percentage of disk use."
2156msgstr "Taille et pourcentage de l'utilisation disque."
2157
2158msgid "Request a -l parameter containing the drive letter only."
2159msgstr "Demande un paramètre -l contennant uniquement la lettre du lecteur."
2160
2161msgid "Warning and critical thresholds can be specified with -w and -c."
2162msgstr "Les seuils d'alerte et critiques peuvent être spécifiés avec -w et -c."
2163
2164msgid "Memory use."
2165msgstr "Mémoire utilisée."
2166
2167msgid "Check the state of one or several services."
2168msgstr "Vérifier l'état d'un ou plusieurs services."
2169
2170msgid "Request a -l parameters with the following syntax:"
2171msgstr "Demande un paramètre -l avec la syntaxe suivante:"
2172
2173msgid "-l <service1>,<service2>,<service3>,..."
2174msgstr "-l <service1>,<service2>,<service3>,..."
2175
2176msgid "You can specify -d SHOWALL in case you want to see working services"
2177msgstr "Vous pouvez spécifier -d SHOWALL pour voir les services fonctionnant"
2178
2179msgid "in the returned string."
2180msgstr "dans la chaîne de caractère renvoyée."
2181
2182msgid "Check if one or several process are running."
2183msgstr "Vérifie si un ou plusieurs processus sont démarrés."
2184
2185msgid "Same syntax as SERVICESTATE."
2186msgstr "Même syntaxe que SERVICESTATE."
2187
2188msgid "Check any performance counter of Windows NT/2000."
2189msgstr "Vérifier n'importe quel compteur de performance sur Windows NT/2000."
2190
2191msgid "-l \"\\\\<performance object>\\\\counter\",\"<description>"
2192msgstr "-l \"\\\\<catégorie>\\\\compteur\",\"<description>"
2193
2194msgid "The <description> parameter is optional and is given to a printf "
2195msgstr "Le paramètre <description> est optionnel et est passé à la fonction "
2196
2197msgid "output command which requires a float parameter."
2198msgstr "de sortie printf qui demande un paramètre de type float."
2199
2200#, c-format
2201msgid "If <description> does not include \"%%\", it is used as a label."
2202msgstr "Si <description> n'inclus pas \"%%\", il est utilisé comme étiquette."
2203
2204msgid "Some examples:"
2205msgstr "Exemples:"
2206
2207msgid "Check any performance counter object of Windows NT/2000."
2208msgstr "Vérifie n'importe quel compteur de performance de Windows NT/2000."
2209
2210msgid ""
2211"Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"
2212msgstr ""
2213
2214msgid "<counter object> is a Windows Perfmon Counter object (eg. Process),"
2215msgstr ""
2216
2217msgid "if it is two words, it should be enclosed in quotes"
2218msgstr ""
2219
2220msgid "The returned results will be a comma-separated list of instances on "
2221msgstr ""
2222
2223msgid " the selected computer for that object."
2224msgstr ""
2225
2226msgid ""
2227"The purpose of this is to be run from command line to determine what "
2228"instances"
2229msgstr ""
2230
2231msgid ""
2232" are available for monitoring without having to log onto the Windows server"
2233msgstr ""
2234
2235msgid " to run Perfmon directly."
2236msgstr ""
2237
2238msgid ""
2239"It can also be used in scripts that automatically create the monitoring "
2240"service"
2241msgstr ""
2242
2243msgid " configuration files."
2244msgstr ""
2245
2246msgid "check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"
2247msgstr ""
2248
2249msgid ""
2250"- The NSClient service should be running on the server to get any information"
2251msgstr ""
2252"- Le service NSClient doit rouler sur le serveur pour obtenir les "
2253"informations"
2254
2255msgid "- Critical thresholds should be lower than warning thresholds"
2256msgstr ""
2257"- Les seuils critiques doivent être plus bas que les seuils d'avertissement"
2258
2259msgid "- Default port 1248 is sometimes in use by other services. The error"
2260msgstr ""
2261"- Le port par défaut 1248 est parfois utilisé par d'autres services. L'erreur"
2262
2263msgid ""
2264"output when this happens contains \"Cannot map xxxxx to protocol number\"."
2265msgstr "qui en résulte contiens \"Cannot map xxxxx to protocol number\"."
2266
2267msgid "One fix for this is to change the port to something else on check_nt "
2268msgstr ""
2269"Une possibilité pour corriger ce problème est de changer le port dans "
2270"check_nt "
2271
2272msgid "and on the client service it's connecting to."
2273msgstr "et dans le service auquel il se connecte."
2274
2275#, c-format
2276msgid "jitter response too large (%lu bytes)\n"
2277msgstr ""
2278
2279msgid "NTP CRITICAL:"
2280msgstr "NTP CRITIQUE:"
2281
2282msgid "NTP WARNING:"
2283msgstr "NTP AVERTISSEMENT:"
2284
2285msgid "NTP OK:"
2286msgstr "NTP OK:"
2287
2288msgid "NTP UNKNOWN:"
2289msgstr "NTP INCONNU:"
2290
2291msgid "Offset unknown"
2292msgstr "Décalage inconnu"
2293
2294msgid "Offset"
2295msgstr "Décalage"
2296
2297msgid "This plugin checks the selected ntp server"
2298msgstr "Ce plugin vérifie le service ntp sur l'hôte"
2299
2300msgid "Offset to result in warning status (seconds)"
2301msgstr "Décalage résultant en un avertissement (secondes)"
2302
2303msgid "Offset to result in critical status (seconds)"
2304msgstr "Décalage résultant en un état critique (secondes)"
2305
2306msgid "Warning threshold for jitter"
2307msgstr "Seuil d'avertissement pour la variation (jitter)"
2308
2309msgid "Critical threshold for jitter"
2310msgstr "Seuil critique pour la variation (jitter)"
2311
2312msgid "Normal offset check:"
2313msgstr "Vérification normale du décalage:"
2314
2315msgid ""
2316"Check jitter too, avoiding critical notifications if jitter isn't available"
2317msgstr ""
2318"Vérifier aussi la variation (jitter) en évitant les notifications s'il n'est "
2319"pas dispoible"
2320
2321msgid "(See Notes above for more details on thresholds formats):"
2322msgstr ""
2323"(Voir les Notes ci-dessus pour plus de détails sur le format des seuils)"
2324
2325msgid "WARNING: check_ntp is deprecated. Please use check_ntp_peer or"
2326msgstr "ATTENTION: check_ntp est périmé, utilisez plutôt check_ntp_peer"
2327
2328msgid "check_ntp_time instead."
2329msgstr "ou check_ntp_time."
2330
2331msgid "Server not synchronized"
2332msgstr "Le serveur n'est pas synchronisé"
2333
2334msgid "Server has the LI_ALARM bit set"
2335msgstr ""
2336
2337msgid ""
2338"Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"
2339msgstr ""
2340"Retourne INCONNU au lieu de CRITIQUE ou AVERTISSEMENT si le serveur n'est "
2341"pas synchronisé"
2342
2343#, fuzzy
2344msgid "Warning threshold for stratum of server's synchronization peer"
2345msgstr "Seuil d'avertissement pour le stratum"
2346
2347#, fuzzy
2348msgid "Critical threshold for stratum of server's synchronization peer"
2349msgstr "Seuil critique pour le stratum"
2350
2351msgid "Warning threshold for number of usable time sources (\"truechimers\")"
2352msgstr ""
2353"Seuil d'avertissement pour le nombre de sources de temps utilisable "
2354"(\"truechimers\")"
2355
2356msgid "Critical threshold for number of usable time sources (\"truechimers\")"
2357msgstr ""
2358"Seuil critique pour le nombre de sources de temps utilisable "
2359"(\"truechimers\")"
2360
2361msgid "This plugin checks an NTP server independent of any commandline"
2362msgstr "Ce plugin vérifie un serveur NTP sans recours aux programmes de"
2363
2364msgid "programs or external libraries."
2365msgstr "la ligne de commande ou libraries externes"
2366
2367msgid "Use this plugin to check the health of an NTP server. It supports"
2368msgstr ""
2369"Utilisez ce plugin pour vérifier le service NTP sur l'hôte. Il supporte la"
2370
2371msgid "checking the offset with the sync peer, the jitter and stratum. This"
2372msgstr ""
2373"vérification du décalage avec le pair se synchronisation, la variation "
2374"(jitter) et le stratum."
2375
2376msgid "plugin will not check the clock offset between the local host and NTP"
2377msgstr ""
2378"Ce plugin ne vérifie pas le décalage entre le serveur local et le serveur"
2379
2380msgid "server; please use check_ntp_time for that purpose."
2381msgstr "NTP; utilisez plutôt check_ntp_time à cette fin."
2382
2383msgid "Simple NTP server check:"
2384msgstr "Vérification simple du serveur NTP:"
2385
2386msgid "Only check the number of usable time sources (\"truechimers\"):"
2387msgstr ""
2388
2389msgid "Check only stratum:"
2390msgstr "Vérification du stratum seulement:"
2391
2392msgid "This plugin checks the clock offset with the ntp server"
2393msgstr "Ce plugin vérifie le décalage de l'horloge avec le serveur ntp"
2394
2395msgid "Returns UNKNOWN instead of CRITICAL if offset cannot be found"
2396msgstr "Retourne INCONNU au lieu de CRITIQUE si le décalage est inconnu"
2397
2398msgid "Expected offset of the ntp server relative to local server (seconds)"
2399msgstr ""
2400
2401msgid "This plugin checks the clock offset between the local host and a"
2402msgstr "Ce plugin vérifie le décalage de l'horloge entre se serveur local et"
2403
2404msgid "remote NTP server. It is independent of any commandline programs or"
2405msgstr "le serveur NTP distant. Il ne fait aucun recours aux programmes de"
2406
2407msgid "external libraries."
2408msgstr "la ligne de commande ou libraries externes."
2409
2410msgid "If you'd rather want to monitor an NTP server, please use"
2411msgstr "Si vous voulez plutôt surveiller un serveur NTP, veuillez"
2412
2413msgid "check_ntp_peer."
2414msgstr "utiliser check_ntp_peer."
2415
2416msgid "--time-offset is useful for compensating for servers with known"
2417msgstr ""
2418
2419msgid "and expected clock skew."
2420msgstr ""
2421
2422#, c-format
2423msgid "NetWare %s: "
2424msgstr "NetWare %s: "
2425
2426#, c-format
2427msgid "Up %s,"
2428msgstr "Démarré %s,"
2429
2430#, c-format
2431msgid "Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"
2432msgstr ""
2433"Charge %s - %s %s charge système minimale = %lu%%|charge%s=%lu;%lu;%lu;0;100"
2434
2435#, c-format
2436msgid "Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"
2437msgstr "Conns %s - %lu connections actuelles|Conns=%lu;%lu;%lu;;"
2438
2439#, c-format
2440msgid "%s: Long term cache hits = %lu%%"
2441msgstr "%s: Accès cache longue durée = %lu%%"
2442
2443#, c-format
2444msgid "%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"
2445msgstr "%s: Total des caches tampons= %lu|Caches Tampons=%lu,%lu;%lu;;"
2446
2447#, c-format
2448msgid "%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"
2449msgstr "%s: cache tampons sales = %lu|caches tampons sales=%lu;%lu;%lu;;"
2450
2451#, c-format
2452msgid "%s: LRU sitting time = %lu minutes"
2453msgstr ""
2454
2455#, c-format
2456msgid "CRITICAL - Volume '%s' does not exist!"
2457msgstr "CRITIQUE: Le volume '%s' n'existe pas!"
2458
2459#, c-format
2460msgid "%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"
2461msgstr "%s%lu KB libre sur le volume %s|KB libres%s=%lu;%lu;%lu;;"
2462
2463msgid "Only "
2464msgstr "Seulement"
2465
2466#, c-format
2467msgid "%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"
2468msgstr "%s%lu MB libre sur le volume %s|MBlibre%s=%lu;%lu;%lu;;"
2469
2470#, c-format
2471msgid "%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"
2472msgstr ""
2473
2474#, c-format
2475msgid ""
2476"%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"
2477msgstr ""
2478"%lu MB (%lu%%) libre sur le volume %s - total %lu MB|MBlibre%s=%lu;%lu;"
2479"%lu;0;100"
2480
2481#, c-format
2482msgid "Directory Services Database is %s (DS version %s)"
2483msgstr "La base de données Directory Services est %s (DS version %s)"
2484
2485#, c-format
2486msgid "Logins are %s"
2487msgstr "Les logins sont %s"
2488
2489msgid "enabled"
2490msgstr "activé"
2491
2492msgid "disabled"
2493msgstr "désactivé"
2494
2495msgid "CRITICAL - NRM Status is bad!"
2496msgstr "CRITIQUE - le statut NRM est mauvais!"
2497
2498msgid "Warning - NRM Status is suspect!"
2499msgstr ""
2500
2501msgid "OK - NRM Status is good!"
2502msgstr "OK - Le status du NRM est bon!"
2503
2504#, c-format
2505msgid "%lu of %lu (%lu%%) packet receive buffers used"
2506msgstr "%lu de %lu (%lu%%) paquets du tampon de réception utilisés"
2507
2508#, c-format
2509msgid "%lu entries in SAP table"
2510msgstr "%lu entrées dans la table SAP"
2511
2512#, c-format
2513msgid "%lu entries in SAP table for SAP type %d"
2514msgstr "%lu entrées dans la table SAP pour le type SAP %d"
2515
2516#, c-format
2517msgid "%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
2518msgstr "%s%lu KB effaçables sur le volume %s|Purge%s=%lu;%lu;%lu;;"
2519
2520#, c-format
2521msgid "%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
2522msgstr "%s%lu KB effaçables sur le volume %s|Purge%s=%lu;%lu;%lu;;"
2523
2524#, c-format
2525msgid "%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"
2526msgstr ""
2527"%lu MB (%lu%%) effaçables sur le volume %s|Effacable%s=%lu;%lu;%lu;0;100"
2528
2529#, c-format
2530msgid "%s%lu KB not yet purgeable on volume %s"
2531msgstr "%s%lu KB pas encore effaçables sur le volume %s"
2532
2533#, c-format
2534msgid "%lu MB (%lu%%) not yet purgeable on volume %s"
2535msgstr "%lu MB (%lu%%) pas encore effaçables sur le volume %s"
2536
2537#, c-format
2538msgid "%lu open files|Openfiles=%lu;%lu;%lu;0,0"
2539msgstr ""
2540
2541#, c-format
2542msgid "%lu abended threads|Abends=%lu;%lu;%lu;;"
2543msgstr "%lu processus avortés|Avortés=%lu;%lu;%lu;;"
2544
2545#, c-format
2546msgid "%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"
2547msgstr "%lu processus services actuels (%lu max)|Processus=%lu;%lu;%lu;0;%lu"
2548
2549msgid "CRITICAL - Time not in sync with network!"
2550msgstr "CRITIQUE - Le temps n'est pas synchronisé avec le réseau!"
2551
2552msgid "OK - Time in sync with network!"
2553msgstr "OK - Le temps est synchronisé avec le réseau!"
2554
2555#, c-format
2556msgid "LRU sitting time = %lu seconds"
2557msgstr "LRU temps d'attente = %lu secondes"
2558
2559#, c-format
2560msgid "Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"
2561msgstr "Buffers cache sales = %lu%% du total|DCB=%lu;%lu;%lu;0;100"
2562
2563#, c-format
2564msgid "Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"
2565msgstr "cache tampons totaux= %lu%% de l'original|TCB=%lu;%lu;%lu;0;100"
2566
2567#, c-format
2568msgid "NDS Version %s"
2569msgstr "Version NDS %s"
2570
2571#, c-format
2572msgid "Up %s"
2573msgstr "Démarré %s"
2574
2575#, c-format
2576msgid "Module %s version %s is loaded"
2577msgstr "Le Module %s version %s est chargé"
2578
2579#, c-format
2580msgid "Module %s is not loaded"
2581msgstr "Le Module %s n'est pas chargé"
2582
2583#, c-format
2584msgid "CRITICAL - Value '%s' does not exist!"
2585msgstr "CRITIQUE: Le valeur '%s' n'existe pas!"
2586
2587#, c-format
2588msgid "%s is %lu|%s=%lu;%lu;%lu;;"
2589msgstr "%s est %lu|%s=%lu;%lu;%lu;;"
2590
2591msgid "Nothing to check!\n"
2592msgstr "Rien à vérifier!\n"
2593
2594msgid "Server port an integer\n"
2595msgstr "Le port du serveur doit être un nombre entier\n"
2596
2597msgid "This plugin attempts to contact the MRTGEXT NLM running on a"
2598msgstr "Ce plugin essaye de contacter le NLM MRTGEXT qui s'exécute sur"
2599
2600msgid "Novell server to gather the requested system information."
2601msgstr "un serveur Novell pour récupérer l'information système demandée."
2602
2603msgid "Variable to check. Valid variables include:"
2604msgstr "Variable à vérifier. Les variables valides sont:"
2605
2606msgid "LOAD1 = 1 minute average CPU load"
2607msgstr ""
2608
2609msgid "LOAD5 = 5 minute average CPU load"
2610msgstr ""
2611
2612msgid "LOAD15 = 15 minute average CPU load"
2613msgstr ""
2614
2615msgid "CSPROCS = number of current service processes (NW 5.x only)"
2616msgstr "CSPROCS = nombres de processus services actuels (NW 5.x seulement)"
2617
2618msgid "ABENDS = number of abended threads (NW 5.x only)"
2619msgstr ""
2620
2621msgid "UPTIME = server uptime"
2622msgstr ""
2623
2624msgid "LTCH = percent long term cache hits"
2625msgstr ""
2626
2627msgid "CBUFF = current number of cache buffers"
2628msgstr ""
2629
2630msgid "CDBUFF = current number of dirty cache buffers"
2631msgstr ""
2632
2633msgid "DCB = dirty cache buffers as a percentage of the total"
2634msgstr ""
2635
2636msgid "TCB = dirty cache buffers as a percentage of the original"
2637msgstr ""
2638
2639msgid "OFILES = number of open files"
2640msgstr ""
2641
2642msgid " VMF<vol> = MB of free space on Volume <vol>"
2643msgstr ""
2644
2645msgid " VMU<vol> = MB used space on Volume <vol>"
2646msgstr ""
2647
2648msgid " VMP<vol> = MB of purgeable space on Volume <vol>"
2649msgstr ""
2650
2651msgid " VPF<vol> = percent free space on volume <vol>"
2652msgstr ""
2653
2654msgid " VKF<vol> = KB of free space on volume <vol>"
2655msgstr ""
2656
2657msgid " VPP<vol> = percent purgeable space on volume <vol>"
2658msgstr ""
2659
2660msgid " VKP<vol> = KB of purgeable space on volume <vol>"
2661msgstr ""
2662
2663msgid " VPNP<vol> = percent not yet purgeable space on volume <vol>"
2664msgstr ""
2665
2666msgid " VKNP<vol> = KB of not yet purgeable space on volume <vol>"
2667msgstr ""
2668
2669msgid " LRUM = LRU sitting time in minutes"
2670msgstr ""
2671
2672msgid " LRUS = LRU sitting time in seconds"
2673msgstr " LRUS = LRU temps d'attente en secondes"
2674
2675msgid " DSDB = check to see if DS Database is open"
2676msgstr ""
2677
2678msgid " DSVER = NDS version"
2679msgstr ""
2680
2681msgid " UPRB = used packet receive buffers"
2682msgstr " UPRB = paquets du tampon de réception utilisés"
2683
2684msgid " PUPRB = percent (of max) used packet receive buffers"
2685msgstr ""
2686
2687msgid " SAPENTRIES = number of entries in the SAP table"
2688msgstr ""
2689
2690msgid " SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"
2691msgstr " SAPENTRIES<n> = entrées dans la table SAP pour le type SAP <n>"
2692
2693msgid " TSYNC = timesync status"
2694msgstr ""
2695
2696msgid " LOGINS = check to see if logins are enabled"
2697msgstr ""
2698
2699msgid " CONNS = number of currently licensed connections"
2700msgstr ""
2701
2702msgid " NRMH\t= NRM Summary Status"
2703msgstr ""
2704
2705msgid " NRMP<stat> = Returns the current value for a NRM health item"
2706msgstr ""
2707
2708msgid " NRMM<stat> = Returns the current memory stats from NRM"
2709msgstr ""
2710
2711msgid " NRMS<stat> = Returns the current Swapfile stats from NRM"
2712msgstr ""
2713
2714msgid " NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"
2715msgstr ""
2716
2717msgid " NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"
2718msgstr ""
2719
2720msgid " NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"
2721msgstr ""
2722
2723msgid " NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"
2724msgstr ""
2725
2726msgid " NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"
2727msgstr ""
2728
2729msgid ""
2730" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"
2731msgstr ""
2732
2733msgid " NLM:<nlm> = check if NLM is loaded and report version"
2734msgstr ""
2735
2736msgid " (e.g. NLM:TSANDS.NLM)"
2737msgstr ""
2738
2739msgid "Include server version string in results"
2740msgstr ""
2741
2742msgid "- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"
2743msgstr ""
2744
2745msgid ""
2746" extension for NetWare be loaded on the Novell servers you wish to check."
2747msgstr ""
2748
2749msgid " (available from http://www.engr.wisc.edu/~drews/mrtg/)"
2750msgstr " (disponible depuis http://www.engr.wisc.edu/~drews/mrtg/)"
2751
2752msgid ""
2753"- Values for critical thresholds should be lower than warning thresholds"
2754msgstr ""
2755
2756msgid ""
2757" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "
2758msgstr ""
2759
2760msgid " TCB, LRUS and LRUM."
2761msgstr ""
2762
2763msgid "Unknown error fetching load data\n"
2764msgstr ""
2765"Erreur inconnue lors de la récupération des données de charge système\n"
2766
2767msgid "Invalid response from server - no load information\n"
2768msgstr "Réponse invalide du serveur - pas d'information de charge système\n"
2769
2770msgid "Invalid response from server after load 1\n"
2771msgstr "Réponse invalide du serveur après charge système à 1 minute\n"
2772
2773msgid "Invalid response from server after load 5\n"
2774msgstr "Réponse invalide du serveur après charge système à 5 minute\n"
2775
2776#, c-format
2777msgid "Load %s - %s-min load average = %0.2f"
2778msgstr "Charge %s - %s-moyenne minimale de charge système = %0.2f"
2779
2780msgid "Unknown error fetching disk data\n"
2781msgstr "Erreur inconnue en récupérant les données des disques\n"
2782
2783msgid "Invalid response from server\n"
2784msgstr "Réponse invalide reçue du serveur\n"
2785
2786msgid "Unknown error fetching network status\n"
2787msgstr "Erreur inconnue lors de la réception de l'état du réseau\n"
2788
2789#, c-format
2790msgid "Net %s - %d connection%s on port %d"
2791msgstr "Net %s - %d connections%s sur le port %d"
2792
2793msgid "Unknown error fetching process status\n"
2794msgstr "Erreur inconnue en récupérant l'état des processus\n"
2795
2796#, c-format
2797msgid "Process %s - %d instance%s of %s running"
2798msgstr "Processus %s - %d instances%s de %s démarrées"
2799
2800#, c-format
2801msgid "Uptime %s - Up %d days %d hours %d minutes"
2802msgstr "Temps de fonctionnement %s - Up %d jours %d heures %d minutes"
2803
2804msgid ""
2805"This plugin attempts to contact the Over-CR collector daemon running on the"
2806msgstr ""
2807"Ce plugin essaye de joindre le service Over CR tournant sur le serveur UNIX"
2808
2809msgid "remote UNIX server in order to gather the requested system information."
2810msgstr "distant afin de récupérer les informations système demandées."
2811
2812msgid "LOAD1 = 1 minute average CPU load"
2813msgstr ""
2814
2815msgid "LOAD5 = 5 minute average CPU load"
2816msgstr ""
2817
2818msgid "LOAD15 = 15 minute average CPU load"
2819msgstr ""
2820
2821msgid "DPU<filesys> = percent used disk space on filesystem <filesys>"
2822msgstr ""
2823
2824msgid "PROC<process> = number of running processes with name <process>"
2825msgstr ""
2826
2827msgid "NET<port> = number of active connections on TCP port <port>"
2828msgstr ""
2829
2830msgid "UPTIME = system uptime in seconds"
2831msgstr ""
2832
2833msgid "This plugin requires that Eric Molitors' Over-CR collector daemon be"
2834msgstr "Ce plugin requiert que le daemon collecteur Over-CR d'Eric Molitors"
2835
2836msgid "running on the remote server."
2837msgstr "soit fonctionnel sur le serveur distant"
2838
2839msgid "Over-CR can be downloaded from http://www.molitor.org/overcr"
2840msgstr ""
2841
2842msgid "This plugin was tested with version 0.99.53 of the Over-CR collector"
2843msgstr "Ce plugin a été testé avec la version 0.99.53 su collecteur Over-CR"
2844
2845msgid ""
2846"For the available options, the critical threshold value should always be"
2847msgstr ""
2848"Pour toutes les options disponibles, le seuil critique doit toujours être"
2849
2850msgid ""
2851"higher than the warning threshold value, EXCEPT with the uptime variable"
2852msgstr "plus grand que le seuil d'alerte SAUF pour l'option uptime"
2853
2854#, c-format
2855msgid "CRITICAL - no connection to '%s' (%s).\n"
2856msgstr "CRITIQUE - pas de connexion à '%s' (%s).\n"
2857
2858#, fuzzy, c-format
2859msgid " %s - database %s (%f sec.)|%s\n"
2860msgstr " %s - base de données %s (%d sec.)|%s\n"
2861
2862msgid "Critical threshold must be a positive integer"
2863msgstr "Le seuil critique doit être un entier positif"
2864
2865msgid "Warning threshold must be a positive integer"
2866msgstr "Le seuil d'avertissement doit être un entier positif"
2867
2868#, fuzzy
2869msgid "Database name exceeds the maximum length"
2870msgstr "Le nom de la base de données est invalide"
2871
2872msgid "User name is not valid"
2873msgstr "Le nom de l'utilisateur est invalide"
2874
2875#, c-format
2876msgid "Test whether a PostgreSQL Database is accepting connections."
2877msgstr "Teste si une base de données Postgresql accepte les connections."
2878
2879msgid "Database to check "
2880msgstr ""
2881
2882#, fuzzy, c-format
2883msgid "(default: %s)\n"
2884msgstr "(Défaut: %d)\n"
2885
2886msgid "Login name of user"
2887msgstr "Le nom d'un utilisateur"
2888
2889msgid "Password (BIG SECURITY ISSUE)"
2890msgstr ""
2891
2892msgid "Connection parameters (keyword = value), see below"
2893msgstr ""
2894
2895msgid "SQL query to run. Only first column in first row will be read"
2896msgstr ""
2897
2898msgid "A name for the query, this string is used instead of the query"
2899msgstr ""
2900
2901msgid "in the long output of the plugin"
2902msgstr ""
2903
2904#, fuzzy
2905msgid "SQL query value to result in warning status (double)"
2906msgstr "Décalage résultant en un avertissement (secondes)"
2907
2908#, fuzzy
2909msgid "SQL query value to result in critical status (double)"
2910msgstr "Décalage résultant en un état critique (secondes)"
2911
2912msgid "All parameters are optional."
2913msgstr ""
2914
2915msgid ""
2916"This plugin tests a PostgreSQL DBMS to determine whether it is active and"
2917msgstr ""
2918
2919msgid "accepting queries. In its current operation, it simply connects to the"
2920msgstr ""
2921
2922msgid ""
2923"specified database, and then disconnects. If no database is specified, it"
2924msgstr ""
2925
2926msgid ""
2927"connects to the template1 database, which is present in every functioning"
2928msgstr ""
2929
2930msgid "PostgreSQL DBMS."
2931msgstr ""
2932
2933msgid "If a query is specified using the -q option, it will be executed after"
2934msgstr ""
2935
2936msgid "connecting to the server. The result from the query has to be numeric."
2937msgstr ""
2938
2939msgid ""
2940"Multiple SQL commands, separated by semicolon, are allowed but the result "
2941msgstr ""
2942
2943msgid "of the last command is taken into account only. The value of the first"
2944msgstr ""
2945
2946msgid ""
2947"column in the first row is used as the check result. If a second column is"
2948msgstr ""
2949
2950msgid "present in the result set, this is added to the plugin output with a"
2951msgstr ""
2952
2953msgid ""
2954"prefix of \"Extra Info:\". This information can be displayed in the system"
2955msgstr ""
2956
2957msgid "executing the plugin."
2958msgstr ""
2959
2960msgid ""
2961"See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"
2962msgstr ""
2963
2964msgid ""
2965"for details about how to access internal statistics of the database server."
2966msgstr ""
2967
2968msgid ""
2969"For a list of available connection parameters which may be used with the -o"
2970msgstr ""
2971
2972msgid ""
2973"command line option, see the documentation for PQconnectdb() in the chapter"
2974msgstr ""
2975
2976msgid ""
2977"\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"
2978msgstr ""
2979
2980msgid ""
2981"used to specify a service name in pg_service.conf to be used for additional"
2982msgstr ""
2983
2984msgid "connection parameters: -o 'service=<name>' or to specify the SSL mode:"
2985msgstr ""
2986
2987msgid "-o 'sslmode=require'."
2988msgstr ""
2989
2990msgid ""
2991"The plugin will connect to a local postmaster if no host is specified. To"
2992msgstr ""
2993"Ce plugin va se connecter sur un postmaster local si aucun hôte n'est "
2994"spécifié."
2995
2996msgid ""
2997"connect to a remote host, be sure that the remote postmaster accepts TCP/IP"
2998msgstr ""
2999
3000msgid "connections (start the postmaster with the -i option)."
3001msgstr ""
3002
3003msgid ""
3004"Typically, the monitoring user (unless the --logname option is used) should "
3005"be"
3006msgstr ""
3007
3008msgid ""
3009"able to connect to the database without a password. The plugin can also send"
3010msgstr ""
3011
3012msgid "a password, but no effort is made to obscure or encrypt the password."
3013msgstr ""
3014
3015#, c-format
3016msgid "QUERY %s - %s: %s.\n"
3017msgstr ""
3018
3019msgid "Error with query"
3020msgstr ""
3021
3022#, fuzzy
3023msgid "No rows returned"
3024msgstr "Pas de données valides reçues"
3025
3026#, fuzzy
3027msgid "No columns returned"
3028msgstr "Pas de données valides reçues"
3029
3030#, fuzzy
3031msgid "No data returned"
3032msgstr "Pas de données valides reçues"
3033
3034msgid "Is not a numeric"
3035msgstr ""
3036
3037#, fuzzy, c-format
3038msgid "%s returned %f"
3039msgstr ". %s renvoie %s"
3040
3041#, fuzzy, c-format
3042msgid "'%s' returned %f"
3043msgstr ". %s renvoie %s"
3044
3045msgid "CRITICAL - Could not interpret output from ping command\n"
3046msgstr "CRITIQUE - Impossible d'interpréter le réponse de la commande ping\n"
3047
3048#, c-format
3049msgid "PING %s - %sPacket loss = %d%%"
3050msgstr "PING %s - %s Paquets perdus = %d%%"
3051
3052#, c-format
3053msgid "PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"
3054msgstr "PING %s - %s Paquets perdus = %d%%, RTA = %2.2f ms"
3055
3056msgid "Could not realloc() addresses\n"
3057msgstr "Impossible de réallouer les adresses\n"
3058
3059#, c-format
3060msgid "<max_packets> (%s) must be a non-negative number\n"
3061msgstr "<max_packets> (%s) doit être un nombre positif\n"
3062
3063#, c-format
3064msgid "<wpl> (%s) must be an integer percentage\n"
3065msgstr "<wpl> (%s) doit être un pourcentage entier\n"
3066
3067#, c-format
3068msgid "<cpl> (%s) must be an integer percentage\n"
3069msgstr "<cpl> (%s) doit être un pourcentage entier\n"
3070
3071#, c-format
3072msgid "<wrta> (%s) must be a non-negative number\n"
3073msgstr "<wrta> (%s) doit être un nombre positif\n"
3074
3075#, c-format
3076msgid "<crta> (%s) must be a non-negative number\n"
3077msgstr "<crta> (%s) doit être un nombre positif\n"
3078
3079#, c-format
3080msgid ""
3081"%s: Warning threshold must be integer or percentage!\n"
3082"\n"
3083msgstr "%s: Le seuil d'avertissement doit être un entier ou un pourcentage!\n"
3084
3085#, c-format
3086msgid "<wrta> was not set\n"
3087msgstr "<wrta> n'a pas été indiqué\n"
3088
3089#, c-format
3090msgid "<crta> was not set\n"
3091msgstr "<crta> n'a pas été indiqué\n"
3092
3093#, c-format
3094msgid "<wpl> was not set\n"
3095msgstr " <wpl> n'a pas été indiqué\n"
3096
3097#, c-format
3098msgid "<cpl> was not set\n"
3099msgstr "<cpl> n'a pas été indiqué\n"
3100
3101#, c-format
3102msgid "<wrta> (%f) cannot be larger than <crta> (%f)\n"
3103msgstr "<wrta> (%f) ne peut pas être plus large que <crta> (%f)\n"
3104
3105#, c-format
3106msgid "<wpl> (%d) cannot be larger than <cpl> (%d)\n"
3107msgstr "<wpl> (%d) ne peut pas être plus large que <cpl> (%d)\n"
3108
3109#, c-format
3110msgid "Cannot open stderr for %s\n"
3111msgstr "Impossible d'ouvrir le canal d'erreur standard pour %s\n"
3112
3113msgid "System call sent warnings to stderr "
3114msgstr ""
3115"Les appel système enverront leurs messages d'avertissement vers le canal "
3116"d'erreur standard"
3117
3118#, fuzzy, c-format
3119msgid "CRITICAL - Network Unreachable (%s)\n"
3120msgstr "CRITIQUE - Le réseau est inaccessible (%s)"
3121
3122#, fuzzy, c-format
3123msgid "CRITICAL - Host Unreachable (%s)\n"
3124msgstr "CRITIQUE - Hôte inaccessible (%s)"
3125
3126#, fuzzy, c-format
3127msgid "CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"
3128msgstr "CRITIQUE - Paquet ICMP incorrect: Port inaccessible (%s)"
3129
3130#, fuzzy, c-format
3131msgid "CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"
3132msgstr "CRITIQUE - Paquet ICMP incorrect: Protocole inaccessible (%s)"
3133
3134#, fuzzy, c-format
3135msgid "CRITICAL - Network Prohibited (%s)\n"
3136msgstr "CRITIQUE - L'accès au réseau est interdit (%s)"
3137
3138#, fuzzy, c-format
3139msgid "CRITICAL - Host Prohibited (%s)\n"
3140msgstr "CRITIQUE - L'accès a l'hôte est interdit (%s)"
3141
3142#, fuzzy, c-format
3143msgid "CRITICAL - Packet Filtered (%s)\n"
3144msgstr "CRITIQUE - Paquet filtré (%s)"
3145
3146#, fuzzy, c-format
3147msgid "CRITICAL - Host not found (%s)\n"
3148msgstr "CRITIQUE - Hôte non trouvé (%s)"
3149
3150#, fuzzy, c-format
3151msgid "CRITICAL - Time to live exceeded (%s)\n"
3152msgstr "CRITIQUE - La durée de vie du paquet est dépassée (%s)"
3153
3154#, fuzzy, c-format
3155msgid "CRITICAL - Destination Unreachable (%s)\n"
3156msgstr "CRITIQUE - Hôte inaccessible (%s)"
3157
3158#, fuzzy
3159msgid "Unable to realloc warn_text\n"
3160msgstr "Impossible de réattribuer le texte d'avertissement"
3161
3162#, c-format
3163msgid "Use ping to check connection statistics for a remote host."
3164msgstr ""
3165"Utilise ping pour vérifier les statistiques de connections d'un hôte distant."
3166
3167msgid "host to ping"
3168msgstr "hôte à tester"
3169
3170msgid "number of ICMP ECHO packets to send"
3171msgstr "nombre de paquets ICMP à envoyer"
3172
3173#, c-format
3174msgid "(Default: %d)\n"
3175msgstr "(Défaut: %d)\n"
3176
3177msgid "show HTML in the plugin output (obsoleted by urlize)"
3178msgstr ""
3179
3180msgid "THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"
3181msgstr ""
3182"Le seuil est <rta>,<pl>% où <rta> est le temps moyen pour l'aller retour (ms)"
3183
3184msgid "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"
3185msgstr "qui déclenche un résultat AVERTISSEMENT ou CRITIQUE, et <pl> est le "
3186
3187msgid "percentage of packet loss to trigger an alarm state."
3188msgstr "pourcentage de paquets perdus pour déclencher une alarme."
3189
3190msgid ""
3191"This plugin uses the ping command to probe the specified host for packet loss"
3192msgstr ""
3193"Ce plugin utilise la commande ping pour vérifier l'hôte spécifié pour les "
3194"pertes de paquets"
3195
3196msgid ""
3197"(percentage) and round trip average (milliseconds). It can produce HTML "
3198"output"
3199msgstr ""
3200
3201msgid ""
3202"linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"
3203msgstr ""
3204
3205msgid "the contrib area of the downloads section at http://www.nagios.org/"
3206msgstr ""
3207
3208#, c-format
3209msgid "CMD: %s\n"
3210msgstr "Commande: %s\n"
3211
3212msgid "System call sent warnings to stderr"
3213msgstr ""
3214"L'appel système à retourné des avertissement vers le canal d'erreur standard"
3215
3216#, c-format
3217msgid "Not parseable: %s"
3218msgstr "Impossible de parcourir les arguments: %s"
3219
3220#, c-format
3221msgid "Unable to read output\n"
3222msgstr "Impossible de lire les données en entrée\n"
3223
3224#, c-format
3225msgid "%d warn out of "
3226msgstr "%d avertissements sur"
3227
3228#, c-format
3229msgid "%d crit, %d warn out of "
3230msgstr "%d crit, %d alertes sur "
3231
3232#, c-format
3233msgid " with %s"
3234msgstr " avec %s"
3235
3236msgid "Parent Process ID must be an integer!"
3237msgstr "L'identifiant du processus parent doit être un entier!"
3238
3239#, c-format
3240msgid "%s%sSTATE = %s"
3241msgstr "%s%sETAT = %s"
3242
3243msgid "UID was not found"
3244msgstr "L'UID n'a pas été trouvé"
3245
3246msgid "User name was not found"
3247msgstr "L'utilisateur n'a pas été trouvé"
3248
3249#, c-format
3250msgid "%s%scommand name '%s'"
3251msgstr "%s%snom de la commande '%s'"
3252
3253#, c-format
3254msgid "%s%sexclude progs '%s'"
3255msgstr ""
3256
3257msgid "RSS must be an integer!"
3258msgstr "RSS doit être un entier!"
3259
3260msgid "VSZ must be an integer!"
3261msgstr "VSZ doit être un entier!"
3262
3263msgid "PCPU must be a float!"
3264msgstr "PCPU doit être un nombre en virgule flottante!"
3265
3266msgid "Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"
3267msgstr "Metric doit être l'un des PROCS, VSZ, RSS, CPU, ELAPSED!"
3268
3269msgid ""
3270"Checks all processes and generates WARNING or CRITICAL states if the "
3271"specified"
3272msgstr ""
3273
3274msgid ""
3275"metric is outside the required threshold ranges. The metric defaults to "
3276"number"
3277msgstr ""
3278
3279msgid ""
3280"of processes. Search filters can be applied to limit the processes to check."
3281msgstr ""
3282
3283msgid "Generate warning state if metric is outside this range"
3284msgstr ""
3285
3286msgid "Generate critical state if metric is outside this range"
3287msgstr ""
3288
3289msgid "Check thresholds against metric. Valid types:"
3290msgstr ""
3291
3292msgid "PROCS - number of processes (default)"
3293msgstr "PROCS - nombre de processus (défaut)"
3294
3295msgid "VSZ - virtual memory size"
3296msgstr "VSZ - taille mémoire virtuelle"
3297
3298msgid "RSS - resident set memory size"
3299msgstr ""
3300
3301msgid "CPU - percentage CPU"
3302msgstr "CPU - pourcentage du processeur"
3303
3304msgid "ELAPSED - time elapsed in seconds"
3305msgstr "ELAPSED - temps écoulé en secondes"
3306
3307msgid "Extra information. Up to 3 verbosity levels"
3308msgstr "informations supplémentaires. Jusqu'à 3 niveaux de verbosité"
3309
3310msgid "Filter own process the traditional way by PID instead of /proc/pid/exe"
3311msgstr ""
3312
3313msgid "Only scan for processes that have, in the output of `ps`, one or"
3314msgstr ""
3315
3316msgid "more of the status flags you specify (for example R, Z, S, RS,"
3317msgstr ""
3318
3319msgid "RSZDT, plus others based on the output of your 'ps' command)."
3320msgstr ""
3321
3322msgid "Only scan for children of the parent process ID indicated."
3323msgstr ""
3324
3325msgid "Only scan for processes with VSZ higher than indicated."
3326msgstr ""
3327
3328msgid "Only scan for processes with RSS higher than indicated."
3329msgstr ""
3330
3331msgid "Only scan for processes with PCPU higher than indicated."
3332msgstr ""
3333
3334msgid "Only scan for processes with user name or ID indicated."
3335msgstr ""
3336
3337msgid "Only scan for processes with args that contain STRING."
3338msgstr ""
3339
3340msgid "Only scan for processes with args that contain the regex STRING."
3341msgstr ""
3342
3343msgid "Only scan for exact matches of COMMAND (without path)."
3344msgstr ""
3345
3346msgid "Exclude processes which match this comma separated list"
3347msgstr ""
3348
3349msgid "Only scan for non kernel threads (works on Linux only)."
3350msgstr ""
3351
3352#, c-format
3353msgid ""
3354"\n"
3355"RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n"
3356"specified 'max:min', a warning status will be generated if the\n"
3357"count is inside the specified range\n"
3358"\n"
3359msgstr ""
3360"\n"
3361"Les seuils sont spécifiés 'min:max' or 'min:' or ':max' (or 'max').\n"
3362"Si spécifié 'max:min', un avertissement sera généré si le nombre\n"
3363"est à l'intérieur du seuil\n"
3364"\n"
3365
3366#, c-format
3367msgid ""
3368"This plugin checks the number of currently running processes and\n"
3369"generates WARNING or CRITICAL states if the process count is outside\n"
3370"the specified threshold ranges. The process count can be filtered by\n"
3371"process owner, parent process PID, current state (e.g., 'Z'), or may\n"
3372"be the total number of running processes\n"
3373"\n"
3374msgstr ""
3375"Ce plugin vérifie le nombre de processus actifs et génère un résultat \n"
3376"AVERTISSEMENT ou CRITIQUE si le nombre de processus est au dessus du seuil\n"
3377"spécifié. Le total des processus peut être filtré par propriétaire, "
3378"processus parent,\n"
3379"état actuel (ex: 'Z'), ou par le nombre de processus en cours d'exécution\n"
3380"\n"
3381
3382msgid "Warning if not two processes with command name portsentry."
3383msgstr ""
3384
3385msgid "Critical if < 2 or > 1024 processes"
3386msgstr ""
3387
3388msgid "Critical if not at least 1 process with command sshd"
3389msgstr ""
3390
3391msgid "Warning if > 1024 processes with command name sshd."
3392msgstr ""
3393
3394msgid "Critical if < 1 processes with command name sshd."
3395msgstr ""
3396
3397msgid "Warning alert if > 10 processes with command arguments containing"
3398msgstr ""
3399
3400msgid "'/usr/local/bin/perl' and owned by root"
3401msgstr ""
3402
3403msgid "Alert if VSZ of any processes over 50K or 100K"
3404msgstr ""
3405
3406msgid "Alert if CPU of any processes over 10% or 20%"
3407msgstr ""
3408
3409#, fuzzy
3410msgid "Config file error\n"
3411msgstr "Erreur dans le fichier de configuration"
3412
3413#, fuzzy
3414msgid "Out of Memory?\n"
3415msgstr "Manque de Mémoire?"
3416
3417#, fuzzy
3418msgid "Invalid NAS-Identifier\n"
3419msgstr "NAS-Identifier invalide"
3420
3421#, c-format
3422msgid "gethostname() failed!\n"
3423msgstr "La commande gethostname() à échoué\n"
3424
3425#, fuzzy
3426msgid "Invalid NAS-IP-Address\n"
3427msgstr "NAS-IP-Address invalide"
3428
3429#, fuzzy
3430msgid "Timeout\n"
3431msgstr "Temps dépassé"
3432
3433#, fuzzy
3434msgid "Auth Error\n"
3435msgstr "Erreur d'authentification"
3436
3437#, fuzzy
3438msgid "Auth Failed\n"
3439msgstr "L'authentification à échoué"
3440
3441#, fuzzy
3442msgid "Bad Response\n"
3443msgstr "Réponse invalide"
3444
3445#, fuzzy
3446msgid "Auth OK\n"
3447msgstr "L'authentification à réussi"
3448
3449#, c-format
3450msgid "Unexpected result code %d"
3451msgstr "Résultat inattendu: %d"
3452
3453msgid "Number of retries must be a positive integer"
3454msgstr "Le nombre d'essai doit être un entier positif"
3455
3456msgid "User not specified"
3457msgstr "L'utilisateur n'a pas été spécifié"
3458
3459msgid "Password not specified"
3460msgstr "Le mot de passe n'a pas été spécifié"
3461
3462msgid "Configuration file not specified"
3463msgstr "Le fichier de configuration n'a pas été spécifié"
3464
3465msgid "Tests to see if a RADIUS server is accepting connections."
3466msgstr "Teste si un serveur RADIUS accepte les connections."
3467
3468msgid "The user to authenticate"
3469msgstr ""
3470
3471msgid "Password for authentication (SECURITY RISK)"
3472msgstr ""
3473
3474msgid "NAS identifier"
3475msgstr ""
3476
3477msgid "NAS IP Address"
3478msgstr "Adresse IP NAS"
3479
3480msgid "Configuration file"
3481msgstr "Fichier de configuration"
3482
3483msgid "Response string to expect from the server"
3484msgstr ""
3485
3486msgid "Number of times to retry a failed connection"
3487msgstr ""
3488
3489msgid ""
3490"This plugin tests a RADIUS server to see if it is accepting connections."
3491msgstr ""
3492"Ce plugin teste un serveur RADIUS afin de vérifier si il accepte les "
3493"connections."
3494
3495msgid ""
3496"The server to test must be specified in the invocation, as well as a user"
3497msgstr ""
3498
3499msgid "name and password. A configuration file must be present. The format of"
3500msgstr ""
3501
3502msgid ""
3503"the configuration file is described in the radiusclient library sources."
3504msgstr ""
3505
3506msgid "The password option presents a substantial security issue because the"
3507msgstr ""
3508
3509msgid ""
3510"password can possibly be determined by careful watching of the command line"
3511msgstr ""
3512
3513msgid "in a process listing. This risk is exacerbated because the plugin will"
3514msgstr ""
3515
3516msgid ""
3517"typically be executed at regular predictable intervals. Please be sure that"
3518msgstr ""
3519
3520msgid "the password used does not allow access to sensitive system resources."
3521msgstr ""
3522
3523#, c-format
3524msgid "Unable to connect to %s on port %d\n"
3525msgstr "Impossible de se connecter à %s sur le port %d\n"
3526
3527#, c-format
3528msgid "No data received from %s\n"
3529msgstr "Pas de données reçues de %s\n"
3530
3531msgid "Invalid REAL response received from host"
3532msgstr "Réponses REAL invalide reçue de l'hôte"
3533
3534#, c-format
3535msgid "Invalid REAL response received from host on port %d\n"
3536msgstr "Réponses REAL invalide reçue de l'hôte sur le port %d\n"
3537
3538#, c-format
3539msgid "No data received from host\n"
3540msgstr "Pas de données reçues de l'hôte\n"
3541
3542#, c-format
3543msgid "REAL %s - %d second response time\n"
3544msgstr "REAL %s - %d secondes de temps de réponse\n"
3545
3546msgid "Warning time must be a positive integer"
3547msgstr "Le seuil d'avertissement doit être un entier positif"
3548
3549msgid "Critical time must be a positive integer"
3550msgstr "Le seuil critique doit être un entier positif"
3551
3552msgid "You must provide a server to check"
3553msgstr "Vous devez fournir un serveur à vérifier"
3554
3555msgid "This plugin tests the REAL service on the specified host."
3556msgstr "Ce plugin teste le service REAL sur l'hôte spécifié."
3557
3558msgid "Connect to this url"
3559msgstr ""
3560
3561#, c-format
3562msgid "String to expect in first line of server response (default: %s)\n"
3563msgstr ""
3564"Texte attendu dans la première ligne de réponse du serveur (défaut: %s)\n"
3565
3566msgid "This plugin will attempt to open an RTSP connection with the host."
3567msgstr "Ce plugin va essayer d'ouvrir un connexion RTSP avec l'hôte."
3568
3569msgid "Successful connects return STATE_OK, refusals and timeouts return"
3570msgstr ""
3571
3572msgid ""
3573"STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"
3574msgstr ""
3575
3576msgid ""
3577"but incorrect response messages from the host result in STATE_WARNING return"
3578msgstr ""
3579
3580msgid "values."
3581msgstr ""
3582
3583#, c-format
3584msgid "malloc() failed!\n"
3585msgstr "l'allocation mémoire à échoué!\n"
3586
3587#, c-format
3588msgid "CRITICAL - Cannot create SSL context.\n"
3589msgstr "CRITIQUE - Impossible de créer le contexte SSL.\n"
3590
3591#, c-format
3592msgid "recv() failed\n"
3593msgstr "La commande recv() à échoué\n"
3594
3595#, c-format
3596msgid "WARNING - TLS not supported by server\n"
3597msgstr "AVERTISSEMENT: - TLS n'est pas supporté par ce serveur\n"
3598
3599#, c-format
3600msgid "Server does not support STARTTLS\n"
3601msgstr "Le serveur ne supporte pas STARTTLS\n"
3602
3603msgid "SMTP UNKNOWN - Cannot send EHLO command via TLS."
3604msgstr ""
3605
3606#, c-format
3607msgid "sent %s"
3608msgstr "envoyé %s"
3609
3610msgid "SMTP UNKNOWN - Cannot read EHLO response via TLS."
3611msgstr ""
3612
3613#, c-format
3614msgid "Invalid SMTP response received from host: %s\n"
3615msgstr "Réponse SMTP reçue de l'hôte invalide: %s\n"
3616
3617#, c-format
3618msgid "Invalid SMTP response received from host on port %d: %s\n"
3619msgstr "Réponse SMTP reçue de l'hôte sur le port %d invalide: %s\n"
3620
3621#, c-format
3622msgid "Could Not Compile Regular Expression"
3623msgstr "Impossible de compiler l'expression rationnelle"
3624
3625#, c-format
3626msgid "SMTP %s - Invalid response '%s' to command '%s'\n"
3627msgstr "SMTP %s - réponse invalide de '%s' à la commande '%s'\n"
3628
3629#, c-format
3630msgid "Execute Error: %s\n"
3631msgstr "Erreur d'exécution: %s\n"
3632
3633msgid "no authuser specified, "
3634msgstr "Pas d'utilisateur pour l'authentification spécifié, "
3635
3636msgid "no authpass specified, "
3637msgstr "pas de mot de passe spécifié, "
3638
3639#, c-format
3640msgid "sent %s\n"
3641msgstr "envoyé %s\n"
3642
3643msgid "recv() failed after AUTH LOGIN, "
3644msgstr "recv() à échoué après AUTH LOGIN, "
3645
3646#, c-format
3647msgid "received %s\n"
3648msgstr "reçu %s\n"
3649
3650msgid "invalid response received after AUTH LOGIN, "
3651msgstr "Réponse invalide reçue après AUTH LOGIN, "
3652
3653msgid "recv() failed after sending authuser, "
3654msgstr "La commande recv() a échoué après authuser, "
3655
3656msgid "invalid response received after authuser, "
3657msgstr "Réponse invalide reçue après authuser, "
3658
3659msgid "recv() failed after sending authpass, "
3660msgstr "la commande recv() à échoué après authpass, "
3661
3662msgid "invalid response received after authpass, "
3663msgstr "Réponse invalide reçue après authpass, "
3664
3665msgid "only authtype LOGIN is supported, "
3666msgstr "seul la méthode d'authentification LOGIN est supportée, "
3667
3668#, c-format
3669msgid "SMTP %s - %s%.3f sec. response time%s%s|%s\n"
3670msgstr "SMTP %s - %s%.3f sec. de temps de réponse%s%s|%s\n"
3671
3672#, c-format
3673msgid "Could not realloc() units [%d]\n"
3674msgstr "Impossible de réallouer des unités [%d]\n"
3675
3676#, fuzzy
3677msgid "Critical time must be a positive"
3678msgstr "Le seuil critique doit être un entier positif"
3679
3680#, fuzzy
3681msgid "Warning time must be a positive"
3682msgstr "Le seuil d'avertissement doit être un entier positif"
3683
3684msgid "SSL support not available - install OpenSSL and recompile"
3685msgstr "SSL n'est pas disponible - installer OpenSSL et recompilez"
3686
3687msgid "Set either -s/--ssl/--tls or -S/--starttls"
3688msgstr "Définissez -s/--ssl/--tls ou -S/--starttls"
3689
3690#, c-format
3691msgid "Connection closed by server before sending QUIT command\n"
3692msgstr ""
3693
3694#, c-format
3695msgid "recv() failed after QUIT."
3696msgstr "recv() à échoué après QUIT."
3697
3698#, c-format
3699msgid "Connection reset by peer."
3700msgstr ""
3701
3702msgid "This plugin will attempt to open an SMTP connection with the host."
3703msgstr "Ce plugin va essayer d'ouvrir un connexion SMTP avec l'hôte."
3704
3705#, c-format
3706msgid " String to expect in first line of server response (default: '%s')\n"
3707msgstr ""
3708" Texte attendu dans la première ligne de réponse du serveur (défaut: "
3709"'%s')\n"
3710
3711msgid "SMTP command (may be used repeatedly)"
3712msgstr "Commande SMTP (peut être utilisé plusieurs fois)"
3713
3714msgid "Expected response to command (may be used repeatedly)"
3715msgstr ""
3716
3717msgid "FROM-address to include in MAIL command, required by Exchange 2000"
3718msgstr ""
3719
3720msgid "FQDN used for HELO"
3721msgstr ""
3722
3723msgid "Use PROXY protocol prefix for the connection."
3724msgstr "Utiliser le préfixe du protocole PROXY pour la connexion."
3725
3726msgid "Minimum number of days a certificate has to be valid."
3727msgstr "Nombre de jours minimum pour que le certificat soit valide."
3728
3729#, fuzzy
3730msgid "Use SSL/TLS for the connection."
3731msgstr "Utiliser SSL/TLS pour la connexion."
3732
3733#, c-format
3734msgid " Sets default port to %d.\n"
3735msgstr " Définit le port par défaut à %d.\n"
3736
3737msgid "Use STARTTLS for the connection."
3738msgstr "Utiliser STARTTLS pour la connexion."
3739
3740msgid "SMTP AUTH type to check (default none, only LOGIN supported)"
3741msgstr ""
3742
3743msgid "SMTP AUTH username"
3744msgstr ""
3745
3746msgid "SMTP AUTH password"
3747msgstr ""
3748
3749msgid "Send LHLO instead of HELO/EHLO"
3750msgstr ""
3751
3752msgid "Ignore failure when sending QUIT command to server"
3753msgstr ""
3754
3755msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"
3756msgstr ""
3757
3758msgid "connects, but incorrect response messages from the host result in"
3759msgstr ""
3760
3761msgid "STATE_WARNING return values."
3762msgstr ""
3763
3764msgid "Cannot malloc"
3765msgstr ""
3766
3767#, c-format
3768msgid "External command error: %s\n"
3769msgstr "Erreur d'exécution de commande externe: %s\n"
3770
3771#, c-format
3772msgid "External command error with no output (return code: %d)\n"
3773msgstr ""
3774
3775#, fuzzy, c-format
3776msgid "No valid data returned (%s)\n"
3777msgstr "Pas de données valides reçues"
3778
3779msgid "Time duration between plugin calls is invalid"
3780msgstr ""
3781
3782msgid "Cannot asprintf()"
3783msgstr ""
3784
3785#, fuzzy
3786msgid "Cannot realloc()"
3787msgstr "Impossible de réallouer des unités\n"
3788
3789msgid "No previous data to calculate rate - assume okay"
3790msgstr ""
3791
3792msgid "Retries interval must be a positive integer"
3793msgstr "L'intervalle pour les essais doit être un entier positif"
3794
3795#, fuzzy
3796msgid "Exit status must be a positive integer"
3797msgstr "Maxbytes doit être un entier positif"
3798
3799#, c-format
3800msgid "Could not reallocate labels[%d]"
3801msgstr "Impossible de réallouer des labels[%d]"
3802
3803msgid "Could not reallocate labels\n"
3804msgstr "Impossible de réallouer des labels\n"
3805
3806#, c-format
3807msgid "Could not reallocate units [%d]\n"
3808msgstr "Impossible de réallouer des unités [%d]\n"
3809
3810msgid "Could not realloc() units\n"
3811msgstr "Impossible de réallouer des unités\n"
3812
3813#, fuzzy
3814msgid "Rate multiplier must be a positive integer"
3815msgstr "La taille du paquet doit être un entier positif"
3816
3817msgid "No host specified\n"
3818msgstr "Pas d'hôte spécifié\n"
3819
3820msgid "No OIDs specified\n"
3821msgstr "Pas de compteur spécifié\n"
3822
3823#, c-format
3824msgid "Required parameter: %s\n"
3825msgstr ""
3826
3827msgid "Invalid seclevel"
3828msgstr ""
3829
3830msgid "Invalid SNMP version"
3831msgstr "Version de SNMP invalide"
3832
3833msgid "Unbalanced quotes\n"
3834msgstr "Guillemets manquants\n"
3835
3836#, c-format
3837msgid "multiplier set (%.1f), but input is not a number: %s"
3838msgstr ""
3839
3840msgid "Check status of remote machines and obtain system information via SNMP"
3841msgstr ""
3842"Vérifie l'état des machines distantes et obtient l'information système via "
3843"SNMP"
3844
3845msgid "Use SNMP GETNEXT instead of SNMP GET"
3846msgstr "Utiliser SNMP GETNEXT au lieu de SNMP GET"
3847
3848msgid "SNMP protocol version"
3849msgstr "Version du protocole SNMP"
3850
3851#, fuzzy
3852msgid "SNMPv3 context"
3853msgstr "Nom d'utilisateur SNMPv3"
3854
3855msgid "SNMPv3 securityLevel"
3856msgstr "Niveau de sécurité SNMPv3 (securityLevel)"
3857
3858msgid "SNMPv3 auth proto"
3859msgstr "Protocole d'authentification SNMPv3"
3860
3861msgid "SNMPv3 priv proto (default DES)"
3862msgstr ""
3863
3864msgid "Optional community string for SNMP communication"
3865msgstr "Communauté optionnelle pour la communication SNMP"
3866
3867msgid "default is"
3868msgstr "défaut:"
3869
3870msgid "SNMPv3 username"
3871msgstr "Nom d'utilisateur SNMPv3"
3872
3873msgid "SNMPv3 authentication password"
3874msgstr "Mot de passe d'authentification SNMPv3"
3875
3876msgid "SNMPv3 privacy password"
3877msgstr "Mot de passe de confidentialité SNMPv3"
3878
3879msgid "Object identifier(s) or SNMP variables whose value you wish to query"
3880msgstr ""
3881
3882msgid ""
3883"List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"
3884msgstr ""
3885
3886msgid "for symbolic OIDs.)"
3887msgstr ""
3888
3889msgid "Delimiter to use when parsing returned data. Default is"
3890msgstr ""
3891
3892msgid "Any data on the right hand side of the delimiter is considered"
3893msgstr ""
3894
3895msgid "to be the data that should be used in the evaluation."
3896msgstr ""
3897
3898msgid "If the check returns a 0 length string or NULL value"
3899msgstr ""
3900
3901msgid "This option allows you to choose what status you want it to exit"
3902msgstr ""
3903
3904msgid "Excluding this option renders the default exit of 3(STATE_UNKNOWN)"
3905msgstr ""
3906
3907msgid "0 = OK"
3908msgstr ""
3909
3910#, fuzzy
3911msgid "1 = WARNING"
3912msgstr "AVERTISSEMENT"
3913
3914#, fuzzy
3915msgid "2 = CRITICAL"
3916msgstr "CRITIQUE"
3917
3918#, fuzzy
3919msgid "3 = UNKNOWN"
3920msgstr "INCONNU"
3921
3922msgid "Warning threshold range(s)"
3923msgstr "Valeurs pour le seuil d'avertissement"
3924
3925msgid "Critical threshold range(s)"
3926msgstr "Valeurs pour le seuil critique"
3927
3928msgid "Enable rate calculation. See 'Rate Calculation' below"
3929msgstr ""
3930
3931msgid ""
3932"Converts rate per second. For example, set to 60 to convert to per minute"
3933msgstr ""
3934
3935msgid "Add/subtract the specified OFFSET to numeric sensor data"
3936msgstr ""
3937
3938msgid "Return OK state (for that OID) if STRING is an exact match"
3939msgstr ""
3940
3941msgid ""
3942"Return OK state (for that OID) if extended regular expression REGEX matches"
3943msgstr ""
3944
3945msgid ""
3946"Return OK state (for that OID) if case-insensitive extended REGEX matches"
3947msgstr ""
3948
3949msgid "Invert search result (CRITICAL if found)"
3950msgstr ""
3951
3952msgid "Prefix label for output from plugin"
3953msgstr ""
3954
3955msgid "Units label(s) for output data (e.g., 'sec.')."
3956msgstr ""
3957
3958msgid "Separates output on multiple OID requests"
3959msgstr ""
3960
3961msgid "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
3962msgstr ""
3963
3964msgid "C-style format string for float values (see option -M)"
3965msgstr ""
3966
3967msgid ""
3968"NOTE the final timeout value is calculated using this formula: "
3969"timeout_interval * retries + 5"
3970msgstr ""
3971
3972#, fuzzy
3973msgid "Number of retries to be used in the requests, default: "
3974msgstr "Le nombre d'essai pour les requêtes"
3975
3976msgid "Label performance data with OIDs instead of --label's"
3977msgstr ""
3978
3979msgid "Tell snmpget to not print errors encountered when parsing MIB files"
3980msgstr ""
3981
3982msgid ""
3983"This plugin uses the 'snmpget' command included with the NET-SNMP package."
3984msgstr ""
3985
3986msgid ""
3987"if you don't have the package installed, you will need to download it from"
3988msgstr ""
3989"Si vous n'avez pas le programme installé, vous devrez le télécharger depuis"
3990
3991msgid "http://net-snmp.sourceforge.net before you can use this plugin."
3992msgstr "http://net-snmp.sourceforge.net avant de pouvoir utiliser ce plugin."
3993
3994#, fuzzy
3995msgid ""
3996"- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "
3997msgstr ""
3998"- Des OIDs multiples peuvent être séparées par des virgules ou des espaces"
3999
4000#, fuzzy
4001msgid "list (lists with internal spaces must be quoted)."
4002msgstr "(Les liste avec espaces doivent être entre guillemets). Max:"
4003
4004msgid ""
4005"- When checking multiple OIDs, separate ranges by commas like '-w "
4006"1:10,1:,:20'"
4007msgstr ""
4008
4009msgid "- Note that only one string and one regex may be checked at present"
4010msgstr ""
4011
4012msgid ""
4013"- All evaluation methods other than PR, STR, and SUBSTR expect that the value"
4014msgstr ""
4015
4016msgid "returned from the SNMP query is an unsigned integer."
4017msgstr ""
4018
4019msgid "Rate Calculation:"
4020msgstr ""
4021
4022msgid "In many places, SNMP returns counters that are only meaningful when"
4023msgstr ""
4024
4025msgid "calculating the counter difference since the last check. check_snmp"
4026msgstr ""
4027
4028msgid "saves the last state information in a file so that the rate per second"
4029msgstr ""
4030
4031msgid "can be calculated. Use the --rate option to save state information."
4032msgstr ""
4033
4034msgid ""
4035"On the first run, there will be no prior state - this will return with OK."
4036msgstr ""
4037
4038msgid "The state is uniquely determined by the arguments to the plugin, so"
4039msgstr ""
4040
4041msgid "changing the arguments will create a new state file."
4042msgstr ""
4043
4044msgid "Port number must be a positive integer"
4045msgstr "Le numéro du port doit être un nombre entier positif"
4046
4047#, c-format
4048msgid "Server answer: %s"
4049msgstr "Réponse du serveur: %s"
4050
4051#, fuzzy, c-format
4052msgid "SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"
4053msgstr ""
4054"SSH AVERTISSEMENT - %s (protocole %s) différence de version, attendu'%s'\n"
4055
4056#, fuzzy, c-format
4057msgid ""
4058"SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"
4059msgstr ""
4060"SSH AVERTISSEMENT - %s (protocole %s) différence de version, attendu'%s'\n"
4061
4062#, fuzzy, c-format
4063msgid "SSH OK - %s (protocol %s) | %s\n"
4064msgstr "SSH OK - %s (protocole %s)\n"
4065
4066msgid "Try to connect to an SSH server at specified server and port"
4067msgstr "Essaye de se connecter à un serveur SSH précisé à un port précis"
4068
4069#, fuzzy
4070msgid ""
4071"Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
4072msgstr ""
4073"AVERTISSEMENT si la chaîne ne correspond pas à la version précisée (ex: "
4074"OpenSSH_3.9p1)"
4075
4076#, fuzzy
4077msgid "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
4078msgstr ""
4079"AVERTISSEMENT si la chaîne ne correspond pas à la version précisée (ex: "
4080"OpenSSH_3.9p1)"
4081
4082#, c-format
4083msgid "Command: %s\n"
4084msgstr "Commande: %s\n"
4085
4086#, c-format
4087msgid "Format: %s\n"
4088msgstr "Format: %s\n"
4089
4090#, c-format
4091msgid "total=%.0f, used=%.0f, free=%.0f\n"
4092msgstr "total=%.0f, utilisé=%.0f, libre=%.0ff\n"
4093
4094#, c-format
4095msgid "total=%.0f, free=%.0f\n"
4096msgstr "total=%.0f, libre=%.0f\n"
4097
4098msgid "Error getting swap devices\n"
4099msgstr ""
4100
4101msgid "SWAP OK: No swap devices defined\n"
4102msgstr "SWAP OK: Pas de périphériques swap définis\n"
4103
4104msgid "swapctl failed: "
4105msgstr "swapctl à échoué:"
4106
4107msgid "Error in swapctl call\n"
4108msgstr ""
4109
4110#, fuzzy, c-format
4111msgid "SWAP %s - %d%% free (%dMB out of %dMB) %s|"
4112msgstr "SWAP %s - %d%% libre (%d MB sur un total de %d MB) %s|"
4113
4114#, fuzzy
4115msgid "Warning threshold percentage must be <= 100!"
4116msgstr "Le seuil d'avertissement doit être un entier positif"
4117
4118#, fuzzy
4119msgid "Warning threshold be positive integer or percentage!"
4120msgstr "Le seuil d'avertissement doit être un entier ou un pourcentage!"
4121
4122#, fuzzy
4123msgid "Critical threshold percentage must be <= 100!"
4124msgstr "le seuil critique doit être un entier positif"
4125
4126#, fuzzy
4127msgid "Critical threshold be positive integer or percentage!"
4128msgstr "Le seuil critique doit être un entier ou un pourcentage!"
4129
4130#, fuzzy
4131msgid ""
4132"no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
4133"or integer (0-3)."
4134msgstr ""
4135"Le résultat de temps dépassé doit être un nom d'état valide (OK, WARNING, "
4136"CRITICAL, UNKNOWN) ou un nombre entier (0-3)."
4137
4138#, fuzzy
4139msgid "Warning should be more than critical"
4140msgstr ""
4141"Le pourcentage d'avertissement doit être plus important que le pourcentage "
4142"critique"
4143
4144msgid "Check swap space on local machine."
4145msgstr "Vérifie l'espace swap sur la machine locale."
4146
4147msgid ""
4148"Exit with WARNING status if less than INTEGER bytes of swap space are free"
4149msgstr ""
4150"Sortir avec un résultat AVERTISSEMENT si moins de X octets de mémoire "
4151"virtuelle sont libres"
4152
4153msgid "Exit with WARNING status if less than PERCENT of swap space is free"
4154msgstr ""
4155"Sortir avec un résultat AVERTISSEMENT si moins de X pour cent de mémoire "
4156"virtuelle est libre"
4157
4158msgid ""
4159"Exit with CRITICAL status if less than INTEGER bytes of swap space are free"
4160msgstr ""
4161"Sortir avec un résultat CRITIQUE si moins de X octets de mémoire virtuelle "
4162"sont libres"
4163
4164msgid "Exit with CRITICAL status if less than PERCENT of swap space is free"
4165msgstr ""
4166"Sortir avec un résultat CRITIQUE si moins de X pour cent de mémoire "
4167"virtuelle est libre"
4168
4169msgid "Conduct comparisons for all swap partitions, one by one"
4170msgstr "Vérifier chacune des partitions de mémoire virtuelle séparément"
4171
4172msgid ""
4173"Resulting state when there is no swap regardless of thresholds. Default:"
4174msgstr ""
4175
4176#, fuzzy
4177msgid ""
4178"Both INTEGER and PERCENT thresholds can be specified, they are all checked."
4179msgstr "Les seuils d'alerte et critiques peuvent être spécifiés avec -w et -c."
4180
4181msgid "On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."
4182msgstr ""
4183"Sur AIX, si -a est spécifié, le plugin utilise lsps -a, sinon il utilise "
4184"lsps -s."
4185
4186msgid "CRITICAL - Generic check_tcp called with unknown service\n"
4187msgstr ""
4188"CRITIQUE -check_tcp version générique utilisé avec un service inconnu\n"
4189
4190msgid "With UDP checks, a send/expect string must be specified."
4191msgstr ""
4192"Avec la surveillance UDP, une chaîne d'envoi et un chaîne de réponse doit "
4193"être spécifiée."
4194
4195msgid "No arguments found"
4196msgstr "Pas de paramètres"
4197
4198msgid "Maxbytes must be a positive integer"
4199msgstr "Maxbytes doit être un entier positif"
4200
4201msgid "Refuse must be one of ok, warn, crit"
4202msgstr "Refuse doit être parmis ok, warn, crit"
4203
4204msgid "Mismatch must be one of ok, warn, crit"
4205msgstr "Mismatch doit être parmis ok, warn, crit"
4206
4207msgid "Delay must be a positive integer"
4208msgstr "Delay doit être un entier positif"
4209
4210msgid "You must provide a server address"
4211msgstr "Vous devez fournir une adresse serveur"
4212
4213msgid "Invalid hostname, address or socket"
4214msgstr "Adresse/Nom/Socket invalide"
4215
4216#, c-format
4217msgid ""
4218"This plugin tests %s connections with the specified host (or unix socket).\n"
4219"\n"
4220msgstr ""
4221"Ce plugin teste %s connections avec l'hôte spécifié (ou socket unix).\n"
4222"\n"
4223
4224#, fuzzy
4225msgid ""
4226"Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send "
4227"or quit option"
4228msgstr ""
4229"Permet d'utiliser \\n, \\r, \\t ou \\ dans la chaîne de caractères send ou "
4230"quit. Doit être placé avant ces dernières."
4231
4232msgid "Default: nothing added to send, \\r\\n added to end of quit"
4233msgstr ""
4234"Par défaut: Rien n'est ajouté à send, \\r\\n est ajouté à la fin de quit"
4235
4236msgid "String to send to the server"
4237msgstr "Chaîne de caractères à envoyer au serveur"
4238
4239msgid "String to expect in server response"
4240msgstr "Chaîne de caractères à attendre en réponse"
4241
4242msgid "(may be repeated)"
4243msgstr "(peut être utilisé plusieurs fois)"
4244
4245msgid "All expect strings need to occur in server response. Default is any"
4246msgstr ""
4247"Toutes les chaînes attendus (expect) doivent être repérés dans la réponse. "
4248"Par défaut, n'importe laquelle suffit."
4249
4250msgid "String to send server to initiate a clean close of the connection"
4251msgstr "Chaîne de caractères à envoyer pour fermer gracieusement la connection"
4252
4253msgid "Accept TCP refusals with states ok, warn, crit (default: crit)"
4254msgstr ""
4255
4256msgid ""
4257"Accept expected string mismatches with states ok, warn, crit (default: warn)"
4258msgstr ""
4259
4260msgid "Hide output from TCP socket"
4261msgstr "Cacher la réponse provenant du socket TCP"
4262
4263msgid "Close connection once more than this number of bytes are received"
4264msgstr ""
4265
4266msgid "Seconds to wait between sending string and polling for response"
4267msgstr ""
4268
4269msgid "1st is #days for warning, 2nd is critical (if not specified - 0)."
4270msgstr ""
4271
4272msgid "Use SSL for the connection."
4273msgstr ""
4274
4275#, fuzzy
4276msgid "SSL server_name"
4277msgstr "Nom d'utilisateur SNMPv3"
4278
4279#, c-format
4280msgid "TIME UNKNOWN - could not connect to server %s, port %d\n"
4281msgstr "TEMPS INCONNU - impossible de se connecter au serveur %s, au port %d\n"
4282
4283#, c-format
4284msgid "TIME UNKNOWN - could not send UDP request to server %s, port %d\n"
4285msgstr ""
4286"TEMPS INCONNU - impossible d'envoyer une requête UDP au serveur %s, au port "
4287"%d\n"
4288
4289#, c-format
4290msgid "TIME UNKNOWN - no data received from server %s, port %d\n"
4291msgstr "TEMPS INCONNU - pas de données reçues du serveur %s, du port %d\n"
4292
4293#, c-format
4294msgid "TIME %s - %d second response time|%s\n"
4295msgstr "TEMPS %s - %d secondes de temps de réponse|%s\n"
4296
4297#, c-format
4298msgid "TIME %s - %lu second time difference|%s %s\n"
4299msgstr "TEMPS %s - %lu secondes de différence|%s %s\n"
4300
4301msgid "Warning thresholds must be a positive integer"
4302msgstr "Les seuils d'avertissement doivent être un entier positif"
4303
4304msgid "Critical thresholds must be a positive integer"
4305msgstr "Les seuils critiques doivent être un entier positif"
4306
4307msgid "This plugin will check the time on the specified host."
4308msgstr "Ce plugin va vérifier l'heure sur l'hôte spécifié."
4309
4310msgid "Use UDP to connect, not TCP"
4311msgstr ""
4312
4313msgid "Time difference (sec.) necessary to result in a warning status"
4314msgstr ""
4315
4316msgid "Time difference (sec.) necessary to result in a critical status"
4317msgstr ""
4318
4319msgid "Response time (sec.) necessary to result in warning status"
4320msgstr ""
4321
4322msgid "Response time (sec.) necessary to result in critical status"
4323msgstr ""
4324
4325msgid "On Battery, Low Battery"
4326msgstr "Sur Batterie, Batterie faible"
4327
4328msgid "Online"
4329msgstr "En marche"
4330
4331msgid "On Battery"
4332msgstr "Sur Batterie"
4333
4334msgid ", Low Battery"
4335msgstr ", Batterie faible"
4336
4337msgid ", Calibrating"
4338msgstr ", Calibration"
4339
4340msgid ", Replace Battery"
4341msgstr ", Remplacer la batterie"
4342
4343msgid ", On Bypass"
4344msgstr ", Sur Secteur"
4345
4346msgid ", Overload"
4347msgstr ", Surcharge"
4348
4349msgid ", Trimming"
4350msgstr ", En Test"
4351
4352msgid ", Boosting"
4353msgstr ""
4354
4355msgid ", Charging"
4356msgstr ", En charge"
4357
4358msgid ", Discharging"
4359msgstr ", Déchargement"
4360
4361msgid ", Unknown"
4362msgstr ", Inconnu"
4363
4364msgid "UPS does not support any available options\n"
4365msgstr "L'UPS ne supporte aucune des options disponibles\n"
4366
4367msgid "Invalid response received from host"
4368msgstr "Réponse invalide reçue de l'hôte"
4369
4370msgid "UPS name to long for buffer"
4371msgstr ""
4372
4373#, c-format
4374msgid "CRITICAL - no such UPS '%s' on that host\n"
4375msgstr "CRITIQUE - pas d'UPS '%s' sur cet hôte\n"
4376
4377msgid "CRITICAL - UPS data is stale"
4378msgstr "CRITIQUE - les données de l'ups ne sont plus valables"
4379
4380#, c-format
4381msgid "Unknown error: %s\n"
4382msgstr "Erreur inconnue: %s\n"
4383
4384msgid "Error: unable to parse variable"
4385msgstr "Erreur: impossible de lire la variable"
4386
4387msgid "Unrecognized UPS variable"
4388msgstr "Variable d'UPS non reconnue"
4389
4390msgid "Error : no UPS indicated"
4391msgstr "Erreur: pas d'UPS indiqué"
4392
4393msgid ""
4394"This plugin tests the UPS service on the specified host. Network UPS Tools"
4395msgstr "Ce plugin teste le service UPS sur l'hôte spécifié. Network UPS Tools"
4396
4397msgid "from www.networkupstools.org must be running for this plugin to work."
4398msgstr ""
4399"de www.networkupstools.org doit s'exécuter sur l'hôte pour que ce plugin "
4400"fonctionne."
4401
4402msgid "Name of UPS"
4403msgstr ""
4404
4405msgid "Output of temperatures in Celsius"
4406msgstr "Affichage des températures en Celsius"
4407
4408msgid "Valid values for STRING are"
4409msgstr "Les variables valides pour STRING sont"
4410
4411msgid ""
4412"This plugin attempts to determine the status of a UPS (Uninterruptible Power"
4413msgstr ""
4414
4415msgid ""
4416"Supply) on a local or remote host. If the UPS is online or calibrating, the"
4417msgstr ""
4418
4419msgid ""
4420"plugin will return an OK state. If the battery is on it will return a WARNING"
4421msgstr ""
4422
4423msgid ""
4424"state. If the UPS is off or has a low battery the plugin will return a "
4425"CRITICAL"
4426msgstr ""
4427
4428msgid ""
4429"You may also specify a variable to check (such as temperature, utility "
4430"voltage,"
4431msgstr ""
4432
4433msgid ""
4434"battery load, etc.) as well as warning and critical thresholds for the value"
4435msgstr ""
4436
4437msgid ""
4438"of that variable. If the remote host has multiple UPS that are being "
4439"monitored"
4440msgstr ""
4441
4442msgid "you will have to use the --ups option to specify which UPS to check."
4443msgstr ""
4444
4445msgid ""
4446"This plugin requires that the UPSD daemon distributed with Russell Kroll's"
4447msgstr ""
4448
4449msgid ""
4450"Network UPS Tools be installed on the remote host. If you do not have the"
4451msgstr ""
4452
4453msgid "package installed on your system, you can download it from"
4454msgstr ""
4455
4456msgid "http://www.networkupstools.org"
4457msgstr ""
4458
4459#, fuzzy, c-format
4460msgid "Could not enumerate RD sessions: %d\n"
4461msgstr "Impossible d'utiliser le protocole version %d\n"
4462
4463#, c-format
4464msgid "# users=%d"
4465msgstr "# utilisateurs=%d"
4466
4467msgid "Unable to read output"
4468msgstr "Impossible de lire les données en entrée"
4469
4470#, c-format
4471msgid "USERS %s - %d users currently logged in |%s\n"
4472msgstr "UTILISATEURS %s - %d utilisateurs actuellement connectés sur |%s\n"
4473
4474msgid "This plugin checks the number of users currently logged in on the local"
4475msgstr ""
4476"Ce plugin vérifie le nombre d'utilisateurs actuellement connecté sur le "
4477"système local"
4478
4479msgid ""
4480"system and generates an error if the number exceeds the thresholds specified."
4481msgstr "et génère une erreur si le nombre excède le seuil spécifié."
4482
4483msgid "Set WARNING status if more than INTEGER users are logged in"
4484msgstr ""
4485"Sortir avec un résultat AVERTISSEMENT si plus de INTEGER utilisateurs sont "
4486"connectés"
4487
4488msgid "Set CRITICAL status if more than INTEGER users are logged in"
4489msgstr ""
4490"Sortir avec un résultat CRITIQUE si plus de INTEGER utilisateurs sont "
4491"connectés"
4492
4493msgid ""
4494"DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."
4495msgstr ""
4496
4497msgid "Nagios-compatible output is now always returned."
4498msgstr ""
4499
4500msgid "SMART commands are broken and have been disabled (See Notes in --help)."
4501msgstr ""
4502
4503msgid ""
4504"DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"
4505msgstr ""
4506
4507#, fuzzy
4508msgid "default and will be removed from future releases."
4509msgstr ""
4510"Note: nslookup est obsolète et pourra être retiré dans les prochaines "
4511"versions."
4512
4513#, c-format
4514msgid "CRITICAL - Couldn't open device %s: %s\n"
4515msgstr "Critique - Impossible d'ouvrir le périphérique %s: %s\n"
4516
4517#, c-format
4518msgid "CRITICAL - SMART_CMD_ENABLE\n"
4519msgstr "CRITIQUE - SMART_CMD_ENABLE\n"
4520
4521#, c-format
4522msgid "CRITICAL - SMART_READ_VALUES: %s\n"
4523msgstr "CRITIQUE - SMART_READ_VALUES: %s\n"
4524
4525#, c-format
4526msgid "CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"
4527msgstr ""
4528"CRITIQUE - %d État de pré-panne %c Détecté! %d/%d les tests on échoués.\n"
4529
4530#, c-format
4531msgid "WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"
4532msgstr ""
4533"AVERTISSEMENT - %d État de pré-panne %s Détecté! %d/%d les tests on "
4534"échoués.\n"
4535
4536#, c-format
4537msgid "OK - Operational (%d/%d tests passed)\n"
4538msgstr "OK - En fonctionnement (%d/%d les tests on été réussi)\n"
4539
4540#, c-format
4541msgid "ERROR - Status '%d' unknown. %d/%d tests passed\n"
4542msgstr "ERREUR - État '%d' inconnu. %d/%d les tests on réussi\n"
4543
4544#, c-format
4545msgid "OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"
4546msgstr ""
4547"Etat Hors Ligne=%d {%s}, Hors Ligne Auto=%s, Temps avant arrêt=%d minutes\n"
4548
4549#, c-format
4550msgid "OffLineCapability=%d {%s %s %s}\n"
4551msgstr "Capacité Hors Ligne=%d {%s %s %s}\n"
4552
4553#, c-format
4554msgid "SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"
4555msgstr "Révision Smart=%d, Somme de contrôle=%d, Capacité Smart=%d {%s %s}\n"
4556
4557#, c-format
4558msgid "CRITICAL - %s: %s\n"
4559msgstr "CRITIQUE - %s: %s\n"
4560
4561#, fuzzy, c-format
4562msgid "OK - Command sent (%s)\n"
4563msgstr "Commande: %s\n"
4564
4565#, c-format
4566msgid "CRITICAL - SMART_READ_THRESHOLDS: %s\n"
4567msgstr "CRITIQUE - SMART_READ_THRESHOLDS: %s\n"
4568
4569#, c-format
4570msgid ""
4571"This plugin checks a local hard drive with the (Linux specific) SMART "
4572"interface [http://smartlinux.sourceforge.net/smart/index.php]."
4573msgstr ""
4574"Ce plugin vérifie un disque dur local à l'aide de l'interface SMART (pour "
4575"Linux) [http://smartlinux.sourceforge.net/smart/index.php]."
4576
4577msgid "Select device DEVICE"
4578msgstr ""
4579
4580msgid ""
4581"Note: if the device is specified without this option, any further option will"
4582msgstr ""
4583
4584msgid "be ignored."
4585msgstr ""
4586
4587msgid ""
4588"The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"
4589msgstr ""
4590
4591msgid ""
4592"broken in an underhand manner and have been disabled. You can use smartctl"
4593msgstr ""
4594
4595msgid "instead:"
4596msgstr ""
4597
4598msgid "-0/--auto-off: use \"smartctl --offlineauto=off\""
4599msgstr ""
4600
4601msgid "-1/--auto-on: use \"smartctl --offlineauto=on\""
4602msgstr ""
4603
4604msgid "-i/--immediate: use \"smartctl --test=offline\""
4605msgstr ""
4606
4607msgid "No data returned from command\n"
4608msgstr "Pas de données reçues de la commande\n"
4609
4610msgid ""
4611"Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
4612"or integer (0-3)."
4613msgstr ""
4614"Le résultat de temps dépassé doit être un nom d'état valide (OK, WARNING, "
4615"CRITICAL, UNKNOWN) ou un nombre entier (0-3)."
4616
4617msgid ""
4618"Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer "
4619"(0-3)."
4620msgstr ""
4621"Ok doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou un "
4622"nombre entier (0-3)."
4623
4624msgid ""
4625"Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4626"integer (0-3)."
4627msgstr ""
4628"Warning doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou "
4629"un nombre entier (0-3)."
4630
4631msgid ""
4632"Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4633"integer (0-3)."
4634msgstr ""
4635"Critical doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou "
4636"un nombre entier (0-3)."
4637
4638msgid ""
4639"Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4640"integer (0-3)."
4641msgstr ""
4642"Unknown doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou "
4643"un nombre entier (0-3)."
4644
4645msgid "Require path to command"
4646msgstr "Chemin vers la commande requis"
4647
4648msgid ""
4649"Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."
4650msgstr ""
4651"Inverse le statut d'un plugin (retourne OK pour CRITIQUE et vice-versa)."
4652
4653msgid "Additional switches can be used to control which state becomes what."
4654msgstr ""
4655"Des options additionnelles peuvent être utilisées pour contrôler quel état "
4656"devient quoi."
4657
4658msgid "Keep timeout longer than the plugin timeout to retain CRITICAL status."
4659msgstr ""
4660"Utilisez un délai de réponse plus long que celui du plugin afin de conserver "
4661"les résultats CRITIQUE"
4662
4663msgid "Custom result on Negate timeouts; see below for STATUS definition\n"
4664msgstr ""
4665
4666#, c-format
4667msgid ""
4668" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"
4669msgstr ""
4670" STATUS peut être 'OK', 'WARNING', 'CRITICAL' ou 'UNKNOWN' sans les "
4671"simple\n"
4672
4673#, c-format
4674msgid ""
4675" quotes. Numeric values are accepted. If nothing is specified, permutes\n"
4676msgstr " quotes. Les valeurs numériques sont acceptées. Si rien n'est\n"
4677
4678#, c-format
4679msgid " OK and CRITICAL.\n"
4680msgstr " spécifié, inverse OK et CRITIQUE.\n"
4681
4682#, c-format
4683msgid ""
4684" Substitute output text as well. Will only substitute text in CAPITALS\n"
4685msgstr ""
4686
4687msgid "Run check_ping and invert result. Must use full path to plugin"
4688msgstr ""
4689"Execute check_ping et inverse le résultat. Le chemin complet du plug-in doit "
4690"être spécifié"
4691
4692msgid "This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"
4693msgstr ""
4694"Ceci retournera OK au lieu de AVERTISSEMENT et INCONNU au lieu de CRITIQUE"
4695
4696msgid ""
4697"This plugin is a wrapper to take the output of another plugin and invert it."
4698msgstr ""
4699"Ce plugin est un adaptateur qui prends l'état d'un autre plug-in et "
4700"l'inverse."
4701
4702msgid "The full path of the plugin must be provided."
4703msgstr "Le chemin complet du plugin doit être spécifié."
4704
4705msgid "If the wrapped plugin returns OK, the wrapper will return CRITICAL."
4706msgstr "Si le plugin executé retourne OK, l'adaptateur retournera CRITIQUE."
4707
4708msgid "If the wrapped plugin returns CRITICAL, the wrapper will return OK."
4709msgstr "Si le plugin executé retourne CRITIQUE, l'adaptateur retournera OK."
4710
4711msgid "Otherwise, the output state of the wrapped plugin is unchanged."
4712msgstr "Autrement, l'état du plugin executé reste inchangé."
4713
4714msgid ""
4715"Using timeout-result, it is possible to override the timeout behaviour or a"
4716msgstr ""
4717
4718msgid "plugin by setting the negate timeout a bit lower."
4719msgstr ""
4720
4721#, c-format
4722msgid "%s - Socket timeout after %d seconds\n"
4723msgstr "%s - Le socket n'a pas répondu dans les %d secondes\n"
4724
4725#, c-format
4726msgid "%s - Abnormal timeout after %d seconds\n"
4727msgstr "%s - Dépassement anormal du temps de réponse après %d secondes\n"
4728
4729msgid "Send failed"
4730msgstr "L'envoi à échoué"
4731
4732msgid "No data was received from host!"
4733msgstr "Pas de données reçues de l'hôte!"
4734
4735msgid "Socket creation failed"
4736msgstr "La création du socket à échoué "
4737
4738msgid "Supplied path too long unix domain socket"
4739msgstr "Le chemin fourni est trop long pour un socket unix"
4740
4741msgid "Receive failed"
4742msgstr "La réception à échoué"
4743
4744#, c-format
4745msgid "Invalid hostname/address - %s"
4746msgstr "Adresse/Nom invalide - %s"
4747
4748msgid "Could not malloc argv array in popen()"
4749msgstr "Impossible de réallouer un tableau pour les paramètres dans popen()"
4750
4751msgid "CRITICAL - You need more args!!!"
4752msgstr "CRITIQUE - Vous devez spécifier plus d'arguments!!!"
4753
4754msgid "Cannot catch SIGCHLD"
4755msgstr "impossible d'obtenir le signal SIGCHLD"
4756
4757#, c-format
4758msgid "CRITICAL - Plugin timed out after %d seconds\n"
4759msgstr "CRITIQUE - Le plugin n'as pas répondu dans les %d secondes\n"
4760
4761msgid "CRITICAL - popen timeout received, but no child process"
4762msgstr ""
4763"CRITIQUE - le temps d'attente à été dépassé dans la fonction popen, mais il "
4764"n'y a pas de processus fils"
4765
4766#, c-format
4767msgid ""
4768"%s UNKNOWN - No data received from host\n"
4769"CMD: %s</A>\n"
4770msgstr ""
4771"%s INCONNU - Pas de données reçues de l'hôte\n"
4772"Commande: %s</A>\n"
4773
4774#, fuzzy
4775msgid ""
4776"This plugin wraps the text output of another command (plugin) in HTML <A>"
4777msgstr ""
4778"Ce plugin est un adaptateur qui prends l'état d'un autre plug-in et "
4779"l'inverse."
4780
4781msgid ""
4782"tags, thus displaying the child plugin's output as a clickable link in "
4783"compatible"
4784msgstr ""
4785
4786msgid ""
4787"monitoring status screen. This plugin returns the status of the invoked "
4788"plugin."
4789msgstr ""
4790
4791msgid ""
4792"Pay close attention to quoting to ensure that the shell passes the expected"
4793msgstr ""
4794
4795msgid "data to the plugin. For example, in:"
4796msgstr ""
4797
4798msgid "urlize http://example.com/ check_http -H example.com -r 'two words'"
4799msgstr ""
4800
4801msgid "the shell will remove the single quotes and urlize will see:"
4802msgstr ""
4803
4804msgid "urlize http://example.com/ check_http -H example.com -r two words"
4805msgstr ""
4806
4807msgid "You probably want:"
4808msgstr ""
4809
4810msgid "urlize http://example.com/ \"check_http -H example.com -r 'two words'\""
4811msgstr ""
4812
4813msgid "failed realloc in strpcpy\n"
4814msgstr "La fonction realloc à échoué dans strpcpy\n"
4815
4816msgid "failed malloc in strscat\n"
4817msgstr "La fonction malloc à échoué dans strscat\n"
4818
4819#, fuzzy
4820msgid "failed malloc in xvasprintf\n"
4821msgstr "La fonction malloc à échoué dans strscat\n"
4822
4823msgid "sysconf error for _SC_OPEN_MAX\n"
4824msgstr ""
4825
4826#, c-format
4827msgid ""
4828" %s (-h | --help) for detailed help\n"
4829" %s (-V | --version) for version information\n"
4830msgstr ""
4831" %s (-h | --help) pour l'aide détaillée\n"
4832" %s (-V | --version) pour les informations relative à la version\n"
4833
4834msgid ""
4835"\n"
4836"Options:\n"
4837" -h, --help\n"
4838" Print detailed help screen\n"
4839" -V, --version\n"
4840" Print version information\n"
4841msgstr ""
4842"\n"
4843"Options:\n"
4844" -h, --help\n"
4845" Afficher l'aide détaillée\n"
4846" -V, --version\n"
4847" Afficher les informations relative à la version\n"
4848
4849#, c-format
4850msgid ""
4851" -H, --hostname=ADDRESS\n"
4852" Host name, IP Address, or unix socket (must be an absolute path)\n"
4853" -%c, --port=INTEGER\n"
4854" Port number (default: %s)\n"
4855msgstr ""
4856" -H, --hostname=ADDRESS\n"
4857" Nom d'hôte, Adresse IP, ou socket UNIX (doit être un chemin absolu)\n"
4858" -%c, --port=INTEGER\n"
4859" Numéro de port (défaut: %s)\n"
4860
4861msgid ""
4862" -4, --use-ipv4\n"
4863" Use IPv4 connection\n"
4864" -6, --use-ipv6\n"
4865" Use IPv6 connection\n"
4866msgstr ""
4867" -4, --use-ipv4\n"
4868" Utiliser une connection IPv4\n"
4869" -6, --use-ipv6\n"
4870" Utiliser une connection IPv6\n"
4871
4872#, fuzzy
4873msgid ""
4874" -v, --verbose\n"
4875" Show details for command-line debugging (output may be truncated by\n"
4876" the monitoring system)\n"
4877msgstr ""
4878" -v, --verbose\n"
4879" Affiche les informations de déboguage en ligne de commande (Nagios peut "
4880"tronquer la sortie)\n"
4881
4882msgid ""
4883" -w, --warning=DOUBLE\n"
4884" Response time to result in warning status (seconds)\n"
4885" -c, --critical=DOUBLE\n"
4886" Response time to result in critical status (seconds)\n"
4887msgstr ""
4888" -w, --warning=DOUBLE\n"
4889" Temps de réponse résultant en un état d'avertissement (secondes)\n"
4890" -c, --critical=DOUBLE\n"
4891" Temps de réponse résultant en un état critique (secondes)\n"
4892
4893msgid ""
4894" -w, --warning=RANGE\n"
4895" Warning range (format: start:end). Alert if outside this range\n"
4896" -c, --critical=RANGE\n"
4897" Critical range\n"
4898msgstr ""
4899" -w, --warning=RANGE\n"
4900" Seuil d'avertissement (format: début:fin). Alerte à l'extérieur de la "
4901"plage\n"
4902" -c, --critical=RANGE\n"
4903" Seuil critique\n"
4904
4905#, c-format
4906msgid ""
4907" -t, --timeout=INTEGER\n"
4908" Seconds before connection times out (default: %d)\n"
4909msgstr ""
4910" -t, --timeout=INTEGER\n"
4911" Délais de connection en secondes (défaut: %d)\n"
4912
4913#, fuzzy, c-format
4914msgid ""
4915" -t, --timeout=INTEGER\n"
4916" Seconds before plugin times out (default: %d)\n"
4917msgstr ""
4918" -t, --timeout=INTEGER\n"
4919" Délais de connection en secondes (défaut: %d)\n"
4920
4921#, fuzzy
4922msgid ""
4923" --extra-opts=[section][@file]\n"
4924" Read options from an ini file. See\n"
4925" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
4926" for usage and examples.\n"
4927msgstr ""
4928" --extra-opts=[section][@file]\n"
4929" Lire les options d'un fichier ini. Voir\n"
4930" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
4931" pour les instructions et examples.\n"
4932
4933#, fuzzy
4934msgid ""
4935" See:\n"
4936" https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"
4937" for THRESHOLD format and examples.\n"
4938msgstr ""
4939" Voir:\n"
4940" https://www.monitoring-plugins.org/doc/guidelines.html."
4941"html#THRESHOLDFORMAT\n"
4942" pour le format et examples des seuils (THRESHOLD).\n"
4943
4944#, fuzzy
4945msgid ""
4946"\n"
4947"Send email to help@monitoring-plugins.org if you have questions regarding\n"
4948"use of this software. To submit patches or suggest improvements, send email\n"
4949"to devel@monitoring-plugins.org\n"
4950"\n"
4951msgstr ""
4952"\n"
4953"Envoyez un email à help@monitoring-plugins.org si vous avez des questions\n"
4954"reliées à l'utilisation de ce logiciel. Pour envoyer des patches ou suggérer "
4955"des\n"
4956"améliorations, envoyez un email à devel@monitoring-plugins.org\n"
4957"\n"
4958
4959#, fuzzy
4960msgid ""
4961"\n"
4962"The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may "
4963"redistribute\n"
4964"copies of the plugins under the terms of the GNU General Public License.\n"
4965"For more information about these matters, see the file named COPYING.\n"
4966msgstr ""
4967"\n"
4968"Les plugins de Nagios ne portent AUCUNE GARANTIE. Vous pouvez redistribuer\n"
4969"des copies des plugins selon les termes de la GNU General Public License.\n"
4970"Pour de plus ample informations, voir le fichier COPYING.\n"
4971
4972#, c-format
4973msgid "Error: Could not get hardware address of interface '%s'\n"
4974msgstr ""
4975"Erreur: Impossible d'obtenir l'adresse matérielle pour l'interface '%s'\n"
4976
4977#, c-format
4978msgid "Error: if_nametoindex error - %s.\n"
4979msgstr "Erreur: if_nametoindex erreur - %s.\n"
4980
4981#, c-format
4982msgid "Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"
4983msgstr ""
4984"Erreur: Impossible d'obtenir l'adresse matérielle depuis %s. erreur sysctl 1 "
4985"- %s.\n"
4986
4987#, c-format
4988msgid ""
4989"Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"
4990msgstr ""
4991"Erreur: Impossible d'obtenir l'adresse matérielle depuis l'interface %s\n"
4992" erreur malloc - %s.\n"
4993
4994#, c-format
4995msgid "Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"
4996msgstr ""
4997"Erreur: Impossible d'obtenir l'adresse matérielle depuis %s erreur sysctl 2 "
4998"- %s.\n"
4999
5000#, c-format
5001msgid ""
5002"Error: can't find unit number in interface_name (%s) - expecting TypeNumber "
5003"eg lnc0.\n"
5004msgstr ""
5005"Erreur: impossible de trouver le numéro dans le nom de l'interface (%s).\n"
5006"J'attendais le nom suivi du type ex lnc0.\n"
5007
5008#, c-format
5009msgid ""
5010"Error: can't read MAC address from DLPI streams interface for device %s unit "
5011"%d.\n"
5012msgstr ""
5013"Erreur: impossible de lire l'adresse MAC depuis l'interface DLPI pour le \n"
5014"périphérique %s numéro %d.\n"
5015
5016#, c-format
5017msgid ""
5018"Error: can't get MAC address for this architecture. Use the --mac option.\n"
5019msgstr ""
5020"Erreur: impossible d'obtenir l'adresse MAC sur cette architecture. Utilisez "
5021"l'option --mac.\n"
5022
5023#, c-format
5024msgid "Error: Cannot determine IP address of interface %s\n"
5025msgstr "Erreur: Impossible d'obtenir l'adresse IP de l'interface %s\n"
5026
5027#, c-format
5028msgid "Error: Cannot get interface IP address on this platform.\n"
5029msgstr "Erreur: Impossible d'obtenir l'adresse IP sur cette architecture.\n"
5030
5031#, c-format
5032msgid "Pretending to be relay client %s\n"
5033msgstr ""
5034
5035#, c-format
5036msgid "DHCPDISCOVER to %s port %d\n"
5037msgstr "DHCPDISCOVER vers %s port %d\n"
5038
5039#, c-format
5040msgid "Result=ERROR\n"
5041msgstr "Résultat=ERREUR\n"
5042
5043#, c-format
5044msgid "Result=OK\n"
5045msgstr "Résultat=OK\n"
5046
5047#, c-format
5048msgid "DHCPOFFER from IP address %s"
5049msgstr "DHCPOFFER depuis l'adresse IP %s"
5050
5051#, c-format
5052msgid " via %s\n"
5053msgstr " depuis %s\n"
5054
5055#, c-format
5056msgid ""
5057"DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"
5058msgstr ""
5059"DHCPOFFER XID (%u) ne correspond pas au DHCPDISCOVER XID (%u) - paquet "
5060"ignoré\n"
5061
5062#, c-format
5063msgid "DHCPOFFER hardware address did not match our own - ignoring packet\n"
5064msgstr ""
5065"l'adresse matérielle du DHCPOFFER ne correspond pas à la notre paquet "
5066"ignoré\n"
5067
5068#, c-format
5069msgid "Total responses seen on the wire: %d\n"
5070msgstr "Nombre total de réponses vues: %d\n"
5071
5072#, c-format
5073msgid "Valid responses for this machine: %d\n"
5074msgstr "Nombre de réponse valides pour cette machine: %d\n"
5075
5076#, c-format
5077msgid "send_dhcp_packet result: %d\n"
5078msgstr "résultat de send_dchp_packet: %d\n"
5079
5080#, c-format
5081msgid "No (more) data received (nfound: %d)\n"
5082msgstr "Plus de données reçues (nfound: %d)\n"
5083
5084#, c-format
5085msgid "recvfrom() failed, "
5086msgstr "recvfrom() a échoué, "
5087
5088#, c-format
5089msgid "receive_dhcp_packet() result: %d\n"
5090msgstr "résultat de receive_dchp_packet(): %d\n"
5091
5092#, c-format
5093msgid "receive_dhcp_packet() source: %s\n"
5094msgstr "source de receive_dchp_packet(): %s\n"
5095
5096#, c-format
5097msgid "Error: Could not create socket!\n"
5098msgstr "Erreur: Impossible de créer un socket!\n"
5099
5100#, c-format
5101msgid "Error: Could not set reuse address option on DHCP socket!\n"
5102msgstr ""
5103"Erreur: Impossible de configurer l'option de réutilisation de l'adresse sur\n"
5104"le socket DHCP!\n"
5105
5106#, c-format
5107msgid "Error: Could not set broadcast option on DHCP socket!\n"
5108msgstr ""
5109"Erreur: Impossible de configurer l'option broadcast sur le socket DHCP!\n"
5110
5111#, c-format
5112msgid ""
5113"Error: Could not bind socket to interface %s. Check your privileges...\n"
5114msgstr ""
5115"Erreur: Impossible de connecter le socket à l'interface %s.\n"
5116"Vérifiez vos droits...\n"
5117
5118#, c-format
5119msgid ""
5120"Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"
5121msgstr ""
5122"Erreur: Impossible de se connecter au socket (port %d)! Vérifiez vos "
5123"droits..\n"
5124
5125#, c-format
5126msgid "Requested server address: %s\n"
5127msgstr "Adresse serveur demandée: %s\n"
5128
5129#, c-format
5130msgid "Lease Time: Infinite\n"
5131msgstr "Durée du Bail: Infini\n"
5132
5133#, c-format
5134msgid "Lease Time: %lu seconds\n"
5135msgstr "Durée du Bail: %lu secondes\n"
5136
5137#, c-format
5138msgid "Renewal Time: Infinite\n"
5139msgstr "Renouvellement du bail: Infini\n"
5140
5141#, c-format
5142msgid "Renewal Time: %lu seconds\n"
5143msgstr "Durée du renouvellement = %lu secondes\n"
5144
5145#, c-format
5146msgid "Rebinding Time: Infinite\n"
5147msgstr "Délai de nouvelle demande: Infini\n"
5148
5149#, c-format
5150msgid "Rebinding Time: %lu seconds\n"
5151msgstr "Délai de nouvelle demande: %lu secondes\n"
5152
5153#, c-format
5154msgid "Added offer from server @ %s"
5155msgstr "Rajouté offre du serveur @ %s"
5156
5157#, c-format
5158msgid " of IP address %s\n"
5159msgstr "de l'adresse IP %s\n"
5160
5161#, c-format
5162msgid "DHCP Server Match: Offerer=%s"
5163msgstr "Correspondance du serveur DHCP: Offrant=%s"
5164
5165#, c-format
5166msgid " Requested=%s"
5167msgstr " Demandé=%s"
5168
5169#, c-format
5170msgid " (duplicate)"
5171msgstr ""
5172
5173#, c-format
5174msgid "\n"
5175msgstr ""
5176
5177#, c-format
5178msgid "No DHCPOFFERs were received.\n"
5179msgstr "Pas de DHCPOFFERs reçus.\n"
5180
5181#, c-format
5182msgid "Received %d DHCPOFFER(s)"
5183msgstr "Reçu %d DHCPOFFER(s)"
5184
5185#, c-format
5186msgid ", %s%d of %d requested servers responded"
5187msgstr ", %s%d de %d serveurs ont répondus"
5188
5189#, c-format
5190msgid ", requested address (%s) was %soffered"
5191msgstr ", l'adresse demandée (%s) %s été offerte"
5192
5193msgid "not "
5194msgstr "n'as pas"
5195
5196#, c-format
5197msgid ", max lease time = "
5198msgstr ", bail maximum = "
5199
5200#, c-format
5201msgid "Infinity"
5202msgstr "Infini"
5203
5204msgid "Got unexpected non-option argument"
5205msgstr ""
5206
5207#, c-format
5208msgid "Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"
5209msgstr ""
5210"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans check_ctrl: %s.\n"
5211
5212#, c-format
5213msgid "Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"
5214msgstr ""
5215"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans put_ctrl/putmsg(): "
5216"%s.\n"
5217
5218#, c-format
5219msgid "Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"
5220msgstr ""
5221"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans put_both/putmsg().\n"
5222
5223#, c-format
5224msgid ""
5225"Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"
5226msgstr ""
5227"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans dl_attach_req/"
5228"open(%s..): %s.\n"
5229
5230#, c-format
5231msgid "Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"
5232msgstr ""
5233"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans dl_bind/"
5234"check_ctrl(): %s.\n"
5235
5236#, c-format
5237msgid "Hardware address: "
5238msgstr "Adresse matérielle: "
5239
5240msgid "This plugin tests the availability of DHCP servers on a network."
5241msgstr "Ce plugin teste la disponibilité de serveurs DHCP dans un réseau."
5242
5243msgid "IP address of DHCP server that we must hear from"
5244msgstr ""
5245
5246msgid "IP address that should be offered by at least one DHCP server"
5247msgstr ""
5248
5249msgid "Seconds to wait for DHCPOFFER before timeout occurs"
5250msgstr ""
5251
5252msgid "Interface to to use for listening (i.e. eth0)"
5253msgstr ""
5254
5255msgid "MAC address to use in the DHCP request"
5256msgstr ""
5257
5258msgid "Unicast testing: mimic a DHCP relay, requires -s"
5259msgstr ""
5260
5261msgid "specify a target"
5262msgstr ""
5263
5264msgid "Use IPv4 (default) or IPv6 to communicate with the targets"
5265msgstr ""
5266
5267msgid "warning threshold (currently "
5268msgstr "Valeurs pour le seuil d'avertissement (actuellement "
5269
5270msgid "critical threshold (currently "
5271msgstr "Valeurs pour le seuil critique (actuellement "
5272
5273msgid "specify a source IP address or device name"
5274msgstr "spécifiez une adresse ou un nom d'hôte"
5275
5276msgid "number of packets to send (currently "
5277msgstr "nombre de paquets à envoyer (actuellement "
5278
5279msgid "max packet interval (currently "
5280msgstr ""
5281
5282msgid "max target interval (currently "
5283msgstr ""
5284
5285msgid "number of alive hosts required for success"
5286msgstr "nombre d'hôtes vivants requis pour réussite"
5287
5288msgid "TTL on outgoing packets (currently "
5289msgstr ""
5290
5291msgid "timeout value (seconds, currently "
5292msgstr ""
5293
5294msgid "Number of icmp data bytes to send"
5295msgstr "Nombre de paquets ICMP à envoyer"
5296
5297msgid "Packet size will be data bytes + icmp header (currently"
5298msgstr ""
5299
5300msgid "verbose"
5301msgstr ""
5302
5303msgid "The -H switch is optional. Naming a host (or several) to check is not."
5304msgstr ""
5305
5306msgid ""
5307"Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"
5308msgstr ""
5309
5310msgid "packet loss. The default values should work well for most users."
5311msgstr ""
5312
5313msgid ""
5314"You can specify different RTA factors using the standardized abbreviations"
5315msgstr ""
5316
5317msgid ""
5318"us (microseconds), ms (milliseconds, default) or just plain s for seconds."
5319msgstr ""
5320
5321msgid "The -v switch can be specified several times for increased verbosity."
5322msgstr ""
5323
5324#~ msgid "Path or partition (may be repeated)"
5325#~ msgstr "Répertoire ou partition (peut être utilisé plusieurs fois)"
5326
5327#~ msgid ""
5328#~ "value match). If multiple addresses are returned at once, you have to "
5329#~ "match"
5330#~ msgstr ""
5331#~ "valeur correspond). Si plusieurs adresses sont retournées en même temps,"
5332
5333#~ msgid ""
5334#~ "the whole string of addresses separated with commas (sorted "
5335#~ "alphabetically)."
5336#~ msgstr ""
5337#~ "vous devrez toutes les inscrire séparées pas des virgules (en ordre "
5338#~ "alphabétique)"
5339
5340#~ msgid "No specific parameters. No warning or critical threshold"
5341#~ msgstr "Pas d'argument spécifique. Pas de seuil d'avertissement ou critique"
5342
5343#~ msgid "Can't find local IP for NAS-IP-Address"
5344#~ msgstr "Impossible de trouver une addresse IP locale pour le NAS-IP-Address"
5345
5346#~ msgid "Warning free space should be more than critical free space"
5347#~ msgstr ""
5348#~ "Le seuil d'avertissement pour la place libre doit être plus grand que le "
5349#~ "seuil critique"
5350
5351#, c-format
5352#~ msgid "%s - Plugin timed out after %d seconds\n"
5353#~ msgstr "%s - Le plugin n'as pas répondu dans les %d secondes\n"
5354
5355#~ msgid "Critical Process Count must be an integer!"
5356#~ msgstr "Critique Le total des processus doit être un nombre entier!"
5357
5358#~ msgid "Warning Process Count must be an integer!"
5359#~ msgstr "Avertissement Le total des processus doit être un nombre entier!"
5360
5361#~ msgid "wmax (%d) cannot be greater than cmax (%d)\n"
5362#~ msgstr "wmax (%d) ne peut pas être plus grand que cmax (%d)\n"
5363
5364#~ msgid "wmin (%d) cannot be less than cmin (%d)\n"
5365#~ msgstr "wmin (%d) ne peut pas être plus petit que cmin (%d)\n"
5366
5367#~ msgid "CRITICAL - Cannot retrieve server certificate."
5368#~ msgstr "CRITIQUE - Impossible d'obtenir le certificat du serveur"
5369
5370#~ msgid "OIDs."
5371#~ msgstr "OIDs."
5372
5373#~ msgid "CRITICAL - Cannot retrieve server certificate.\n"
5374#~ msgstr "CRITIQUE - Impossible d'obtenir le certificat du serveur.\n"
5375
5376#~ msgid "Usage: "
5377#~ msgstr "Utilisation: "
5378
5379#~ msgid ""
5380#~ " See: http://nagiosplugins.org/extra-opts for --extra-opts usage and "
5381#~ "examples.\n"
5382#~ msgstr ""
5383#~ " Voir: http://nagiosplugins.org/extra-opts pour le format et examples de "
5384#~ "--extra-opts.\n"
diff --git a/po/monitoring-plugins.pot b/po/monitoring-plugins.pot
deleted file mode 100644
index af48f03..0000000
--- a/po/monitoring-plugins.pot
+++ /dev/null
@@ -1,4929 +0,0 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR Monitoring Plugins Development Team
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: devel@monitoring-plugins.org\n"
11"POT-Creation-Date: 2023-09-12 01:33+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"
16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"
19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20
21msgid "Could not parse arguments"
22msgstr ""
23
24msgid "Cannot catch SIGALRM"
25msgstr ""
26
27#, c-format
28msgid "SSH connection failed: %s\n"
29msgstr ""
30
31#, c-format
32msgid "Remote command execution failed: %s\n"
33msgstr ""
34
35#, c-format
36msgid "%s - check_by_ssh: Remote command '%s' returned status %d\n"
37msgstr ""
38
39#, c-format
40msgid "SSH WARNING: could not open %s\n"
41msgstr ""
42
43#, c-format
44msgid "%s: Error parsing output\n"
45msgstr ""
46
47msgid "Timeout interval must be a positive integer"
48msgstr ""
49
50msgid "Port must be a positive integer"
51msgstr ""
52
53msgid "skip-stdout argument must be an integer"
54msgstr ""
55
56msgid "skip-stderr argument must be an integer"
57msgstr ""
58
59#, c-format
60msgid "%s: You must provide a host name\n"
61msgstr ""
62
63msgid "No remotecmd"
64msgstr ""
65
66#, c-format
67msgid "%s: Argument limit of %d exceeded\n"
68msgstr ""
69
70msgid "Can not (re)allocate 'commargv' buffer\n"
71msgstr ""
72
73#, c-format
74msgid ""
75"%s: In passive mode, you must provide a service name for each command.\n"
76msgstr ""
77
78#, c-format
79msgid ""
80"%s: In passive mode, you must provide the host short name from the "
81"monitoring configs.\n"
82msgstr ""
83
84#, c-format
85msgid "This plugin uses SSH to execute commands on a remote host"
86msgstr ""
87
88msgid "tell ssh to use Protocol 1 [optional]"
89msgstr ""
90
91msgid "tell ssh to use Protocol 2 [optional]"
92msgstr ""
93
94msgid "Ignore all or (if specified) first n lines on STDOUT [optional]"
95msgstr ""
96
97msgid "Ignore all or (if specified) first n lines on STDERR [optional]"
98msgstr ""
99
100msgid "Exit with an warning, if there is an output on STDERR"
101msgstr ""
102
103msgid ""
104"tells ssh to fork rather than create a tty [optional]. This will always "
105"return OK if ssh is executed"
106msgstr ""
107
108msgid "command to execute on the remote machine"
109msgstr ""
110
111msgid "SSH user name on remote host [optional]"
112msgstr ""
113
114msgid "identity of an authorized key [optional]"
115msgstr ""
116
117msgid "external command file for monitoring [optional]"
118msgstr ""
119
120msgid "list of monitoring service names, separated by ':' [optional]"
121msgstr ""
122
123msgid "short name of host in the monitoring configuration [optional]"
124msgstr ""
125
126msgid "Call ssh with '-o OPTION' (may be used multiple times) [optional]"
127msgstr ""
128
129msgid "Tell ssh to use this configfile [optional]"
130msgstr ""
131
132msgid "Tell ssh to suppress warning and diagnostic messages [optional]"
133msgstr ""
134
135msgid "Make connection problems return UNKNOWN instead of CRITICAL"
136msgstr ""
137
138msgid "The most common mode of use is to refer to a local identity file with"
139msgstr ""
140
141msgid "the '-i' option. In this mode, the identity pair should have a null"
142msgstr ""
143
144msgid "passphrase and the public key should be listed in the authorized_keys"
145msgstr ""
146
147msgid "file of the remote host. Usually the key will be restricted to running"
148msgstr ""
149
150msgid "only one command on the remote server. If the remote SSH server tracks"
151msgstr ""
152
153msgid "invocation arguments, the one remote program may be an agent that can"
154msgstr ""
155
156msgid "execute additional commands as proxy"
157msgstr ""
158
159msgid "To use passive mode, provide multiple '-C' options, and provide"
160msgstr ""
161
162msgid ""
163"all of -O, -s, and -n options (servicelist order must match '-C'options)"
164msgstr ""
165
166msgid "Examples:"
167msgstr ""
168
169msgid "Usage:"
170msgstr ""
171
172#, c-format
173msgid "Host/Service Cluster Plugin for Monitoring"
174msgstr ""
175
176msgid "Options:"
177msgstr ""
178
179msgid "Check service cluster status"
180msgstr ""
181
182msgid "Check host cluster status"
183msgstr ""
184
185msgid "Optional prepended text output (i.e. \"Host cluster\")"
186msgstr ""
187
188msgid "Specifies the range of hosts or services in cluster that must be in a"
189msgstr ""
190
191msgid "non-OK state in order to return a WARNING status level"
192msgstr ""
193
194msgid "non-OK state in order to return a CRITICAL status level"
195msgstr ""
196
197msgid "The status codes of the hosts or services in the cluster, separated by"
198msgstr ""
199
200msgid "commas"
201msgstr ""
202
203msgid "Notes:"
204msgstr ""
205
206msgid ""
207"Will alert critical if there are 3 or more service data points in a non-OK"
208msgstr ""
209
210msgid "state."
211msgstr ""
212
213#, c-format
214msgid "Looking for: '%s'\n"
215msgstr ""
216
217msgid "dig returned an error status"
218msgstr ""
219
220msgid "Server not found in ANSWER SECTION"
221msgstr ""
222
223msgid "No ANSWER SECTION found"
224msgstr ""
225
226msgid "Probably a non-existent host/domain"
227msgstr ""
228
229#, c-format
230msgid "Port must be a positive integer - %s"
231msgstr ""
232
233#, c-format
234msgid "Warning interval must be a positive integer - %s"
235msgstr ""
236
237#, c-format
238msgid "Critical interval must be a positive integer - %s"
239msgstr ""
240
241#, c-format
242msgid "Timeout interval must be a positive integer - %s"
243msgstr ""
244
245#, c-format
246msgid "This plugin tests the DNS service on the specified host using dig"
247msgstr ""
248
249msgid "Force dig to only use IPv4 query transport"
250msgstr ""
251
252msgid "Force dig to only use IPv6 query transport"
253msgstr ""
254
255msgid "Machine name to lookup"
256msgstr ""
257
258msgid "Record type to lookup (default: A)"
259msgstr ""
260
261msgid ""
262"An address expected to be in the answer section. If not set, uses whatever"
263msgstr ""
264
265msgid "was in -l"
266msgstr ""
267
268msgid "Pass STRING as argument(s) to dig"
269msgstr ""
270
271#, c-format
272msgid "DISK %s: %s not found\n"
273msgstr ""
274
275#, c-format
276msgid "CRITICAL"
277msgstr ""
278
279#, c-format
280msgid "unit type %s not known\n"
281msgstr ""
282
283#, c-format
284msgid "failed allocating storage for '%s'\n"
285msgstr ""
286
287#, c-format
288msgid "UNKNOWN"
289msgstr ""
290
291msgid "Must set a threshold value before using -p\n"
292msgstr ""
293
294msgid "Must set -E before selecting paths\n"
295msgstr ""
296
297msgid "Must set group value before selecting paths\n"
298msgstr ""
299
300msgid ""
301"Paths need to be selected before using -i/-I. Use -A to select all paths "
302"explicitly"
303msgstr ""
304
305msgid "Could not compile regular expression"
306msgstr ""
307
308msgid "Must set a threshold value before using -r/-R\n"
309msgstr ""
310
311msgid "Regular expression did not match any path or disk"
312msgstr ""
313
314msgid "Unknown argument"
315msgstr ""
316
317#, c-format
318msgid " for %s\n"
319msgstr ""
320
321msgid ""
322"This plugin checks the amount of used disk space on a mounted file system"
323msgstr ""
324
325msgid ""
326"and generates an alert if free space is less than one of the threshold values"
327msgstr ""
328
329msgid "Exit with WARNING status if less than INTEGER units of disk are free"
330msgstr ""
331
332msgid "Exit with WARNING status if less than PERCENT of disk space is free"
333msgstr ""
334
335msgid "Exit with CRITICAL status if less than INTEGER units of disk are free"
336msgstr ""
337
338msgid "Exit with CRITICAL status if less than PERCENT of disk space is free"
339msgstr ""
340
341msgid "Exit with WARNING status if less than PERCENT of inode space is free"
342msgstr ""
343
344msgid "Exit with CRITICAL status if less than PERCENT of inode space is free"
345msgstr ""
346
347msgid ""
348"Mount point or block device as emitted by the mount(8) command (may be "
349"repeated)"
350msgstr ""
351
352msgid "Ignore device (only works if -p unspecified)"
353msgstr ""
354
355msgid "Clear thresholds"
356msgstr ""
357
358msgid "For paths or partitions specified with -p, only check for exact paths"
359msgstr ""
360
361msgid "Display only devices/mountpoints with errors"
362msgstr ""
363
364msgid "Don't account root-reserved blocks into freespace in perfdata"
365msgstr ""
366
367msgid "Display inode usage in perfdata"
368msgstr ""
369
370msgid ""
371"Group paths. Thresholds apply to (free-)space of all partitions together"
372msgstr ""
373
374msgid "Same as '--units kB'"
375msgstr ""
376
377msgid "Only check local filesystems"
378msgstr ""
379
380msgid ""
381"Only check local filesystems against thresholds. Yet call stat on remote "
382"filesystems"
383msgstr ""
384
385msgid "to test if they are accessible (e.g. to detect Stale NFS Handles)"
386msgstr ""
387
388msgid "Display the (block) device instead of the mount point"
389msgstr ""
390
391msgid "Same as '--units MB'"
392msgstr ""
393
394msgid "Explicitly select all paths. This is equivalent to -R '.*'"
395msgstr ""
396
397msgid ""
398"Case insensitive regular expression for path/partition (may be repeated)"
399msgstr ""
400
401msgid "Regular expression for path or partition (may be repeated)"
402msgstr ""
403
404msgid ""
405"Regular expression to ignore selected path/partition (case insensitive) (may "
406"be repeated)"
407msgstr ""
408
409msgid ""
410"Regular expression to ignore selected path or partition (may be repeated)"
411msgstr ""
412
413msgid ""
414"Return OK if no filesystem matches, filesystem does not exist or is "
415"inaccessible."
416msgstr ""
417
418msgid "(Provide this option before -p / -r / --ereg-path if used)"
419msgstr ""
420
421msgid "Choose bytes, kB, MB, GB, TB (default: MB)"
422msgstr ""
423
424msgid "Ignore all filesystems of indicated type (may be repeated)"
425msgstr ""
426
427msgid "Check only filesystems of indicated type (may be repeated)"
428msgstr ""
429
430msgid "Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"
431msgstr ""
432
433msgid ""
434"Checks all filesystems not matching -r at 100M and 50M. The fs matching the -"
435"r regex"
436msgstr ""
437
438msgid ""
439"are grouped which means the freespace thresholds are applied to all disks "
440"together"
441msgstr ""
442
443msgid ""
444"Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use "
445"100M/50M"
446msgstr ""
447
448#, c-format
449msgid "%s %s: %s\n"
450msgstr ""
451
452msgid "is not accessible"
453msgstr ""
454
455msgid "nslookup returned an error status"
456msgstr ""
457
458msgid "Warning plugin error"
459msgstr ""
460
461#, c-format
462msgid "DNS CRITICAL - '%s' returned empty server string\n"
463msgstr ""
464
465#, c-format
466msgid "DNS CRITICAL - No response from DNS %s\n"
467msgstr ""
468
469#, c-format
470msgid "DNS CRITICAL - '%s' returned empty host name string\n"
471msgstr ""
472
473msgid "Non-authoritative answer:"
474msgstr ""
475
476#, c-format
477msgid "Domain '%s' was not found by the server\n"
478msgstr ""
479
480#, c-format
481msgid "DNS CRITICAL - '%s' msg parsing exited with no address\n"
482msgstr ""
483
484#, c-format
485msgid "expected '%s' but got '%s'"
486msgstr ""
487
488#, c-format
489msgid "Domain '%s' was found by the server: '%s'\n"
490msgstr ""
491
492#, c-format
493msgid "server %s is not authoritative for %s"
494msgstr ""
495
496#, c-format
497msgid "OK"
498msgstr ""
499
500#, c-format
501msgid "WARNING"
502msgstr ""
503
504#, c-format
505msgid "%.3f second response time"
506msgid_plural "%.3f seconds response time"
507msgstr[0] ""
508msgstr[1] ""
509
510#, c-format
511msgid ". %s returns %s"
512msgstr ""
513
514#, c-format
515msgid "DNS WARNING - %s\n"
516msgstr ""
517
518msgid " Probably a non-existent host/domain"
519msgstr ""
520
521#, c-format
522msgid "DNS CRITICAL - %s\n"
523msgstr ""
524
525#, c-format
526msgid "DNS UNKNOWN - %s\n"
527msgstr ""
528
529msgid "Note: nslookup is deprecated and may be removed from future releases."
530msgstr ""
531
532msgid "Consider using the `dig' or `host' programs instead. Run nslookup with"
533msgstr ""
534
535msgid "the `-sil[ent]' option to prevent this message from appearing."
536msgstr ""
537
538#, c-format
539msgid "No response from DNS %s\n"
540msgstr ""
541
542#, c-format
543msgid "DNS %s has no records\n"
544msgstr ""
545
546#, c-format
547msgid "Connection to DNS %s was refused\n"
548msgstr ""
549
550#, c-format
551msgid "Query was refused by DNS server at %s\n"
552msgstr ""
553
554#, c-format
555msgid "No information returned by DNS server at %s\n"
556msgstr ""
557
558msgid "Network is unreachable\n"
559msgstr ""
560
561#, c-format
562msgid "DNS failure for %s\n"
563msgstr ""
564
565msgid "Input buffer overflow\n"
566msgstr ""
567
568msgid ""
569"This plugin uses the nslookup program to obtain the IP address for the given "
570"host/domain query."
571msgstr ""
572
573msgid "An optional DNS server to use may be specified."
574msgstr ""
575
576msgid ""
577"If no DNS server is specified, the default server(s) specified in /etc/"
578"resolv.conf will be used."
579msgstr ""
580
581msgid "The name or address you want to query"
582msgstr ""
583
584msgid "Optional DNS server you want to use for the lookup"
585msgstr ""
586
587msgid ""
588"Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"
589msgstr ""
590
591msgid ""
592"with a dot (.). This option can be repeated multiple times (Returns OK if any"
593msgstr ""
594
595msgid "value matches)."
596msgstr ""
597
598msgid ""
599"Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"
600msgstr ""
601
602msgid "Cannot be used together with -a"
603msgstr ""
604
605msgid "Optionally expect the DNS server to be authoritative for the lookup"
606msgstr ""
607
608msgid "Return warning if elapsed time exceeds value. Default off"
609msgstr ""
610
611msgid "Return critical if elapsed time exceeds value. Default off"
612msgstr ""
613
614msgid ""
615"Return critical if the list of expected addresses does not match all "
616"addresses"
617msgstr ""
618
619msgid "returned. Default off"
620msgstr ""
621
622msgid "Arguments to check_dummy must be an integer"
623msgstr ""
624
625#, c-format
626msgid "Status %d is not a supported error state\n"
627msgstr ""
628
629msgid ""
630"This plugin will simply return the state corresponding to the numeric value"
631msgstr ""
632
633msgid "of the <state> argument with optional text"
634msgstr ""
635
636#, c-format
637msgid "Could not open pipe: %s\n"
638msgstr ""
639
640#, c-format
641msgid "Could not open stderr for %s\n"
642msgstr ""
643
644msgid "FPING UNKNOWN - IP address not found\n"
645msgstr ""
646
647msgid "FPING UNKNOWN - invalid commandline argument\n"
648msgstr ""
649
650msgid "FPING UNKNOWN - failed system call\n"
651msgstr ""
652
653#, c-format
654msgid "FPING %s - %s (rta=%f ms)|%s\n"
655msgstr ""
656
657#, c-format
658msgid "FPING UNKNOWN - %s not found\n"
659msgstr ""
660
661#, c-format
662msgid "FPING CRITICAL - %s is unreachable\n"
663msgstr ""
664
665#, c-format
666msgid "FPING UNKNOWN - %s parameter error\n"
667msgstr ""
668
669#, c-format
670msgid "FPING CRITICAL - %s is down\n"
671msgstr ""
672
673#, c-format
674msgid "FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"
675msgstr ""
676
677#, c-format
678msgid "FPING %s - %s (loss=%.0f%% )|%s\n"
679msgstr ""
680
681msgid "Invalid hostname/address"
682msgstr ""
683
684msgid "IPv6 support not available\n"
685msgstr ""
686
687msgid "Packet size must be a positive integer"
688msgstr ""
689
690msgid "Packet count must be a positive integer"
691msgstr ""
692
693msgid "Target timeout must be a positive integer"
694msgstr ""
695
696msgid "Interval must be a positive integer"
697msgstr ""
698
699msgid "Hostname was not supplied"
700msgstr ""
701
702#, c-format
703msgid "%s: Only one threshold may be packet loss (%s)\n"
704msgstr ""
705
706#, c-format
707msgid "%s: Only one threshold must be packet loss (%s)\n"
708msgstr ""
709
710msgid ""
711"This plugin will use the fping command to ping the specified host for a fast "
712"check"
713msgstr ""
714
715msgid "Note that it is necessary to set the suid flag on fping."
716msgstr ""
717
718msgid ""
719"name or IP Address of host to ping (IP Address bypasses name lookup, "
720"reducing system load)"
721msgstr ""
722
723msgid "warning threshold pair"
724msgstr ""
725
726msgid "critical threshold pair"
727msgstr ""
728
729msgid "Return OK after first successful reply"
730msgstr ""
731
732msgid "size of ICMP packet"
733msgstr ""
734
735msgid "number of ICMP packets to send"
736msgstr ""
737
738msgid "Target timeout (ms)"
739msgstr ""
740
741msgid "Interval (ms) between sending packets"
742msgstr ""
743
744msgid "name or IP Address of sourceip"
745msgstr ""
746
747msgid "source interface name"
748msgstr ""
749
750#, c-format
751msgid ""
752"THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time "
753"(ms)"
754msgstr ""
755
756msgid ""
757"which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"
758msgstr ""
759
760msgid "packet loss to trigger an alarm state."
761msgstr ""
762
763msgid "IPv4 is used by default. Specify -6 to use IPv6."
764msgstr ""
765
766#, c-format
767msgid "CRITICAL - Host type parameter incorrect!\n"
768msgstr ""
769
770#, c-format
771msgid "CRITICAL - Host not found\n"
772msgstr ""
773
774#, c-format
775msgid "CRITICAL - Game server down or unavailable\n"
776msgstr ""
777
778#, c-format
779msgid "CRITICAL - Game server timeout\n"
780msgstr ""
781
782#, c-format
783msgid "This plugin tests game server connections with the specified host."
784msgstr ""
785
786msgid "Optional port of which to connect"
787msgstr ""
788
789msgid "Field number in raw qstat output that contains game name"
790msgstr ""
791
792msgid "Field number in raw qstat output that contains map name"
793msgstr ""
794
795msgid "Field number in raw qstat output that contains ping time"
796msgstr ""
797
798msgid ""
799"This plugin uses the 'qstat' command, the popular game server status query "
800"tool."
801msgstr ""
802
803msgid ""
804"If you don't have the package installed, you will need to download it from"
805msgstr ""
806
807msgid "https://github.com/multiplay/qstat before you can use this plugin."
808msgstr ""
809
810msgid "Paper Jam"
811msgstr ""
812
813msgid "Out of Paper"
814msgstr ""
815
816msgid "Printer Offline"
817msgstr ""
818
819msgid "Peripheral Error"
820msgstr ""
821
822msgid "Intervention Required"
823msgstr ""
824
825msgid "Toner Low"
826msgstr ""
827
828msgid "Insufficient Memory"
829msgstr ""
830
831msgid "A Door is Open"
832msgstr ""
833
834msgid "Output Tray is Full"
835msgstr ""
836
837msgid "Data too Slow for Engine"
838msgstr ""
839
840msgid "Unknown Paper Error"
841msgstr ""
842
843#, c-format
844msgid "Printer ok - (%s)\n"
845msgstr ""
846
847msgid "Port must be a positive short integer"
848msgstr ""
849
850msgid "This plugin tests the STATUS of an HP printer with a JetDirect card."
851msgstr ""
852
853msgid "Net-snmp must be installed on the computer running the plugin."
854msgstr ""
855
856msgid "The SNMP community name "
857msgstr ""
858
859#, c-format
860msgid "(default=%s)"
861msgstr ""
862
863msgid "Specify the port to check "
864msgstr ""
865
866msgid "Disable paper check "
867msgstr ""
868
869msgid "file does not exist or is not readable"
870msgstr ""
871
872msgid "Invalid certificate expiration period"
873msgstr ""
874
875msgid ""
876"Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional "
877"'+' suffix)"
878msgstr ""
879
880msgid "Invalid option - SSL is not available"
881msgstr ""
882
883msgid "Invalid max_redirs count"
884msgstr ""
885
886msgid "Invalid onredirect option"
887msgstr ""
888
889#, c-format
890msgid "option f:%d \n"
891msgstr ""
892
893msgid "Invalid port number"
894msgstr ""
895
896#, c-format
897msgid "Could Not Compile Regular Expression: %s"
898msgstr ""
899
900msgid "IPv6 support not available"
901msgstr ""
902
903msgid "You must specify a server address or host name"
904msgstr ""
905
906msgid ""
907"If you use a client certificate you must also specify a private key file"
908msgstr ""
909
910msgid "HTTP UNKNOWN - Memory allocation error\n"
911msgstr ""
912
913#, c-format
914msgid "%sServer date unknown, "
915msgstr ""
916
917#, c-format
918msgid "%sDocument modification date unknown, "
919msgstr ""
920
921#, c-format
922msgid "%sServer date \"%100s\" unparsable, "
923msgstr ""
924
925#, c-format
926msgid "%sDocument date \"%100s\" unparsable, "
927msgstr ""
928
929#, c-format
930msgid "%sDocument is %d seconds in the future, "
931msgstr ""
932
933#, c-format
934msgid "%sLast modified %.1f days ago, "
935msgstr ""
936
937#, c-format
938msgid "%sLast modified %d:%02d:%02d ago, "
939msgstr ""
940
941msgid "HTTP CRITICAL - Unable to open TCP socket\n"
942msgstr ""
943
944msgid "HTTP UNKNOWN - Could not allocate memory for full_page\n"
945msgstr ""
946
947msgid "HTTP CRITICAL - Error on receive\n"
948msgstr ""
949
950msgid "HTTP CRITICAL - No data received from host\n"
951msgstr ""
952
953#, c-format
954msgid "Invalid HTTP response received from host: %s\n"
955msgstr ""
956
957#, c-format
958msgid "Invalid HTTP response received from host on port %d: %s\n"
959msgstr ""
960
961#, c-format
962msgid ""
963"%s\n"
964"%s"
965msgstr ""
966
967#, c-format
968msgid "Status line output matched \"%s\" - "
969msgstr ""
970
971#, c-format
972msgid "HTTP CRITICAL: Invalid Status Line (%s)\n"
973msgstr ""
974
975#, c-format
976msgid "HTTP CRITICAL: Invalid Status (%s)\n"
977msgstr ""
978
979#, c-format
980msgid "%s - "
981msgstr ""
982
983#, c-format
984msgid "%sheader '%s' not found on '%s://%s:%d%s', "
985msgstr ""
986
987#, c-format
988msgid "%sstring '%s' not found on '%s://%s:%d%s', "
989msgstr ""
990
991#, c-format
992msgid "%spattern not found, "
993msgstr ""
994
995#, c-format
996msgid "%spattern found, "
997msgstr ""
998
999#, c-format
1000msgid "%sExecute Error: %s, "
1001msgstr ""
1002
1003#, c-format
1004msgid "%spage size %d too large, "
1005msgstr ""
1006
1007#, c-format
1008msgid "%spage size %d too small, "
1009msgstr ""
1010
1011#, c-format
1012msgid "%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"
1013msgstr ""
1014
1015#, c-format
1016msgid "%s - %d bytes in %.3f second response time %s|%s %s"
1017msgstr ""
1018
1019msgid "HTTP UNKNOWN - Could not allocate addr\n"
1020msgstr ""
1021
1022msgid "HTTP UNKNOWN - Could not allocate URL\n"
1023msgstr ""
1024
1025#, c-format
1026msgid "HTTP UNKNOWN - Could not find redirect location - %s%s\n"
1027msgstr ""
1028
1029#, c-format
1030msgid "HTTP UNKNOWN - Empty redirect location%s\n"
1031msgstr ""
1032
1033#, c-format
1034msgid "HTTP UNKNOWN - Could not parse redirect location - %s%s\n"
1035msgstr ""
1036
1037#, c-format
1038msgid "HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"
1039msgstr ""
1040
1041#, c-format
1042msgid "HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"
1043msgstr ""
1044
1045#, c-format
1046msgid "HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"
1047msgstr ""
1048
1049#, c-format
1050msgid "Redirection to %s://%s:%d%s\n"
1051msgstr ""
1052
1053msgid "This plugin tests the HTTP service on the specified host. It can test"
1054msgstr ""
1055
1056msgid "normal (http) and secure (https) servers, follow redirects, search for"
1057msgstr ""
1058
1059msgid "strings and regular expressions, check connection times, and report on"
1060msgstr ""
1061
1062msgid "certificate expiration times."
1063msgstr ""
1064
1065#, c-format
1066msgid "In the first form, make an HTTP request."
1067msgstr ""
1068
1069#, c-format
1070msgid ""
1071"In the second form, connect to the server and check the TLS certificate."
1072msgstr ""
1073
1074#, c-format
1075msgid "NOTE: One or both of -H and -I must be specified"
1076msgstr ""
1077
1078msgid "Host name argument for servers using host headers (virtual host)"
1079msgstr ""
1080
1081msgid "Append a port to include it in the header (eg: example.com:5000)"
1082msgstr ""
1083
1084msgid ""
1085"IP address or name (use numeric address if possible to bypass DNS lookup)."
1086msgstr ""
1087
1088msgid "Port number (default: "
1089msgstr ""
1090
1091msgid ""
1092"Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"
1093msgstr ""
1094
1095msgid "auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"
1096msgstr ""
1097
1098msgid "1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."
1099msgstr ""
1100
1101msgid "Enable SSL/TLS hostname extension support (SNI)"
1102msgstr ""
1103
1104msgid ""
1105"Minimum number of days a certificate has to be valid. Port defaults to 443"
1106msgstr ""
1107
1108msgid ""
1109"(when this option is used the URL is not checked by default. You can use"
1110msgstr ""
1111
1112msgid " --continue-after-certificate to override this behavior)"
1113msgstr ""
1114
1115msgid ""
1116"Allows the HTTP check to continue after performing the certificate check."
1117msgstr ""
1118
1119msgid "Does nothing unless -C is used."
1120msgstr ""
1121
1122msgid "Name of file that contains the client certificate (PEM format)"
1123msgstr ""
1124
1125msgid "to be used in establishing the SSL session"
1126msgstr ""
1127
1128msgid "Name of file containing the private key (PEM format)"
1129msgstr ""
1130
1131msgid "matching the client certificate"
1132msgstr ""
1133
1134msgid "Comma-delimited list of strings, at least one of them is expected in"
1135msgstr ""
1136
1137msgid "the first (status) line of the server response (default: "
1138msgstr ""
1139
1140msgid ""
1141"If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
1142msgstr ""
1143
1144msgid "String to expect in the response headers"
1145msgstr ""
1146
1147msgid "String to expect in the content"
1148msgstr ""
1149
1150msgid "URL to GET or POST (default: /)"
1151msgstr ""
1152
1153msgid "URL encoded http POST data"
1154msgstr ""
1155
1156msgid "Set HTTP method."
1157msgstr ""
1158
1159msgid "Don't wait for document body: stop reading after headers."
1160msgstr ""
1161
1162msgid "(Note that this still does an HTTP GET or POST, not a HEAD.)"
1163msgstr ""
1164
1165msgid "Warn if document is more than SECONDS old. the number can also be of"
1166msgstr ""
1167
1168msgid "the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."
1169msgstr ""
1170
1171msgid "specify Content-Type header media type when POSTing\n"
1172msgstr ""
1173
1174msgid "Allow regex to span newlines (must precede -r or -R)"
1175msgstr ""
1176
1177msgid "Search page for regex STRING"
1178msgstr ""
1179
1180msgid "Search page for case-insensitive regex STRING"
1181msgstr ""
1182
1183msgid "Return CRITICAL if found, OK if not\n"
1184msgstr ""
1185
1186msgid "Username:password on sites with basic authentication"
1187msgstr ""
1188
1189msgid "Username:password on proxy-servers with basic authentication"
1190msgstr ""
1191
1192msgid "String to be sent in http header as \"User Agent\""
1193msgstr ""
1194
1195msgid ""
1196"Any other tags to be sent in http header. Use multiple times for additional "
1197"headers"
1198msgstr ""
1199
1200msgid "Print additional performance data"
1201msgstr ""
1202
1203msgid "Print body content below status line"
1204msgstr ""
1205
1206msgid "Wrap output in HTML link (obsoleted by urlize)"
1207msgstr ""
1208
1209msgid "How to handle redirected pages. sticky is like follow but stick to the"
1210msgstr ""
1211
1212msgid "specified IP address. stickyport also ensures port stays the same."
1213msgstr ""
1214
1215msgid "Maximal number of redirects (default: "
1216msgstr ""
1217
1218msgid "Minimum page size required (bytes) : Maximum page size required (bytes)"
1219msgstr ""
1220
1221msgid "This plugin will attempt to open an HTTP connection with the host."
1222msgstr ""
1223
1224msgid ""
1225"Successful connects return STATE_OK, refusals and timeouts return "
1226"STATE_CRITICAL"
1227msgstr ""
1228
1229msgid ""
1230"other errors return STATE_UNKNOWN. Successful connects, but incorrect "
1231"response"
1232msgstr ""
1233
1234msgid ""
1235"messages from the host result in STATE_WARNING return values. If you are"
1236msgstr ""
1237
1238msgid ""
1239"checking a virtual server that uses 'host headers' you must supply the FQDN"
1240msgstr ""
1241
1242msgid "(fully qualified domain name) as the [host_name] argument."
1243msgstr ""
1244
1245msgid "This plugin can also check whether an SSL enabled web server is able to"
1246msgstr ""
1247
1248msgid "serve content (optionally within a specified time) or whether the X509 "
1249msgstr ""
1250
1251msgid "certificate is still valid for the specified number of days."
1252msgstr ""
1253
1254msgid "Please note that this plugin does not check if the presented server"
1255msgstr ""
1256
1257msgid "certificate matches the hostname of the server, or if the certificate"
1258msgstr ""
1259
1260msgid "has a valid chain of trust to one of the locally installed CAs."
1261msgstr ""
1262
1263msgid ""
1264"When the 'www.verisign.com' server returns its content within 5 seconds,"
1265msgstr ""
1266
1267msgid ""
1268"a STATE_OK will be returned. When the server returns its content but exceeds"
1269msgstr ""
1270
1271msgid ""
1272"the 5-second threshold, a STATE_WARNING will be returned. When an error "
1273"occurs,"
1274msgstr ""
1275
1276msgid "a STATE_CRITICAL will be returned."
1277msgstr ""
1278
1279msgid ""
1280"When the certificate of 'www.verisign.com' is valid for more than 14 days,"
1281msgstr ""
1282
1283msgid ""
1284"a STATE_OK is returned. When the certificate is still valid, but for less "
1285"than"
1286msgstr ""
1287
1288msgid ""
1289"14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"
1290msgstr ""
1291
1292msgid "the certificate is expired."
1293msgstr ""
1294
1295msgid ""
1296"When the certificate of 'www.verisign.com' is valid for more than 30 days,"
1297msgstr ""
1298
1299msgid "30 days, but more than 14 days, a STATE_WARNING is returned."
1300msgstr ""
1301
1302msgid ""
1303"A STATE_CRITICAL will be returned when certificate expires in less than 14 "
1304"days"
1305msgstr ""
1306
1307msgid ""
1308"check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j "
1309"CONNECT -H www.verisign.com "
1310msgstr ""
1311
1312msgid ""
1313"all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -"
1314"S(sl) -j CONNECT -H <webserver>"
1315msgstr ""
1316
1317msgid ""
1318"a STATE_CRITICAL will be returned. By adding a colon to the method you can "
1319"set the method used"
1320msgstr ""
1321
1322msgid "inside the proxied connection: -j CONNECT:POST"
1323msgstr ""
1324
1325#, c-format
1326msgid "Could not connect to the server at port %i\n"
1327msgstr ""
1328
1329#, c-format
1330msgid "Could not set protocol version %d\n"
1331msgstr ""
1332
1333#, c-format
1334msgid "Could not init TLS at port %i!\n"
1335msgstr ""
1336
1337#, c-format
1338msgid "TLS not supported by the libraries!\n"
1339msgstr ""
1340
1341#, c-format
1342msgid "Could not init startTLS at port %i!\n"
1343msgstr ""
1344
1345#, c-format
1346msgid "startTLS not supported by the library, needs LDAPv3!\n"
1347msgstr ""
1348
1349#, c-format
1350msgid "Could not bind to the LDAP server\n"
1351msgstr ""
1352
1353#, c-format
1354msgid "Could not search/find objectclasses in %s\n"
1355msgstr ""
1356
1357#, c-format
1358msgid "LDAP %s - found %d entries in %.3f seconds|%s %s\n"
1359msgstr ""
1360
1361#, c-format
1362msgid "LDAP %s - %.3f seconds response time|%s\n"
1363msgstr ""
1364
1365#, c-format
1366msgid "%s cannot be combined with %s"
1367msgstr ""
1368
1369msgid "Please specify the host name\n"
1370msgstr ""
1371
1372msgid "Please specify the LDAP base\n"
1373msgstr ""
1374
1375msgid "ldap attribute to search (default: \"(objectclass=*)\""
1376msgstr ""
1377
1378msgid "ldap base (eg. ou=my unit, o=my org, c=at"
1379msgstr ""
1380
1381msgid "ldap bind DN (if required)"
1382msgstr ""
1383
1384msgid ""
1385"ldap password (if required, or set the password through environment variable "
1386"'LDAP_PASSWORD')"
1387msgstr ""
1388
1389msgid "use starttls mechanism introduced in protocol version 3"
1390msgstr ""
1391
1392msgid "use ldaps (ldap v2 ssl method). this also sets the default port to"
1393msgstr ""
1394
1395msgid "use ldap protocol version 2"
1396msgstr ""
1397
1398msgid "use ldap protocol version 3"
1399msgstr ""
1400
1401msgid "default protocol version:"
1402msgstr ""
1403
1404msgid "Number of found entries to result in warning status"
1405msgstr ""
1406
1407msgid "Number of found entries to result in critical status"
1408msgstr ""
1409
1410msgid "If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"
1411msgstr ""
1412
1413#, c-format
1414msgid ""
1415" implied (using default port %i) unless --port=636 is specified. In that "
1416"case\n"
1417msgstr ""
1418
1419msgid "'SSL on connect' will be used no matter how the plugin was called."
1420msgstr ""
1421
1422msgid ""
1423"This detection is deprecated, please use 'check_ldap' with the '--starttls' "
1424"or '--ssl' flags"
1425msgstr ""
1426
1427msgid "to define the behaviour explicitly instead."
1428msgstr ""
1429
1430msgid "The parameters --warn-entries and --crit-entries are optional."
1431msgstr ""
1432
1433msgid "Warning threshold must be float or float triplet!\n"
1434msgstr ""
1435
1436#, c-format
1437msgid "Error opening %s\n"
1438msgstr ""
1439
1440#, c-format
1441msgid "could not parse load from uptime %s: %d\n"
1442msgstr ""
1443
1444#, c-format
1445msgid "Error code %d returned in %s\n"
1446msgstr ""
1447
1448#, c-format
1449msgid "Error in getloadavg()\n"
1450msgstr ""
1451
1452#, c-format
1453msgid "Error processing %s\n"
1454msgstr ""
1455
1456#, c-format
1457msgid "load average: %.2f, %.2f, %.2f"
1458msgstr ""
1459
1460#, c-format
1461msgid "Critical threshold for %d-minute load average is not specified\n"
1462msgstr ""
1463
1464#, c-format
1465msgid "Warning threshold for %d-minute load average is not specified\n"
1466msgstr ""
1467
1468#, c-format
1469msgid ""
1470"Parameter inconsistency: %d-minute \"warning load\" is greater than "
1471"\"critical load\"\n"
1472msgstr ""
1473
1474#, c-format
1475msgid "This plugin tests the current system load average."
1476msgstr ""
1477
1478msgid "Exit with WARNING status if load average exceeds WLOADn"
1479msgstr ""
1480
1481msgid "Exit with CRITICAL status if load average exceed CLOADn"
1482msgstr ""
1483
1484msgid "the load average format is the same used by \"uptime\" and \"w\""
1485msgstr ""
1486
1487msgid "Divide the load averages by the number of CPUs (when possible)"
1488msgstr ""
1489
1490msgid "Number of processes to show when printing the top consuming processes."
1491msgstr ""
1492
1493msgid "NUMBER_OF_PROCS=0 disables this feature. Default value is 0"
1494msgstr ""
1495
1496#, c-format
1497msgid "'%s' exited with non-zero status.\n"
1498msgstr ""
1499
1500#, c-format
1501msgid "some error occurred getting procs list.\n"
1502msgstr ""
1503
1504msgid "Could not parse arguments\n"
1505msgstr ""
1506
1507#, c-format
1508msgid "Unable to open MRTG log file\n"
1509msgstr ""
1510
1511#, c-format
1512msgid "Unable to process MRTG log file\n"
1513msgstr ""
1514
1515#, c-format
1516msgid "MRTG data has expired (%d minutes old)\n"
1517msgstr ""
1518
1519msgid "Avg"
1520msgstr ""
1521
1522msgid "Max"
1523msgstr ""
1524
1525msgid "Invalid variable number"
1526msgstr ""
1527
1528#, c-format
1529msgid ""
1530"%s is not a valid expiration time\n"
1531"Use '%s -h' for additional help\n"
1532msgstr ""
1533
1534msgid "Invalid variable number\n"
1535msgstr ""
1536
1537msgid "You must supply the variable number"
1538msgstr ""
1539
1540msgid ""
1541"This plugin will check either the average or maximum value of one of the"
1542msgstr ""
1543
1544msgid "two variables recorded in an MRTG log file."
1545msgstr ""
1546
1547msgid "The MRTG log file containing the data you want to monitor"
1548msgstr ""
1549
1550msgid "Minutes before MRTG data is considered to be too old"
1551msgstr ""
1552
1553msgid "Should we check average or maximum values?"
1554msgstr ""
1555
1556msgid "Which variable set should we inspect? (1 or 2)"
1557msgstr ""
1558
1559msgid "Threshold value for data to result in WARNING status"
1560msgstr ""
1561
1562msgid "Threshold value for data to result in CRITICAL status"
1563msgstr ""
1564
1565msgid "Type label for data (Examples: Conns, \"Processor Load\", In, Out)"
1566msgstr ""
1567
1568msgid "Option units label for data (Example: Packets/Sec, Errors/Sec,"
1569msgstr ""
1570
1571#, c-format
1572msgid "\"Bytes Per Second\", \"%% Utilization\")"
1573msgstr ""
1574
1575msgid ""
1576"If the value exceeds the <vwl> threshold, a WARNING status is returned. If"
1577msgstr ""
1578
1579msgid ""
1580"the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"
1581msgstr ""
1582
1583msgid "the data in the log file is older than <expire_minutes> old, a WARNING"
1584msgstr ""
1585
1586msgid "status is returned and a warning message is printed."
1587msgstr ""
1588
1589msgid ""
1590"This plugin is useful for monitoring MRTG data that does not correspond to"
1591msgstr ""
1592
1593msgid ""
1594"bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."
1595msgstr ""
1596
1597msgid ""
1598"It can be used to monitor any kind of data that MRTG is monitoring - errors,"
1599msgstr ""
1600
1601msgid ""
1602"packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"
1603msgstr ""
1604
1605msgid ""
1606"me to track processor utilization, user connections, drive space, etc and"
1607msgstr ""
1608
1609msgid "this plugin works well for monitoring that kind of data as well."
1610msgstr ""
1611
1612msgid ""
1613"- This plugin only monitors one of the two variables stored in the MRTG log"
1614msgstr ""
1615
1616msgid "file. If you want to monitor both values you will have to define two"
1617msgstr ""
1618
1619msgid "commands with different values for the <variable> argument. Of course,"
1620msgstr ""
1621
1622msgid "you can always hack the code to make this plugin work for you..."
1623msgstr ""
1624
1625msgid ""
1626"- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded "
1627"from"
1628msgstr ""
1629
1630msgid "Unable to open MRTG log file"
1631msgstr ""
1632
1633msgid "Unable to process MRTG log file"
1634msgstr ""
1635
1636#, c-format
1637msgid "%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"
1638msgstr ""
1639
1640#, c-format
1641msgid "Traffic %s - %s\n"
1642msgstr ""
1643
1644msgid ""
1645"This plugin will check the incoming/outgoing transfer rates of a router,"
1646msgstr ""
1647
1648msgid "switch, etc recorded in an MRTG log. If the newest log entry is older"
1649msgstr ""
1650
1651msgid "than <expire_minutes>, a WARNING status is returned. If either the"
1652msgstr ""
1653
1654msgid "incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"
1655msgstr ""
1656
1657msgid "Bytes/sec), a CRITICAL status results. If either of the rates exceed"
1658msgstr ""
1659
1660msgid "the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."
1661msgstr ""
1662
1663msgid "File to read log from"
1664msgstr ""
1665
1666msgid "Minutes after which log expires"
1667msgstr ""
1668
1669msgid "Test average or maximum"
1670msgstr ""
1671
1672msgid "Warning threshold pair <incoming>,<outgoing>"
1673msgstr ""
1674
1675msgid "Critical threshold pair <incoming>,<outgoing>"
1676msgstr ""
1677
1678msgid ""
1679"- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"
1680msgstr ""
1681
1682msgid "- While MRTG can monitor things other than traffic rates, this"
1683msgstr ""
1684
1685msgid " plugin probably won't work with much else without modification."
1686msgstr ""
1687
1688msgid "- The calculated i/o rates are a little off from what MRTG actually"
1689msgstr ""
1690
1691msgid " reports. I'm not sure why this is right now, but will look into it"
1692msgstr ""
1693
1694msgid " for future enhancements of this plugin."
1695msgstr ""
1696
1697#, c-format
1698msgid "Usage"
1699msgstr ""
1700
1701#, c-format
1702msgid "status store_result error: %s\n"
1703msgstr ""
1704
1705#, c-format
1706msgid "slave query error: %s\n"
1707msgstr ""
1708
1709#, c-format
1710msgid "slave store_result error: %s\n"
1711msgstr ""
1712
1713msgid "No slaves defined"
1714msgstr ""
1715
1716#, c-format
1717msgid "slave fetch row error: %s\n"
1718msgstr ""
1719
1720#, c-format
1721msgid "Slave running: %s"
1722msgstr ""
1723
1724msgid "This program tests connections to a MySQL server"
1725msgstr ""
1726
1727msgid "Ignore authentication failure and check for mysql connectivity only"
1728msgstr ""
1729
1730msgid "Use the specified socket (has no effect if -H is used)"
1731msgstr ""
1732
1733msgid "Check database with indicated name"
1734msgstr ""
1735
1736msgid "Read from the specified client options file"
1737msgstr ""
1738
1739msgid "Use a client options group"
1740msgstr ""
1741
1742msgid "Connect using the indicated username"
1743msgstr ""
1744
1745msgid "Use the indicated password to authenticate the connection"
1746msgstr ""
1747
1748msgid "IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"
1749msgstr ""
1750
1751msgid "Your clear-text password could be visible as a process table entry"
1752msgstr ""
1753
1754msgid "Check if the slave thread is running properly."
1755msgstr ""
1756
1757msgid "Exit with WARNING status if slave server is more than INTEGER seconds"
1758msgstr ""
1759
1760msgid "behind master"
1761msgstr ""
1762
1763msgid "Exit with CRITICAL status if slave server is more then INTEGER seconds"
1764msgstr ""
1765
1766msgid "Use ssl encryption"
1767msgstr ""
1768
1769msgid "Path to CA signing the cert"
1770msgstr ""
1771
1772msgid "Path to SSL certificate"
1773msgstr ""
1774
1775msgid "Path to private SSL key"
1776msgstr ""
1777
1778msgid "Path to CA directory"
1779msgstr ""
1780
1781msgid "List of valid SSL ciphers"
1782msgstr ""
1783
1784msgid ""
1785"There are no required arguments. By default, the local database is checked"
1786msgstr ""
1787
1788msgid ""
1789"using the default unix socket. You can force TCP on localhost by using an"
1790msgstr ""
1791
1792msgid "IP address or FQDN ('localhost' will use the socket as well)."
1793msgstr ""
1794
1795msgid "You must specify -p with an empty string to force an empty password,"
1796msgstr ""
1797
1798msgid "overriding any my.cnf settings."
1799msgstr ""
1800
1801msgid "Cannot open status log for reading!"
1802msgstr ""
1803
1804#, c-format
1805msgid "Found process: %s %s\n"
1806msgstr ""
1807
1808msgid "Could not locate a running Nagios process!"
1809msgstr ""
1810
1811msgid "Cannot parse Nagios log file for valid time"
1812msgstr ""
1813
1814#, c-format
1815msgid "%d process"
1816msgid_plural "%d processes"
1817msgstr[0] ""
1818msgstr[1] ""
1819
1820#, c-format
1821msgid "status log updated %d second ago"
1822msgid_plural "status log updated %d seconds ago"
1823msgstr[0] ""
1824msgstr[1] ""
1825
1826msgid "Expiration time must be an integer (seconds)\n"
1827msgstr ""
1828
1829msgid "Timeout must be an integer (seconds)\n"
1830msgstr ""
1831
1832msgid "You must provide the status_log\n"
1833msgstr ""
1834
1835msgid "You must provide a process string\n"
1836msgstr ""
1837
1838msgid ""
1839"This plugin checks the status of the Nagios process on the local machine"
1840msgstr ""
1841
1842msgid ""
1843"The plugin will check to make sure the Nagios status log is no older than"
1844msgstr ""
1845
1846msgid "the number of minutes specified by the expires option."
1847msgstr ""
1848
1849msgid ""
1850"It also checks the process table for a process matching the command argument."
1851msgstr ""
1852
1853msgid "Name of the log file to check"
1854msgstr ""
1855
1856msgid "Minutes aging after which logfile is considered stale"
1857msgstr ""
1858
1859msgid "Substring to search for in process arguments"
1860msgstr ""
1861
1862msgid "Timeout for the plugin in seconds"
1863msgstr ""
1864
1865#, c-format
1866msgid "Wrong client version - running: %s, required: %s"
1867msgstr ""
1868
1869msgid "missing -l parameters"
1870msgstr ""
1871
1872msgid "wrong -l parameter."
1873msgstr ""
1874
1875msgid "CPU Load"
1876msgstr ""
1877
1878#, c-format
1879msgid " %lu%% (%lu min average)"
1880msgstr ""
1881
1882#, c-format
1883msgid " '%lu min avg Load'=%lu%%;%lu;%lu;0;100"
1884msgstr ""
1885
1886msgid "not enough values for -l parameters"
1887msgstr ""
1888
1889msgid "wrong -l argument"
1890msgstr ""
1891
1892#, c-format
1893msgid "System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"
1894msgstr ""
1895
1896#, c-format
1897msgid "%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"
1898msgstr ""
1899
1900#, c-format
1901msgid "'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"
1902msgstr ""
1903
1904msgid "Free disk space : Invalid drive"
1905msgstr ""
1906
1907msgid "No service/process specified"
1908msgstr ""
1909
1910msgid "could not fetch information from server\n"
1911msgstr ""
1912
1913#, c-format
1914msgid ""
1915"Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"
1916msgstr ""
1917
1918#, c-format
1919msgid "'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"
1920msgstr ""
1921
1922msgid "No counter specified"
1923msgstr ""
1924
1925msgid "Minimum value contains non-numbers"
1926msgstr ""
1927
1928msgid "Maximum value contains non-numbers"
1929msgstr ""
1930
1931msgid "No unit counter specified"
1932msgstr ""
1933
1934msgid "Please specify a variable to check"
1935msgstr ""
1936
1937msgid "Server port must be an integer\n"
1938msgstr ""
1939
1940msgid "You must provide a server address or host name"
1941msgstr ""
1942
1943msgid "None"
1944msgstr ""
1945
1946msgid "This plugin collects data from the NSClient service running on a"
1947msgstr ""
1948
1949msgid "Windows NT/2000/XP/2003 server."
1950msgstr ""
1951
1952msgid "Name of the host to check"
1953msgstr ""
1954
1955msgid "Optional port number (default: "
1956msgstr ""
1957
1958msgid "Password needed for the request"
1959msgstr ""
1960
1961msgid "Threshold which will result in a warning status"
1962msgstr ""
1963
1964msgid "Threshold which will result in a critical status"
1965msgstr ""
1966
1967msgid "Seconds before connection attempt times out (default: "
1968msgstr ""
1969
1970msgid "Parameters passed to specified check (see below)"
1971msgstr ""
1972
1973msgid "Display options (currently only SHOWALL works)"
1974msgstr ""
1975
1976msgid "Return UNKNOWN on timeouts"
1977msgstr ""
1978
1979msgid "Print this help screen"
1980msgstr ""
1981
1982msgid "Print version information"
1983msgstr ""
1984
1985msgid "Variable to check"
1986msgstr ""
1987
1988msgid "Valid variables are:"
1989msgstr ""
1990
1991msgid "Get the NSClient version"
1992msgstr ""
1993
1994msgid "If -l <version> is specified, will return warning if versions differ."
1995msgstr ""
1996
1997msgid "Average CPU load on last x minutes."
1998msgstr ""
1999
2000msgid "Request a -l parameter with the following syntax:"
2001msgstr ""
2002
2003msgid "-l <minutes range>,<warning threshold>,<critical threshold>."
2004msgstr ""
2005
2006msgid "<minute range> should be less than 24*60."
2007msgstr ""
2008
2009msgid ""
2010"Thresholds are percentage and up to 10 requests can be done in one shot."
2011msgstr ""
2012
2013msgid "Get the uptime of the machine."
2014msgstr ""
2015
2016msgid "-l <unit> "
2017msgstr ""
2018
2019msgid "<unit> = seconds, minutes, hours, or days. (default: minutes)"
2020msgstr ""
2021
2022msgid "Thresholds will use the unit specified above."
2023msgstr ""
2024
2025msgid "Size and percentage of disk use."
2026msgstr ""
2027
2028msgid "Request a -l parameter containing the drive letter only."
2029msgstr ""
2030
2031msgid "Warning and critical thresholds can be specified with -w and -c."
2032msgstr ""
2033
2034msgid "Memory use."
2035msgstr ""
2036
2037msgid "Check the state of one or several services."
2038msgstr ""
2039
2040msgid "Request a -l parameters with the following syntax:"
2041msgstr ""
2042
2043msgid "-l <service1>,<service2>,<service3>,..."
2044msgstr ""
2045
2046msgid "You can specify -d SHOWALL in case you want to see working services"
2047msgstr ""
2048
2049msgid "in the returned string."
2050msgstr ""
2051
2052msgid "Check if one or several process are running."
2053msgstr ""
2054
2055msgid "Same syntax as SERVICESTATE."
2056msgstr ""
2057
2058msgid "Check any performance counter of Windows NT/2000."
2059msgstr ""
2060
2061msgid "-l \"\\\\<performance object>\\\\counter\",\"<description>"
2062msgstr ""
2063
2064msgid "The <description> parameter is optional and is given to a printf "
2065msgstr ""
2066
2067msgid "output command which requires a float parameter."
2068msgstr ""
2069
2070#, c-format
2071msgid "If <description> does not include \"%%\", it is used as a label."
2072msgstr ""
2073
2074msgid "Some examples:"
2075msgstr ""
2076
2077msgid "Check any performance counter object of Windows NT/2000."
2078msgstr ""
2079
2080msgid ""
2081"Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"
2082msgstr ""
2083
2084msgid "<counter object> is a Windows Perfmon Counter object (eg. Process),"
2085msgstr ""
2086
2087msgid "if it is two words, it should be enclosed in quotes"
2088msgstr ""
2089
2090msgid "The returned results will be a comma-separated list of instances on "
2091msgstr ""
2092
2093msgid " the selected computer for that object."
2094msgstr ""
2095
2096msgid ""
2097"The purpose of this is to be run from command line to determine what "
2098"instances"
2099msgstr ""
2100
2101msgid ""
2102" are available for monitoring without having to log onto the Windows server"
2103msgstr ""
2104
2105msgid " to run Perfmon directly."
2106msgstr ""
2107
2108msgid ""
2109"It can also be used in scripts that automatically create the monitoring "
2110"service"
2111msgstr ""
2112
2113msgid " configuration files."
2114msgstr ""
2115
2116msgid "check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"
2117msgstr ""
2118
2119msgid ""
2120"- The NSClient service should be running on the server to get any information"
2121msgstr ""
2122
2123msgid "- Critical thresholds should be lower than warning thresholds"
2124msgstr ""
2125
2126msgid "- Default port 1248 is sometimes in use by other services. The error"
2127msgstr ""
2128
2129msgid ""
2130"output when this happens contains \"Cannot map xxxxx to protocol number\"."
2131msgstr ""
2132
2133msgid "One fix for this is to change the port to something else on check_nt "
2134msgstr ""
2135
2136msgid "and on the client service it's connecting to."
2137msgstr ""
2138
2139#, c-format
2140msgid "jitter response too large (%lu bytes)\n"
2141msgstr ""
2142
2143msgid "NTP CRITICAL:"
2144msgstr ""
2145
2146msgid "NTP WARNING:"
2147msgstr ""
2148
2149msgid "NTP OK:"
2150msgstr ""
2151
2152msgid "NTP UNKNOWN:"
2153msgstr ""
2154
2155msgid "Offset unknown"
2156msgstr ""
2157
2158msgid "Offset"
2159msgstr ""
2160
2161msgid "This plugin checks the selected ntp server"
2162msgstr ""
2163
2164msgid "Offset to result in warning status (seconds)"
2165msgstr ""
2166
2167msgid "Offset to result in critical status (seconds)"
2168msgstr ""
2169
2170msgid "Warning threshold for jitter"
2171msgstr ""
2172
2173msgid "Critical threshold for jitter"
2174msgstr ""
2175
2176msgid "Normal offset check:"
2177msgstr ""
2178
2179msgid ""
2180"Check jitter too, avoiding critical notifications if jitter isn't available"
2181msgstr ""
2182
2183msgid "(See Notes above for more details on thresholds formats):"
2184msgstr ""
2185
2186msgid "WARNING: check_ntp is deprecated. Please use check_ntp_peer or"
2187msgstr ""
2188
2189msgid "check_ntp_time instead."
2190msgstr ""
2191
2192msgid "Server not synchronized"
2193msgstr ""
2194
2195msgid "Server has the LI_ALARM bit set"
2196msgstr ""
2197
2198msgid ""
2199"Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"
2200msgstr ""
2201
2202msgid "Warning threshold for stratum of server's synchronization peer"
2203msgstr ""
2204
2205msgid "Critical threshold for stratum of server's synchronization peer"
2206msgstr ""
2207
2208msgid "Warning threshold for number of usable time sources (\"truechimers\")"
2209msgstr ""
2210
2211msgid "Critical threshold for number of usable time sources (\"truechimers\")"
2212msgstr ""
2213
2214msgid "This plugin checks an NTP server independent of any commandline"
2215msgstr ""
2216
2217msgid "programs or external libraries."
2218msgstr ""
2219
2220msgid "Use this plugin to check the health of an NTP server. It supports"
2221msgstr ""
2222
2223msgid "checking the offset with the sync peer, the jitter and stratum. This"
2224msgstr ""
2225
2226msgid "plugin will not check the clock offset between the local host and NTP"
2227msgstr ""
2228
2229msgid "server; please use check_ntp_time for that purpose."
2230msgstr ""
2231
2232msgid "Simple NTP server check:"
2233msgstr ""
2234
2235msgid "Only check the number of usable time sources (\"truechimers\"):"
2236msgstr ""
2237
2238msgid "Check only stratum:"
2239msgstr ""
2240
2241msgid "This plugin checks the clock offset with the ntp server"
2242msgstr ""
2243
2244msgid "Returns UNKNOWN instead of CRITICAL if offset cannot be found"
2245msgstr ""
2246
2247msgid "Expected offset of the ntp server relative to local server (seconds)"
2248msgstr ""
2249
2250msgid "This plugin checks the clock offset between the local host and a"
2251msgstr ""
2252
2253msgid "remote NTP server. It is independent of any commandline programs or"
2254msgstr ""
2255
2256msgid "external libraries."
2257msgstr ""
2258
2259msgid "If you'd rather want to monitor an NTP server, please use"
2260msgstr ""
2261
2262msgid "check_ntp_peer."
2263msgstr ""
2264
2265msgid "--time-offset is useful for compensating for servers with known"
2266msgstr ""
2267
2268msgid "and expected clock skew."
2269msgstr ""
2270
2271#, c-format
2272msgid "NetWare %s: "
2273msgstr ""
2274
2275#, c-format
2276msgid "Up %s,"
2277msgstr ""
2278
2279#, c-format
2280msgid "Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"
2281msgstr ""
2282
2283#, c-format
2284msgid "Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"
2285msgstr ""
2286
2287#, c-format
2288msgid "%s: Long term cache hits = %lu%%"
2289msgstr ""
2290
2291#, c-format
2292msgid "%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"
2293msgstr ""
2294
2295#, c-format
2296msgid "%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"
2297msgstr ""
2298
2299#, c-format
2300msgid "%s: LRU sitting time = %lu minutes"
2301msgstr ""
2302
2303#, c-format
2304msgid "CRITICAL - Volume '%s' does not exist!"
2305msgstr ""
2306
2307#, c-format
2308msgid "%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"
2309msgstr ""
2310
2311msgid "Only "
2312msgstr ""
2313
2314#, c-format
2315msgid "%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"
2316msgstr ""
2317
2318#, c-format
2319msgid "%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"
2320msgstr ""
2321
2322#, c-format
2323msgid ""
2324"%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"
2325msgstr ""
2326
2327#, c-format
2328msgid "Directory Services Database is %s (DS version %s)"
2329msgstr ""
2330
2331#, c-format
2332msgid "Logins are %s"
2333msgstr ""
2334
2335msgid "enabled"
2336msgstr ""
2337
2338msgid "disabled"
2339msgstr ""
2340
2341msgid "CRITICAL - NRM Status is bad!"
2342msgstr ""
2343
2344msgid "Warning - NRM Status is suspect!"
2345msgstr ""
2346
2347msgid "OK - NRM Status is good!"
2348msgstr ""
2349
2350#, c-format
2351msgid "%lu of %lu (%lu%%) packet receive buffers used"
2352msgstr ""
2353
2354#, c-format
2355msgid "%lu entries in SAP table"
2356msgstr ""
2357
2358#, c-format
2359msgid "%lu entries in SAP table for SAP type %d"
2360msgstr ""
2361
2362#, c-format
2363msgid "%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
2364msgstr ""
2365
2366#, c-format
2367msgid "%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
2368msgstr ""
2369
2370#, c-format
2371msgid "%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"
2372msgstr ""
2373
2374#, c-format
2375msgid "%s%lu KB not yet purgeable on volume %s"
2376msgstr ""
2377
2378#, c-format
2379msgid "%lu MB (%lu%%) not yet purgeable on volume %s"
2380msgstr ""
2381
2382#, c-format
2383msgid "%lu open files|Openfiles=%lu;%lu;%lu;0,0"
2384msgstr ""
2385
2386#, c-format
2387msgid "%lu abended threads|Abends=%lu;%lu;%lu;;"
2388msgstr ""
2389
2390#, c-format
2391msgid "%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"
2392msgstr ""
2393
2394msgid "CRITICAL - Time not in sync with network!"
2395msgstr ""
2396
2397msgid "OK - Time in sync with network!"
2398msgstr ""
2399
2400#, c-format
2401msgid "LRU sitting time = %lu seconds"
2402msgstr ""
2403
2404#, c-format
2405msgid "Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"
2406msgstr ""
2407
2408#, c-format
2409msgid "Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"
2410msgstr ""
2411
2412#, c-format
2413msgid "NDS Version %s"
2414msgstr ""
2415
2416#, c-format
2417msgid "Up %s"
2418msgstr ""
2419
2420#, c-format
2421msgid "Module %s version %s is loaded"
2422msgstr ""
2423
2424#, c-format
2425msgid "Module %s is not loaded"
2426msgstr ""
2427
2428#, c-format
2429msgid "CRITICAL - Value '%s' does not exist!"
2430msgstr ""
2431
2432#, c-format
2433msgid "%s is %lu|%s=%lu;%lu;%lu;;"
2434msgstr ""
2435
2436msgid "Nothing to check!\n"
2437msgstr ""
2438
2439msgid "Server port an integer\n"
2440msgstr ""
2441
2442msgid "This plugin attempts to contact the MRTGEXT NLM running on a"
2443msgstr ""
2444
2445msgid "Novell server to gather the requested system information."
2446msgstr ""
2447
2448msgid "Variable to check. Valid variables include:"
2449msgstr ""
2450
2451msgid "LOAD1 = 1 minute average CPU load"
2452msgstr ""
2453
2454msgid "LOAD5 = 5 minute average CPU load"
2455msgstr ""
2456
2457msgid "LOAD15 = 15 minute average CPU load"
2458msgstr ""
2459
2460msgid "CSPROCS = number of current service processes (NW 5.x only)"
2461msgstr ""
2462
2463msgid "ABENDS = number of abended threads (NW 5.x only)"
2464msgstr ""
2465
2466msgid "UPTIME = server uptime"
2467msgstr ""
2468
2469msgid "LTCH = percent long term cache hits"
2470msgstr ""
2471
2472msgid "CBUFF = current number of cache buffers"
2473msgstr ""
2474
2475msgid "CDBUFF = current number of dirty cache buffers"
2476msgstr ""
2477
2478msgid "DCB = dirty cache buffers as a percentage of the total"
2479msgstr ""
2480
2481msgid "TCB = dirty cache buffers as a percentage of the original"
2482msgstr ""
2483
2484msgid "OFILES = number of open files"
2485msgstr ""
2486
2487msgid " VMF<vol> = MB of free space on Volume <vol>"
2488msgstr ""
2489
2490msgid " VMU<vol> = MB used space on Volume <vol>"
2491msgstr ""
2492
2493msgid " VMP<vol> = MB of purgeable space on Volume <vol>"
2494msgstr ""
2495
2496msgid " VPF<vol> = percent free space on volume <vol>"
2497msgstr ""
2498
2499msgid " VKF<vol> = KB of free space on volume <vol>"
2500msgstr ""
2501
2502msgid " VPP<vol> = percent purgeable space on volume <vol>"
2503msgstr ""
2504
2505msgid " VKP<vol> = KB of purgeable space on volume <vol>"
2506msgstr ""
2507
2508msgid " VPNP<vol> = percent not yet purgeable space on volume <vol>"
2509msgstr ""
2510
2511msgid " VKNP<vol> = KB of not yet purgeable space on volume <vol>"
2512msgstr ""
2513
2514msgid " LRUM = LRU sitting time in minutes"
2515msgstr ""
2516
2517msgid " LRUS = LRU sitting time in seconds"
2518msgstr ""
2519
2520msgid " DSDB = check to see if DS Database is open"
2521msgstr ""
2522
2523msgid " DSVER = NDS version"
2524msgstr ""
2525
2526msgid " UPRB = used packet receive buffers"
2527msgstr ""
2528
2529msgid " PUPRB = percent (of max) used packet receive buffers"
2530msgstr ""
2531
2532msgid " SAPENTRIES = number of entries in the SAP table"
2533msgstr ""
2534
2535msgid " SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"
2536msgstr ""
2537
2538msgid " TSYNC = timesync status"
2539msgstr ""
2540
2541msgid " LOGINS = check to see if logins are enabled"
2542msgstr ""
2543
2544msgid " CONNS = number of currently licensed connections"
2545msgstr ""
2546
2547msgid " NRMH\t= NRM Summary Status"
2548msgstr ""
2549
2550msgid " NRMP<stat> = Returns the current value for a NRM health item"
2551msgstr ""
2552
2553msgid " NRMM<stat> = Returns the current memory stats from NRM"
2554msgstr ""
2555
2556msgid " NRMS<stat> = Returns the current Swapfile stats from NRM"
2557msgstr ""
2558
2559msgid " NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"
2560msgstr ""
2561
2562msgid " NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"
2563msgstr ""
2564
2565msgid " NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"
2566msgstr ""
2567
2568msgid " NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"
2569msgstr ""
2570
2571msgid " NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"
2572msgstr ""
2573
2574msgid ""
2575" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"
2576msgstr ""
2577
2578msgid " NLM:<nlm> = check if NLM is loaded and report version"
2579msgstr ""
2580
2581msgid " (e.g. NLM:TSANDS.NLM)"
2582msgstr ""
2583
2584msgid "Include server version string in results"
2585msgstr ""
2586
2587msgid "- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"
2588msgstr ""
2589
2590msgid ""
2591" extension for NetWare be loaded on the Novell servers you wish to check."
2592msgstr ""
2593
2594msgid " (available from http://www.engr.wisc.edu/~drews/mrtg/)"
2595msgstr ""
2596
2597msgid ""
2598"- Values for critical thresholds should be lower than warning thresholds"
2599msgstr ""
2600
2601msgid ""
2602" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "
2603msgstr ""
2604
2605msgid " TCB, LRUS and LRUM."
2606msgstr ""
2607
2608msgid "Unknown error fetching load data\n"
2609msgstr ""
2610
2611msgid "Invalid response from server - no load information\n"
2612msgstr ""
2613
2614msgid "Invalid response from server after load 1\n"
2615msgstr ""
2616
2617msgid "Invalid response from server after load 5\n"
2618msgstr ""
2619
2620#, c-format
2621msgid "Load %s - %s-min load average = %0.2f"
2622msgstr ""
2623
2624msgid "Unknown error fetching disk data\n"
2625msgstr ""
2626
2627msgid "Invalid response from server\n"
2628msgstr ""
2629
2630msgid "Unknown error fetching network status\n"
2631msgstr ""
2632
2633#, c-format
2634msgid "Net %s - %d connection%s on port %d"
2635msgstr ""
2636
2637msgid "Unknown error fetching process status\n"
2638msgstr ""
2639
2640#, c-format
2641msgid "Process %s - %d instance%s of %s running"
2642msgstr ""
2643
2644#, c-format
2645msgid "Uptime %s - Up %d days %d hours %d minutes"
2646msgstr ""
2647
2648msgid ""
2649"This plugin attempts to contact the Over-CR collector daemon running on the"
2650msgstr ""
2651
2652msgid "remote UNIX server in order to gather the requested system information."
2653msgstr ""
2654
2655msgid "LOAD1 = 1 minute average CPU load"
2656msgstr ""
2657
2658msgid "LOAD5 = 5 minute average CPU load"
2659msgstr ""
2660
2661msgid "LOAD15 = 15 minute average CPU load"
2662msgstr ""
2663
2664msgid "DPU<filesys> = percent used disk space on filesystem <filesys>"
2665msgstr ""
2666
2667msgid "PROC<process> = number of running processes with name <process>"
2668msgstr ""
2669
2670msgid "NET<port> = number of active connections on TCP port <port>"
2671msgstr ""
2672
2673msgid "UPTIME = system uptime in seconds"
2674msgstr ""
2675
2676msgid "This plugin requires that Eric Molitors' Over-CR collector daemon be"
2677msgstr ""
2678
2679msgid "running on the remote server."
2680msgstr ""
2681
2682msgid "Over-CR can be downloaded from http://www.molitor.org/overcr"
2683msgstr ""
2684
2685msgid "This plugin was tested with version 0.99.53 of the Over-CR collector"
2686msgstr ""
2687
2688msgid ""
2689"For the available options, the critical threshold value should always be"
2690msgstr ""
2691
2692msgid ""
2693"higher than the warning threshold value, EXCEPT with the uptime variable"
2694msgstr ""
2695
2696#, c-format
2697msgid "CRITICAL - no connection to '%s' (%s).\n"
2698msgstr ""
2699
2700#, c-format
2701msgid " %s - database %s (%f sec.)|%s\n"
2702msgstr ""
2703
2704msgid "Critical threshold must be a positive integer"
2705msgstr ""
2706
2707msgid "Warning threshold must be a positive integer"
2708msgstr ""
2709
2710msgid "Database name exceeds the maximum length"
2711msgstr ""
2712
2713msgid "User name is not valid"
2714msgstr ""
2715
2716#, c-format
2717msgid "Test whether a PostgreSQL Database is accepting connections."
2718msgstr ""
2719
2720msgid "Database to check "
2721msgstr ""
2722
2723#, c-format
2724msgid "(default: %s)\n"
2725msgstr ""
2726
2727msgid "Login name of user"
2728msgstr ""
2729
2730msgid "Password (BIG SECURITY ISSUE)"
2731msgstr ""
2732
2733msgid "Connection parameters (keyword = value), see below"
2734msgstr ""
2735
2736msgid "SQL query to run. Only first column in first row will be read"
2737msgstr ""
2738
2739msgid "A name for the query, this string is used instead of the query"
2740msgstr ""
2741
2742msgid "in the long output of the plugin"
2743msgstr ""
2744
2745msgid "SQL query value to result in warning status (double)"
2746msgstr ""
2747
2748msgid "SQL query value to result in critical status (double)"
2749msgstr ""
2750
2751msgid "All parameters are optional."
2752msgstr ""
2753
2754msgid ""
2755"This plugin tests a PostgreSQL DBMS to determine whether it is active and"
2756msgstr ""
2757
2758msgid "accepting queries. In its current operation, it simply connects to the"
2759msgstr ""
2760
2761msgid ""
2762"specified database, and then disconnects. If no database is specified, it"
2763msgstr ""
2764
2765msgid ""
2766"connects to the template1 database, which is present in every functioning"
2767msgstr ""
2768
2769msgid "PostgreSQL DBMS."
2770msgstr ""
2771
2772msgid "If a query is specified using the -q option, it will be executed after"
2773msgstr ""
2774
2775msgid "connecting to the server. The result from the query has to be numeric."
2776msgstr ""
2777
2778msgid ""
2779"Multiple SQL commands, separated by semicolon, are allowed but the result "
2780msgstr ""
2781
2782msgid "of the last command is taken into account only. The value of the first"
2783msgstr ""
2784
2785msgid ""
2786"column in the first row is used as the check result. If a second column is"
2787msgstr ""
2788
2789msgid "present in the result set, this is added to the plugin output with a"
2790msgstr ""
2791
2792msgid ""
2793"prefix of \"Extra Info:\". This information can be displayed in the system"
2794msgstr ""
2795
2796msgid "executing the plugin."
2797msgstr ""
2798
2799msgid ""
2800"See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"
2801msgstr ""
2802
2803msgid ""
2804"for details about how to access internal statistics of the database server."
2805msgstr ""
2806
2807msgid ""
2808"For a list of available connection parameters which may be used with the -o"
2809msgstr ""
2810
2811msgid ""
2812"command line option, see the documentation for PQconnectdb() in the chapter"
2813msgstr ""
2814
2815msgid ""
2816"\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"
2817msgstr ""
2818
2819msgid ""
2820"used to specify a service name in pg_service.conf to be used for additional"
2821msgstr ""
2822
2823msgid "connection parameters: -o 'service=<name>' or to specify the SSL mode:"
2824msgstr ""
2825
2826msgid "-o 'sslmode=require'."
2827msgstr ""
2828
2829msgid ""
2830"The plugin will connect to a local postmaster if no host is specified. To"
2831msgstr ""
2832
2833msgid ""
2834"connect to a remote host, be sure that the remote postmaster accepts TCP/IP"
2835msgstr ""
2836
2837msgid "connections (start the postmaster with the -i option)."
2838msgstr ""
2839
2840msgid ""
2841"Typically, the monitoring user (unless the --logname option is used) should "
2842"be"
2843msgstr ""
2844
2845msgid ""
2846"able to connect to the database without a password. The plugin can also send"
2847msgstr ""
2848
2849msgid "a password, but no effort is made to obscure or encrypt the password."
2850msgstr ""
2851
2852#, c-format
2853msgid "QUERY %s - %s: %s.\n"
2854msgstr ""
2855
2856msgid "Error with query"
2857msgstr ""
2858
2859msgid "No rows returned"
2860msgstr ""
2861
2862msgid "No columns returned"
2863msgstr ""
2864
2865msgid "No data returned"
2866msgstr ""
2867
2868msgid "Is not a numeric"
2869msgstr ""
2870
2871#, c-format
2872msgid "%s returned %f"
2873msgstr ""
2874
2875#, c-format
2876msgid "'%s' returned %f"
2877msgstr ""
2878
2879msgid "CRITICAL - Could not interpret output from ping command\n"
2880msgstr ""
2881
2882#, c-format
2883msgid "PING %s - %sPacket loss = %d%%"
2884msgstr ""
2885
2886#, c-format
2887msgid "PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"
2888msgstr ""
2889
2890msgid "Could not realloc() addresses\n"
2891msgstr ""
2892
2893#, c-format
2894msgid "<max_packets> (%s) must be a non-negative number\n"
2895msgstr ""
2896
2897#, c-format
2898msgid "<wpl> (%s) must be an integer percentage\n"
2899msgstr ""
2900
2901#, c-format
2902msgid "<cpl> (%s) must be an integer percentage\n"
2903msgstr ""
2904
2905#, c-format
2906msgid "<wrta> (%s) must be a non-negative number\n"
2907msgstr ""
2908
2909#, c-format
2910msgid "<crta> (%s) must be a non-negative number\n"
2911msgstr ""
2912
2913#, c-format
2914msgid ""
2915"%s: Warning threshold must be integer or percentage!\n"
2916"\n"
2917msgstr ""
2918
2919#, c-format
2920msgid "<wrta> was not set\n"
2921msgstr ""
2922
2923#, c-format
2924msgid "<crta> was not set\n"
2925msgstr ""
2926
2927#, c-format
2928msgid "<wpl> was not set\n"
2929msgstr ""
2930
2931#, c-format
2932msgid "<cpl> was not set\n"
2933msgstr ""
2934
2935#, c-format
2936msgid "<wrta> (%f) cannot be larger than <crta> (%f)\n"
2937msgstr ""
2938
2939#, c-format
2940msgid "<wpl> (%d) cannot be larger than <cpl> (%d)\n"
2941msgstr ""
2942
2943#, c-format
2944msgid "Cannot open stderr for %s\n"
2945msgstr ""
2946
2947msgid "System call sent warnings to stderr "
2948msgstr ""
2949
2950#, c-format
2951msgid "CRITICAL - Network Unreachable (%s)\n"
2952msgstr ""
2953
2954#, c-format
2955msgid "CRITICAL - Host Unreachable (%s)\n"
2956msgstr ""
2957
2958#, c-format
2959msgid "CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"
2960msgstr ""
2961
2962#, c-format
2963msgid "CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"
2964msgstr ""
2965
2966#, c-format
2967msgid "CRITICAL - Network Prohibited (%s)\n"
2968msgstr ""
2969
2970#, c-format
2971msgid "CRITICAL - Host Prohibited (%s)\n"
2972msgstr ""
2973
2974#, c-format
2975msgid "CRITICAL - Packet Filtered (%s)\n"
2976msgstr ""
2977
2978#, c-format
2979msgid "CRITICAL - Host not found (%s)\n"
2980msgstr ""
2981
2982#, c-format
2983msgid "CRITICAL - Time to live exceeded (%s)\n"
2984msgstr ""
2985
2986#, c-format
2987msgid "CRITICAL - Destination Unreachable (%s)\n"
2988msgstr ""
2989
2990msgid "Unable to realloc warn_text\n"
2991msgstr ""
2992
2993#, c-format
2994msgid "Use ping to check connection statistics for a remote host."
2995msgstr ""
2996
2997msgid "host to ping"
2998msgstr ""
2999
3000msgid "number of ICMP ECHO packets to send"
3001msgstr ""
3002
3003#, c-format
3004msgid "(Default: %d)\n"
3005msgstr ""
3006
3007msgid "show HTML in the plugin output (obsoleted by urlize)"
3008msgstr ""
3009
3010msgid "THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"
3011msgstr ""
3012
3013msgid "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"
3014msgstr ""
3015
3016msgid "percentage of packet loss to trigger an alarm state."
3017msgstr ""
3018
3019msgid ""
3020"This plugin uses the ping command to probe the specified host for packet loss"
3021msgstr ""
3022
3023msgid ""
3024"(percentage) and round trip average (milliseconds). It can produce HTML "
3025"output"
3026msgstr ""
3027
3028msgid ""
3029"linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"
3030msgstr ""
3031
3032msgid "the contrib area of the downloads section at http://www.nagios.org/"
3033msgstr ""
3034
3035#, c-format
3036msgid "CMD: %s\n"
3037msgstr ""
3038
3039msgid "System call sent warnings to stderr"
3040msgstr ""
3041
3042#, c-format
3043msgid "Not parseable: %s"
3044msgstr ""
3045
3046#, c-format
3047msgid "Unable to read output\n"
3048msgstr ""
3049
3050#, c-format
3051msgid "%d warn out of "
3052msgstr ""
3053
3054#, c-format
3055msgid "%d crit, %d warn out of "
3056msgstr ""
3057
3058#, c-format
3059msgid " with %s"
3060msgstr ""
3061
3062msgid "Parent Process ID must be an integer!"
3063msgstr ""
3064
3065#, c-format
3066msgid "%s%sSTATE = %s"
3067msgstr ""
3068
3069msgid "UID was not found"
3070msgstr ""
3071
3072msgid "User name was not found"
3073msgstr ""
3074
3075#, c-format
3076msgid "%s%scommand name '%s'"
3077msgstr ""
3078
3079#, c-format
3080msgid "%s%sexclude progs '%s'"
3081msgstr ""
3082
3083msgid "RSS must be an integer!"
3084msgstr ""
3085
3086msgid "VSZ must be an integer!"
3087msgstr ""
3088
3089msgid "PCPU must be a float!"
3090msgstr ""
3091
3092msgid "Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"
3093msgstr ""
3094
3095msgid ""
3096"Checks all processes and generates WARNING or CRITICAL states if the "
3097"specified"
3098msgstr ""
3099
3100msgid ""
3101"metric is outside the required threshold ranges. The metric defaults to "
3102"number"
3103msgstr ""
3104
3105msgid ""
3106"of processes. Search filters can be applied to limit the processes to check."
3107msgstr ""
3108
3109msgid "Generate warning state if metric is outside this range"
3110msgstr ""
3111
3112msgid "Generate critical state if metric is outside this range"
3113msgstr ""
3114
3115msgid "Check thresholds against metric. Valid types:"
3116msgstr ""
3117
3118msgid "PROCS - number of processes (default)"
3119msgstr ""
3120
3121msgid "VSZ - virtual memory size"
3122msgstr ""
3123
3124msgid "RSS - resident set memory size"
3125msgstr ""
3126
3127msgid "CPU - percentage CPU"
3128msgstr ""
3129
3130msgid "ELAPSED - time elapsed in seconds"
3131msgstr ""
3132
3133msgid "Extra information. Up to 3 verbosity levels"
3134msgstr ""
3135
3136msgid "Filter own process the traditional way by PID instead of /proc/pid/exe"
3137msgstr ""
3138
3139msgid "Only scan for processes that have, in the output of `ps`, one or"
3140msgstr ""
3141
3142msgid "more of the status flags you specify (for example R, Z, S, RS,"
3143msgstr ""
3144
3145msgid "RSZDT, plus others based on the output of your 'ps' command)."
3146msgstr ""
3147
3148msgid "Only scan for children of the parent process ID indicated."
3149msgstr ""
3150
3151msgid "Only scan for processes with VSZ higher than indicated."
3152msgstr ""
3153
3154msgid "Only scan for processes with RSS higher than indicated."
3155msgstr ""
3156
3157msgid "Only scan for processes with PCPU higher than indicated."
3158msgstr ""
3159
3160msgid "Only scan for processes with user name or ID indicated."
3161msgstr ""
3162
3163msgid "Only scan for processes with args that contain STRING."
3164msgstr ""
3165
3166msgid "Only scan for processes with args that contain the regex STRING."
3167msgstr ""
3168
3169msgid "Only scan for exact matches of COMMAND (without path)."
3170msgstr ""
3171
3172msgid "Exclude processes which match this comma separated list"
3173msgstr ""
3174
3175msgid "Only scan for non kernel threads (works on Linux only)."
3176msgstr ""
3177
3178#, c-format
3179msgid ""
3180"\n"
3181"RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n"
3182"specified 'max:min', a warning status will be generated if the\n"
3183"count is inside the specified range\n"
3184"\n"
3185msgstr ""
3186
3187#, c-format
3188msgid ""
3189"This plugin checks the number of currently running processes and\n"
3190"generates WARNING or CRITICAL states if the process count is outside\n"
3191"the specified threshold ranges. The process count can be filtered by\n"
3192"process owner, parent process PID, current state (e.g., 'Z'), or may\n"
3193"be the total number of running processes\n"
3194"\n"
3195msgstr ""
3196
3197msgid "Warning if not two processes with command name portsentry."
3198msgstr ""
3199
3200msgid "Critical if < 2 or > 1024 processes"
3201msgstr ""
3202
3203msgid "Critical if not at least 1 process with command sshd"
3204msgstr ""
3205
3206msgid "Warning if > 1024 processes with command name sshd."
3207msgstr ""
3208
3209msgid "Critical if < 1 processes with command name sshd."
3210msgstr ""
3211
3212msgid "Warning alert if > 10 processes with command arguments containing"
3213msgstr ""
3214
3215msgid "'/usr/local/bin/perl' and owned by root"
3216msgstr ""
3217
3218msgid "Alert if VSZ of any processes over 50K or 100K"
3219msgstr ""
3220
3221msgid "Alert if CPU of any processes over 10% or 20%"
3222msgstr ""
3223
3224msgid "Config file error\n"
3225msgstr ""
3226
3227msgid "Out of Memory?\n"
3228msgstr ""
3229
3230msgid "Invalid NAS-Identifier\n"
3231msgstr ""
3232
3233#, c-format
3234msgid "gethostname() failed!\n"
3235msgstr ""
3236
3237msgid "Invalid NAS-IP-Address\n"
3238msgstr ""
3239
3240msgid "Timeout\n"
3241msgstr ""
3242
3243msgid "Auth Error\n"
3244msgstr ""
3245
3246msgid "Auth Failed\n"
3247msgstr ""
3248
3249msgid "Bad Response\n"
3250msgstr ""
3251
3252msgid "Auth OK\n"
3253msgstr ""
3254
3255#, c-format
3256msgid "Unexpected result code %d"
3257msgstr ""
3258
3259msgid "Number of retries must be a positive integer"
3260msgstr ""
3261
3262msgid "User not specified"
3263msgstr ""
3264
3265msgid "Password not specified"
3266msgstr ""
3267
3268msgid "Configuration file not specified"
3269msgstr ""
3270
3271msgid "Tests to see if a RADIUS server is accepting connections."
3272msgstr ""
3273
3274msgid "The user to authenticate"
3275msgstr ""
3276
3277msgid "Password for authentication (SECURITY RISK)"
3278msgstr ""
3279
3280msgid "NAS identifier"
3281msgstr ""
3282
3283msgid "NAS IP Address"
3284msgstr ""
3285
3286msgid "Configuration file"
3287msgstr ""
3288
3289msgid "Response string to expect from the server"
3290msgstr ""
3291
3292msgid "Number of times to retry a failed connection"
3293msgstr ""
3294
3295msgid ""
3296"This plugin tests a RADIUS server to see if it is accepting connections."
3297msgstr ""
3298
3299msgid ""
3300"The server to test must be specified in the invocation, as well as a user"
3301msgstr ""
3302
3303msgid "name and password. A configuration file must be present. The format of"
3304msgstr ""
3305
3306msgid ""
3307"the configuration file is described in the radiusclient library sources."
3308msgstr ""
3309
3310msgid "The password option presents a substantial security issue because the"
3311msgstr ""
3312
3313msgid ""
3314"password can possibly be determined by careful watching of the command line"
3315msgstr ""
3316
3317msgid "in a process listing. This risk is exacerbated because the plugin will"
3318msgstr ""
3319
3320msgid ""
3321"typically be executed at regular predictable intervals. Please be sure that"
3322msgstr ""
3323
3324msgid "the password used does not allow access to sensitive system resources."
3325msgstr ""
3326
3327#, c-format
3328msgid "Unable to connect to %s on port %d\n"
3329msgstr ""
3330
3331#, c-format
3332msgid "No data received from %s\n"
3333msgstr ""
3334
3335msgid "Invalid REAL response received from host"
3336msgstr ""
3337
3338#, c-format
3339msgid "Invalid REAL response received from host on port %d\n"
3340msgstr ""
3341
3342#, c-format
3343msgid "No data received from host\n"
3344msgstr ""
3345
3346#, c-format
3347msgid "REAL %s - %d second response time\n"
3348msgstr ""
3349
3350msgid "Warning time must be a positive integer"
3351msgstr ""
3352
3353msgid "Critical time must be a positive integer"
3354msgstr ""
3355
3356msgid "You must provide a server to check"
3357msgstr ""
3358
3359msgid "This plugin tests the REAL service on the specified host."
3360msgstr ""
3361
3362msgid "Connect to this url"
3363msgstr ""
3364
3365#, c-format
3366msgid "String to expect in first line of server response (default: %s)\n"
3367msgstr ""
3368
3369msgid "This plugin will attempt to open an RTSP connection with the host."
3370msgstr ""
3371
3372msgid "Successful connects return STATE_OK, refusals and timeouts return"
3373msgstr ""
3374
3375msgid ""
3376"STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"
3377msgstr ""
3378
3379msgid ""
3380"but incorrect response messages from the host result in STATE_WARNING return"
3381msgstr ""
3382
3383msgid "values."
3384msgstr ""
3385
3386#, c-format
3387msgid "malloc() failed!\n"
3388msgstr ""
3389
3390#, c-format
3391msgid "CRITICAL - Cannot create SSL context.\n"
3392msgstr ""
3393
3394#, c-format
3395msgid "recv() failed\n"
3396msgstr ""
3397
3398#, c-format
3399msgid "WARNING - TLS not supported by server\n"
3400msgstr ""
3401
3402#, c-format
3403msgid "Server does not support STARTTLS\n"
3404msgstr ""
3405
3406msgid "SMTP UNKNOWN - Cannot send EHLO command via TLS."
3407msgstr ""
3408
3409#, c-format
3410msgid "sent %s"
3411msgstr ""
3412
3413msgid "SMTP UNKNOWN - Cannot read EHLO response via TLS."
3414msgstr ""
3415
3416#, c-format
3417msgid "Invalid SMTP response received from host: %s\n"
3418msgstr ""
3419
3420#, c-format
3421msgid "Invalid SMTP response received from host on port %d: %s\n"
3422msgstr ""
3423
3424#, c-format
3425msgid "Could Not Compile Regular Expression"
3426msgstr ""
3427
3428#, c-format
3429msgid "SMTP %s - Invalid response '%s' to command '%s'\n"
3430msgstr ""
3431
3432#, c-format
3433msgid "Execute Error: %s\n"
3434msgstr ""
3435
3436msgid "no authuser specified, "
3437msgstr ""
3438
3439msgid "no authpass specified, "
3440msgstr ""
3441
3442#, c-format
3443msgid "sent %s\n"
3444msgstr ""
3445
3446msgid "recv() failed after AUTH LOGIN, "
3447msgstr ""
3448
3449#, c-format
3450msgid "received %s\n"
3451msgstr ""
3452
3453msgid "invalid response received after AUTH LOGIN, "
3454msgstr ""
3455
3456msgid "recv() failed after sending authuser, "
3457msgstr ""
3458
3459msgid "invalid response received after authuser, "
3460msgstr ""
3461
3462msgid "recv() failed after sending authpass, "
3463msgstr ""
3464
3465msgid "invalid response received after authpass, "
3466msgstr ""
3467
3468msgid "only authtype LOGIN is supported, "
3469msgstr ""
3470
3471#, c-format
3472msgid "SMTP %s - %s%.3f sec. response time%s%s|%s\n"
3473msgstr ""
3474
3475#, c-format
3476msgid "Could not realloc() units [%d]\n"
3477msgstr ""
3478
3479msgid "Critical time must be a positive"
3480msgstr ""
3481
3482msgid "Warning time must be a positive"
3483msgstr ""
3484
3485msgid "SSL support not available - install OpenSSL and recompile"
3486msgstr ""
3487
3488msgid "Set either -s/--ssl/--tls or -S/--starttls"
3489msgstr ""
3490
3491#, c-format
3492msgid "Connection closed by server before sending QUIT command\n"
3493msgstr ""
3494
3495#, c-format
3496msgid "recv() failed after QUIT."
3497msgstr ""
3498
3499#, c-format
3500msgid "Connection reset by peer."
3501msgstr ""
3502
3503msgid "This plugin will attempt to open an SMTP connection with the host."
3504msgstr ""
3505
3506#, c-format
3507msgid " String to expect in first line of server response (default: '%s')\n"
3508msgstr ""
3509
3510msgid "SMTP command (may be used repeatedly)"
3511msgstr ""
3512
3513msgid "Expected response to command (may be used repeatedly)"
3514msgstr ""
3515
3516msgid "FROM-address to include in MAIL command, required by Exchange 2000"
3517msgstr ""
3518
3519msgid "FQDN used for HELO"
3520msgstr ""
3521
3522msgid "Use PROXY protocol prefix for the connection."
3523msgstr ""
3524
3525msgid "Minimum number of days a certificate has to be valid."
3526msgstr ""
3527
3528msgid "Use SSL/TLS for the connection."
3529msgstr ""
3530
3531#, c-format
3532msgid " Sets default port to %d.\n"
3533msgstr ""
3534
3535msgid "Use STARTTLS for the connection."
3536msgstr ""
3537
3538msgid "SMTP AUTH type to check (default none, only LOGIN supported)"
3539msgstr ""
3540
3541msgid "SMTP AUTH username"
3542msgstr ""
3543
3544msgid "SMTP AUTH password"
3545msgstr ""
3546
3547msgid "Send LHLO instead of HELO/EHLO"
3548msgstr ""
3549
3550msgid "Ignore failure when sending QUIT command to server"
3551msgstr ""
3552
3553msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"
3554msgstr ""
3555
3556msgid "connects, but incorrect response messages from the host result in"
3557msgstr ""
3558
3559msgid "STATE_WARNING return values."
3560msgstr ""
3561
3562msgid "Cannot malloc"
3563msgstr ""
3564
3565#, c-format
3566msgid "External command error: %s\n"
3567msgstr ""
3568
3569#, c-format
3570msgid "External command error with no output (return code: %d)\n"
3571msgstr ""
3572
3573#, c-format
3574msgid "No valid data returned (%s)\n"
3575msgstr ""
3576
3577msgid "Time duration between plugin calls is invalid"
3578msgstr ""
3579
3580msgid "Cannot asprintf()"
3581msgstr ""
3582
3583msgid "Cannot realloc()"
3584msgstr ""
3585
3586msgid "No previous data to calculate rate - assume okay"
3587msgstr ""
3588
3589msgid "Retries interval must be a positive integer"
3590msgstr ""
3591
3592msgid "Exit status must be a positive integer"
3593msgstr ""
3594
3595#, c-format
3596msgid "Could not reallocate labels[%d]"
3597msgstr ""
3598
3599msgid "Could not reallocate labels\n"
3600msgstr ""
3601
3602#, c-format
3603msgid "Could not reallocate units [%d]\n"
3604msgstr ""
3605
3606msgid "Could not realloc() units\n"
3607msgstr ""
3608
3609msgid "Rate multiplier must be a positive integer"
3610msgstr ""
3611
3612msgid "No host specified\n"
3613msgstr ""
3614
3615msgid "No OIDs specified\n"
3616msgstr ""
3617
3618#, c-format
3619msgid "Required parameter: %s\n"
3620msgstr ""
3621
3622msgid "Invalid seclevel"
3623msgstr ""
3624
3625msgid "Invalid SNMP version"
3626msgstr ""
3627
3628msgid "Unbalanced quotes\n"
3629msgstr ""
3630
3631#, c-format
3632msgid "multiplier set (%.1f), but input is not a number: %s"
3633msgstr ""
3634
3635msgid "Check status of remote machines and obtain system information via SNMP"
3636msgstr ""
3637
3638msgid "Use SNMP GETNEXT instead of SNMP GET"
3639msgstr ""
3640
3641msgid "SNMP protocol version"
3642msgstr ""
3643
3644msgid "SNMPv3 context"
3645msgstr ""
3646
3647msgid "SNMPv3 securityLevel"
3648msgstr ""
3649
3650msgid "SNMPv3 auth proto"
3651msgstr ""
3652
3653msgid "SNMPv3 priv proto (default DES)"
3654msgstr ""
3655
3656msgid "Optional community string for SNMP communication"
3657msgstr ""
3658
3659msgid "default is"
3660msgstr ""
3661
3662msgid "SNMPv3 username"
3663msgstr ""
3664
3665msgid "SNMPv3 authentication password"
3666msgstr ""
3667
3668msgid "SNMPv3 privacy password"
3669msgstr ""
3670
3671msgid "Object identifier(s) or SNMP variables whose value you wish to query"
3672msgstr ""
3673
3674msgid ""
3675"List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"
3676msgstr ""
3677
3678msgid "for symbolic OIDs.)"
3679msgstr ""
3680
3681msgid "Delimiter to use when parsing returned data. Default is"
3682msgstr ""
3683
3684msgid "Any data on the right hand side of the delimiter is considered"
3685msgstr ""
3686
3687msgid "to be the data that should be used in the evaluation."
3688msgstr ""
3689
3690msgid "If the check returns a 0 length string or NULL value"
3691msgstr ""
3692
3693msgid "This option allows you to choose what status you want it to exit"
3694msgstr ""
3695
3696msgid "Excluding this option renders the default exit of 3(STATE_UNKNOWN)"
3697msgstr ""
3698
3699msgid "0 = OK"
3700msgstr ""
3701
3702msgid "1 = WARNING"
3703msgstr ""
3704
3705msgid "2 = CRITICAL"
3706msgstr ""
3707
3708msgid "3 = UNKNOWN"
3709msgstr ""
3710
3711msgid "Warning threshold range(s)"
3712msgstr ""
3713
3714msgid "Critical threshold range(s)"
3715msgstr ""
3716
3717msgid "Enable rate calculation. See 'Rate Calculation' below"
3718msgstr ""
3719
3720msgid ""
3721"Converts rate per second. For example, set to 60 to convert to per minute"
3722msgstr ""
3723
3724msgid "Add/subtract the specified OFFSET to numeric sensor data"
3725msgstr ""
3726
3727msgid "Return OK state (for that OID) if STRING is an exact match"
3728msgstr ""
3729
3730msgid ""
3731"Return OK state (for that OID) if extended regular expression REGEX matches"
3732msgstr ""
3733
3734msgid ""
3735"Return OK state (for that OID) if case-insensitive extended REGEX matches"
3736msgstr ""
3737
3738msgid "Invert search result (CRITICAL if found)"
3739msgstr ""
3740
3741msgid "Prefix label for output from plugin"
3742msgstr ""
3743
3744msgid "Units label(s) for output data (e.g., 'sec.')."
3745msgstr ""
3746
3747msgid "Separates output on multiple OID requests"
3748msgstr ""
3749
3750msgid "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
3751msgstr ""
3752
3753msgid "C-style format string for float values (see option -M)"
3754msgstr ""
3755
3756msgid ""
3757"NOTE the final timeout value is calculated using this formula: "
3758"timeout_interval * retries + 5"
3759msgstr ""
3760
3761msgid "Number of retries to be used in the requests, default: "
3762msgstr ""
3763
3764msgid "Label performance data with OIDs instead of --label's"
3765msgstr ""
3766
3767msgid "Tell snmpget to not print errors encountered when parsing MIB files"
3768msgstr ""
3769
3770msgid ""
3771"This plugin uses the 'snmpget' command included with the NET-SNMP package."
3772msgstr ""
3773
3774msgid ""
3775"if you don't have the package installed, you will need to download it from"
3776msgstr ""
3777
3778msgid "http://net-snmp.sourceforge.net before you can use this plugin."
3779msgstr ""
3780
3781msgid ""
3782"- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "
3783msgstr ""
3784
3785msgid "list (lists with internal spaces must be quoted)."
3786msgstr ""
3787
3788msgid ""
3789"- When checking multiple OIDs, separate ranges by commas like '-w "
3790"1:10,1:,:20'"
3791msgstr ""
3792
3793msgid "- Note that only one string and one regex may be checked at present"
3794msgstr ""
3795
3796msgid ""
3797"- All evaluation methods other than PR, STR, and SUBSTR expect that the value"
3798msgstr ""
3799
3800msgid "returned from the SNMP query is an unsigned integer."
3801msgstr ""
3802
3803msgid "Rate Calculation:"
3804msgstr ""
3805
3806msgid "In many places, SNMP returns counters that are only meaningful when"
3807msgstr ""
3808
3809msgid "calculating the counter difference since the last check. check_snmp"
3810msgstr ""
3811
3812msgid "saves the last state information in a file so that the rate per second"
3813msgstr ""
3814
3815msgid "can be calculated. Use the --rate option to save state information."
3816msgstr ""
3817
3818msgid ""
3819"On the first run, there will be no prior state - this will return with OK."
3820msgstr ""
3821
3822msgid "The state is uniquely determined by the arguments to the plugin, so"
3823msgstr ""
3824
3825msgid "changing the arguments will create a new state file."
3826msgstr ""
3827
3828msgid "Port number must be a positive integer"
3829msgstr ""
3830
3831#, c-format
3832msgid "Server answer: %s"
3833msgstr ""
3834
3835#, c-format
3836msgid "SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"
3837msgstr ""
3838
3839#, c-format
3840msgid ""
3841"SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"
3842msgstr ""
3843
3844#, c-format
3845msgid "SSH OK - %s (protocol %s) | %s\n"
3846msgstr ""
3847
3848msgid "Try to connect to an SSH server at specified server and port"
3849msgstr ""
3850
3851msgid ""
3852"Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
3853msgstr ""
3854
3855msgid "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
3856msgstr ""
3857
3858#, c-format
3859msgid "Command: %s\n"
3860msgstr ""
3861
3862#, c-format
3863msgid "Format: %s\n"
3864msgstr ""
3865
3866#, c-format
3867msgid "total=%.0f, used=%.0f, free=%.0f\n"
3868msgstr ""
3869
3870#, c-format
3871msgid "total=%.0f, free=%.0f\n"
3872msgstr ""
3873
3874msgid "Error getting swap devices\n"
3875msgstr ""
3876
3877msgid "SWAP OK: No swap devices defined\n"
3878msgstr ""
3879
3880msgid "swapctl failed: "
3881msgstr ""
3882
3883msgid "Error in swapctl call\n"
3884msgstr ""
3885
3886#, c-format
3887msgid "SWAP %s - %d%% free (%dMB out of %dMB) %s|"
3888msgstr ""
3889
3890msgid "Warning threshold percentage must be <= 100!"
3891msgstr ""
3892
3893msgid "Warning threshold be positive integer or percentage!"
3894msgstr ""
3895
3896msgid "Critical threshold percentage must be <= 100!"
3897msgstr ""
3898
3899msgid "Critical threshold be positive integer or percentage!"
3900msgstr ""
3901
3902msgid ""
3903"no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
3904"or integer (0-3)."
3905msgstr ""
3906
3907msgid "Warning should be more than critical"
3908msgstr ""
3909
3910msgid "Check swap space on local machine."
3911msgstr ""
3912
3913msgid ""
3914"Exit with WARNING status if less than INTEGER bytes of swap space are free"
3915msgstr ""
3916
3917msgid "Exit with WARNING status if less than PERCENT of swap space is free"
3918msgstr ""
3919
3920msgid ""
3921"Exit with CRITICAL status if less than INTEGER bytes of swap space are free"
3922msgstr ""
3923
3924msgid "Exit with CRITICAL status if less than PERCENT of swap space is free"
3925msgstr ""
3926
3927msgid "Conduct comparisons for all swap partitions, one by one"
3928msgstr ""
3929
3930msgid ""
3931"Resulting state when there is no swap regardless of thresholds. Default:"
3932msgstr ""
3933
3934msgid ""
3935"Both INTEGER and PERCENT thresholds can be specified, they are all checked."
3936msgstr ""
3937
3938msgid "On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."
3939msgstr ""
3940
3941msgid "CRITICAL - Generic check_tcp called with unknown service\n"
3942msgstr ""
3943
3944msgid "With UDP checks, a send/expect string must be specified."
3945msgstr ""
3946
3947msgid "No arguments found"
3948msgstr ""
3949
3950msgid "Maxbytes must be a positive integer"
3951msgstr ""
3952
3953msgid "Refuse must be one of ok, warn, crit"
3954msgstr ""
3955
3956msgid "Mismatch must be one of ok, warn, crit"
3957msgstr ""
3958
3959msgid "Delay must be a positive integer"
3960msgstr ""
3961
3962msgid "You must provide a server address"
3963msgstr ""
3964
3965msgid "Invalid hostname, address or socket"
3966msgstr ""
3967
3968#, c-format
3969msgid ""
3970"This plugin tests %s connections with the specified host (or unix socket).\n"
3971"\n"
3972msgstr ""
3973
3974msgid ""
3975"Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send "
3976"or quit option"
3977msgstr ""
3978
3979msgid "Default: nothing added to send, \\r\\n added to end of quit"
3980msgstr ""
3981
3982msgid "String to send to the server"
3983msgstr ""
3984
3985msgid "String to expect in server response"
3986msgstr ""
3987
3988msgid "(may be repeated)"
3989msgstr ""
3990
3991msgid "All expect strings need to occur in server response. Default is any"
3992msgstr ""
3993
3994msgid "String to send server to initiate a clean close of the connection"
3995msgstr ""
3996
3997msgid "Accept TCP refusals with states ok, warn, crit (default: crit)"
3998msgstr ""
3999
4000msgid ""
4001"Accept expected string mismatches with states ok, warn, crit (default: warn)"
4002msgstr ""
4003
4004msgid "Hide output from TCP socket"
4005msgstr ""
4006
4007msgid "Close connection once more than this number of bytes are received"
4008msgstr ""
4009
4010msgid "Seconds to wait between sending string and polling for response"
4011msgstr ""
4012
4013msgid "1st is #days for warning, 2nd is critical (if not specified - 0)."
4014msgstr ""
4015
4016msgid "Use SSL for the connection."
4017msgstr ""
4018
4019msgid "SSL server_name"
4020msgstr ""
4021
4022#, c-format
4023msgid "TIME UNKNOWN - could not connect to server %s, port %d\n"
4024msgstr ""
4025
4026#, c-format
4027msgid "TIME UNKNOWN - could not send UDP request to server %s, port %d\n"
4028msgstr ""
4029
4030#, c-format
4031msgid "TIME UNKNOWN - no data received from server %s, port %d\n"
4032msgstr ""
4033
4034#, c-format
4035msgid "TIME %s - %d second response time|%s\n"
4036msgstr ""
4037
4038#, c-format
4039msgid "TIME %s - %lu second time difference|%s %s\n"
4040msgstr ""
4041
4042msgid "Warning thresholds must be a positive integer"
4043msgstr ""
4044
4045msgid "Critical thresholds must be a positive integer"
4046msgstr ""
4047
4048msgid "This plugin will check the time on the specified host."
4049msgstr ""
4050
4051msgid "Use UDP to connect, not TCP"
4052msgstr ""
4053
4054msgid "Time difference (sec.) necessary to result in a warning status"
4055msgstr ""
4056
4057msgid "Time difference (sec.) necessary to result in a critical status"
4058msgstr ""
4059
4060msgid "Response time (sec.) necessary to result in warning status"
4061msgstr ""
4062
4063msgid "Response time (sec.) necessary to result in critical status"
4064msgstr ""
4065
4066msgid "On Battery, Low Battery"
4067msgstr ""
4068
4069msgid "Online"
4070msgstr ""
4071
4072msgid "On Battery"
4073msgstr ""
4074
4075msgid ", Low Battery"
4076msgstr ""
4077
4078msgid ", Calibrating"
4079msgstr ""
4080
4081msgid ", Replace Battery"
4082msgstr ""
4083
4084msgid ", On Bypass"
4085msgstr ""
4086
4087msgid ", Overload"
4088msgstr ""
4089
4090msgid ", Trimming"
4091msgstr ""
4092
4093msgid ", Boosting"
4094msgstr ""
4095
4096msgid ", Charging"
4097msgstr ""
4098
4099msgid ", Discharging"
4100msgstr ""
4101
4102msgid ", Unknown"
4103msgstr ""
4104
4105msgid "UPS does not support any available options\n"
4106msgstr ""
4107
4108msgid "Invalid response received from host"
4109msgstr ""
4110
4111msgid "UPS name to long for buffer"
4112msgstr ""
4113
4114#, c-format
4115msgid "CRITICAL - no such UPS '%s' on that host\n"
4116msgstr ""
4117
4118msgid "CRITICAL - UPS data is stale"
4119msgstr ""
4120
4121#, c-format
4122msgid "Unknown error: %s\n"
4123msgstr ""
4124
4125msgid "Error: unable to parse variable"
4126msgstr ""
4127
4128msgid "Unrecognized UPS variable"
4129msgstr ""
4130
4131msgid "Error : no UPS indicated"
4132msgstr ""
4133
4134msgid ""
4135"This plugin tests the UPS service on the specified host. Network UPS Tools"
4136msgstr ""
4137
4138msgid "from www.networkupstools.org must be running for this plugin to work."
4139msgstr ""
4140
4141msgid "Name of UPS"
4142msgstr ""
4143
4144msgid "Output of temperatures in Celsius"
4145msgstr ""
4146
4147msgid "Valid values for STRING are"
4148msgstr ""
4149
4150msgid ""
4151"This plugin attempts to determine the status of a UPS (Uninterruptible Power"
4152msgstr ""
4153
4154msgid ""
4155"Supply) on a local or remote host. If the UPS is online or calibrating, the"
4156msgstr ""
4157
4158msgid ""
4159"plugin will return an OK state. If the battery is on it will return a WARNING"
4160msgstr ""
4161
4162msgid ""
4163"state. If the UPS is off or has a low battery the plugin will return a "
4164"CRITICAL"
4165msgstr ""
4166
4167msgid ""
4168"You may also specify a variable to check (such as temperature, utility "
4169"voltage,"
4170msgstr ""
4171
4172msgid ""
4173"battery load, etc.) as well as warning and critical thresholds for the value"
4174msgstr ""
4175
4176msgid ""
4177"of that variable. If the remote host has multiple UPS that are being "
4178"monitored"
4179msgstr ""
4180
4181msgid "you will have to use the --ups option to specify which UPS to check."
4182msgstr ""
4183
4184msgid ""
4185"This plugin requires that the UPSD daemon distributed with Russell Kroll's"
4186msgstr ""
4187
4188msgid ""
4189"Network UPS Tools be installed on the remote host. If you do not have the"
4190msgstr ""
4191
4192msgid "package installed on your system, you can download it from"
4193msgstr ""
4194
4195msgid "http://www.networkupstools.org"
4196msgstr ""
4197
4198#, c-format
4199msgid "Could not enumerate RD sessions: %d\n"
4200msgstr ""
4201
4202#, c-format
4203msgid "# users=%d"
4204msgstr ""
4205
4206msgid "Unable to read output"
4207msgstr ""
4208
4209#, c-format
4210msgid "USERS %s - %d users currently logged in |%s\n"
4211msgstr ""
4212
4213msgid "This plugin checks the number of users currently logged in on the local"
4214msgstr ""
4215
4216msgid ""
4217"system and generates an error if the number exceeds the thresholds specified."
4218msgstr ""
4219
4220msgid "Set WARNING status if more than INTEGER users are logged in"
4221msgstr ""
4222
4223msgid "Set CRITICAL status if more than INTEGER users are logged in"
4224msgstr ""
4225
4226msgid ""
4227"DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."
4228msgstr ""
4229
4230msgid "Nagios-compatible output is now always returned."
4231msgstr ""
4232
4233msgid "SMART commands are broken and have been disabled (See Notes in --help)."
4234msgstr ""
4235
4236msgid ""
4237"DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"
4238msgstr ""
4239
4240msgid "default and will be removed from future releases."
4241msgstr ""
4242
4243#, c-format
4244msgid "CRITICAL - Couldn't open device %s: %s\n"
4245msgstr ""
4246
4247#, c-format
4248msgid "CRITICAL - SMART_CMD_ENABLE\n"
4249msgstr ""
4250
4251#, c-format
4252msgid "CRITICAL - SMART_READ_VALUES: %s\n"
4253msgstr ""
4254
4255#, c-format
4256msgid "CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"
4257msgstr ""
4258
4259#, c-format
4260msgid "WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"
4261msgstr ""
4262
4263#, c-format
4264msgid "OK - Operational (%d/%d tests passed)\n"
4265msgstr ""
4266
4267#, c-format
4268msgid "ERROR - Status '%d' unknown. %d/%d tests passed\n"
4269msgstr ""
4270
4271#, c-format
4272msgid "OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"
4273msgstr ""
4274
4275#, c-format
4276msgid "OffLineCapability=%d {%s %s %s}\n"
4277msgstr ""
4278
4279#, c-format
4280msgid "SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"
4281msgstr ""
4282
4283#, c-format
4284msgid "CRITICAL - %s: %s\n"
4285msgstr ""
4286
4287#, c-format
4288msgid "OK - Command sent (%s)\n"
4289msgstr ""
4290
4291#, c-format
4292msgid "CRITICAL - SMART_READ_THRESHOLDS: %s\n"
4293msgstr ""
4294
4295#, c-format
4296msgid ""
4297"This plugin checks a local hard drive with the (Linux specific) SMART "
4298"interface [http://smartlinux.sourceforge.net/smart/index.php]."
4299msgstr ""
4300
4301msgid "Select device DEVICE"
4302msgstr ""
4303
4304msgid ""
4305"Note: if the device is specified without this option, any further option will"
4306msgstr ""
4307
4308msgid "be ignored."
4309msgstr ""
4310
4311msgid ""
4312"The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"
4313msgstr ""
4314
4315msgid ""
4316"broken in an underhand manner and have been disabled. You can use smartctl"
4317msgstr ""
4318
4319msgid "instead:"
4320msgstr ""
4321
4322msgid "-0/--auto-off: use \"smartctl --offlineauto=off\""
4323msgstr ""
4324
4325msgid "-1/--auto-on: use \"smartctl --offlineauto=on\""
4326msgstr ""
4327
4328msgid "-i/--immediate: use \"smartctl --test=offline\""
4329msgstr ""
4330
4331msgid "No data returned from command\n"
4332msgstr ""
4333
4334msgid ""
4335"Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
4336"or integer (0-3)."
4337msgstr ""
4338
4339msgid ""
4340"Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer "
4341"(0-3)."
4342msgstr ""
4343
4344msgid ""
4345"Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4346"integer (0-3)."
4347msgstr ""
4348
4349msgid ""
4350"Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4351"integer (0-3)."
4352msgstr ""
4353
4354msgid ""
4355"Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
4356"integer (0-3)."
4357msgstr ""
4358
4359msgid "Require path to command"
4360msgstr ""
4361
4362msgid ""
4363"Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."
4364msgstr ""
4365
4366msgid "Additional switches can be used to control which state becomes what."
4367msgstr ""
4368
4369msgid "Keep timeout longer than the plugin timeout to retain CRITICAL status."
4370msgstr ""
4371
4372msgid "Custom result on Negate timeouts; see below for STATUS definition\n"
4373msgstr ""
4374
4375#, c-format
4376msgid ""
4377" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"
4378msgstr ""
4379
4380#, c-format
4381msgid ""
4382" quotes. Numeric values are accepted. If nothing is specified, permutes\n"
4383msgstr ""
4384
4385#, c-format
4386msgid " OK and CRITICAL.\n"
4387msgstr ""
4388
4389#, c-format
4390msgid ""
4391" Substitute output text as well. Will only substitute text in CAPITALS\n"
4392msgstr ""
4393
4394msgid "Run check_ping and invert result. Must use full path to plugin"
4395msgstr ""
4396
4397msgid "This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"
4398msgstr ""
4399
4400msgid ""
4401"This plugin is a wrapper to take the output of another plugin and invert it."
4402msgstr ""
4403
4404msgid "The full path of the plugin must be provided."
4405msgstr ""
4406
4407msgid "If the wrapped plugin returns OK, the wrapper will return CRITICAL."
4408msgstr ""
4409
4410msgid "If the wrapped plugin returns CRITICAL, the wrapper will return OK."
4411msgstr ""
4412
4413msgid "Otherwise, the output state of the wrapped plugin is unchanged."
4414msgstr ""
4415
4416msgid ""
4417"Using timeout-result, it is possible to override the timeout behaviour or a"
4418msgstr ""
4419
4420msgid "plugin by setting the negate timeout a bit lower."
4421msgstr ""
4422
4423#, c-format
4424msgid "%s - Socket timeout after %d seconds\n"
4425msgstr ""
4426
4427#, c-format
4428msgid "%s - Abnormal timeout after %d seconds\n"
4429msgstr ""
4430
4431msgid "Send failed"
4432msgstr ""
4433
4434msgid "No data was received from host!"
4435msgstr ""
4436
4437msgid "Socket creation failed"
4438msgstr ""
4439
4440msgid "Supplied path too long unix domain socket"
4441msgstr ""
4442
4443msgid "Receive failed"
4444msgstr ""
4445
4446#, c-format
4447msgid "Invalid hostname/address - %s"
4448msgstr ""
4449
4450msgid "Could not malloc argv array in popen()"
4451msgstr ""
4452
4453msgid "CRITICAL - You need more args!!!"
4454msgstr ""
4455
4456msgid "Cannot catch SIGCHLD"
4457msgstr ""
4458
4459#, c-format
4460msgid "CRITICAL - Plugin timed out after %d seconds\n"
4461msgstr ""
4462
4463msgid "CRITICAL - popen timeout received, but no child process"
4464msgstr ""
4465
4466#, c-format
4467msgid ""
4468"%s UNKNOWN - No data received from host\n"
4469"CMD: %s</A>\n"
4470msgstr ""
4471
4472msgid ""
4473"This plugin wraps the text output of another command (plugin) in HTML <A>"
4474msgstr ""
4475
4476msgid ""
4477"tags, thus displaying the child plugin's output as a clickable link in "
4478"compatible"
4479msgstr ""
4480
4481msgid ""
4482"monitoring status screen. This plugin returns the status of the invoked "
4483"plugin."
4484msgstr ""
4485
4486msgid ""
4487"Pay close attention to quoting to ensure that the shell passes the expected"
4488msgstr ""
4489
4490msgid "data to the plugin. For example, in:"
4491msgstr ""
4492
4493msgid "urlize http://example.com/ check_http -H example.com -r 'two words'"
4494msgstr ""
4495
4496msgid "the shell will remove the single quotes and urlize will see:"
4497msgstr ""
4498
4499msgid "urlize http://example.com/ check_http -H example.com -r two words"
4500msgstr ""
4501
4502msgid "You probably want:"
4503msgstr ""
4504
4505msgid "urlize http://example.com/ \"check_http -H example.com -r 'two words'\""
4506msgstr ""
4507
4508msgid "failed realloc in strpcpy\n"
4509msgstr ""
4510
4511msgid "failed malloc in strscat\n"
4512msgstr ""
4513
4514msgid "failed malloc in xvasprintf\n"
4515msgstr ""
4516
4517msgid "sysconf error for _SC_OPEN_MAX\n"
4518msgstr ""
4519
4520#, c-format
4521msgid ""
4522" %s (-h | --help) for detailed help\n"
4523" %s (-V | --version) for version information\n"
4524msgstr ""
4525
4526msgid ""
4527"\n"
4528"Options:\n"
4529" -h, --help\n"
4530" Print detailed help screen\n"
4531" -V, --version\n"
4532" Print version information\n"
4533msgstr ""
4534
4535#, c-format
4536msgid ""
4537" -H, --hostname=ADDRESS\n"
4538" Host name, IP Address, or unix socket (must be an absolute path)\n"
4539" -%c, --port=INTEGER\n"
4540" Port number (default: %s)\n"
4541msgstr ""
4542
4543msgid ""
4544" -4, --use-ipv4\n"
4545" Use IPv4 connection\n"
4546" -6, --use-ipv6\n"
4547" Use IPv6 connection\n"
4548msgstr ""
4549
4550msgid ""
4551" -v, --verbose\n"
4552" Show details for command-line debugging (output may be truncated by\n"
4553" the monitoring system)\n"
4554msgstr ""
4555
4556msgid ""
4557" -w, --warning=DOUBLE\n"
4558" Response time to result in warning status (seconds)\n"
4559" -c, --critical=DOUBLE\n"
4560" Response time to result in critical status (seconds)\n"
4561msgstr ""
4562
4563msgid ""
4564" -w, --warning=RANGE\n"
4565" Warning range (format: start:end). Alert if outside this range\n"
4566" -c, --critical=RANGE\n"
4567" Critical range\n"
4568msgstr ""
4569
4570#, c-format
4571msgid ""
4572" -t, --timeout=INTEGER\n"
4573" Seconds before connection times out (default: %d)\n"
4574msgstr ""
4575
4576#, c-format
4577msgid ""
4578" -t, --timeout=INTEGER\n"
4579" Seconds before plugin times out (default: %d)\n"
4580msgstr ""
4581
4582msgid ""
4583" --extra-opts=[section][@file]\n"
4584" Read options from an ini file. See\n"
4585" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
4586" for usage and examples.\n"
4587msgstr ""
4588
4589msgid ""
4590" See:\n"
4591" https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"
4592" for THRESHOLD format and examples.\n"
4593msgstr ""
4594
4595msgid ""
4596"\n"
4597"Send email to help@monitoring-plugins.org if you have questions regarding\n"
4598"use of this software. To submit patches or suggest improvements, send email\n"
4599"to devel@monitoring-plugins.org\n"
4600"\n"
4601msgstr ""
4602
4603msgid ""
4604"\n"
4605"The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may "
4606"redistribute\n"
4607"copies of the plugins under the terms of the GNU General Public License.\n"
4608"For more information about these matters, see the file named COPYING.\n"
4609msgstr ""
4610
4611#, c-format
4612msgid "Error: Could not get hardware address of interface '%s'\n"
4613msgstr ""
4614
4615#, c-format
4616msgid "Error: if_nametoindex error - %s.\n"
4617msgstr ""
4618
4619#, c-format
4620msgid "Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"
4621msgstr ""
4622
4623#, c-format
4624msgid ""
4625"Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"
4626msgstr ""
4627
4628#, c-format
4629msgid "Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"
4630msgstr ""
4631
4632#, c-format
4633msgid ""
4634"Error: can't find unit number in interface_name (%s) - expecting TypeNumber "
4635"eg lnc0.\n"
4636msgstr ""
4637
4638#, c-format
4639msgid ""
4640"Error: can't read MAC address from DLPI streams interface for device %s unit "
4641"%d.\n"
4642msgstr ""
4643
4644#, c-format
4645msgid ""
4646"Error: can't get MAC address for this architecture. Use the --mac option.\n"
4647msgstr ""
4648
4649#, c-format
4650msgid "Error: Cannot determine IP address of interface %s\n"
4651msgstr ""
4652
4653#, c-format
4654msgid "Error: Cannot get interface IP address on this platform.\n"
4655msgstr ""
4656
4657#, c-format
4658msgid "Pretending to be relay client %s\n"
4659msgstr ""
4660
4661#, c-format
4662msgid "DHCPDISCOVER to %s port %d\n"
4663msgstr ""
4664
4665#, c-format
4666msgid "Result=ERROR\n"
4667msgstr ""
4668
4669#, c-format
4670msgid "Result=OK\n"
4671msgstr ""
4672
4673#, c-format
4674msgid "DHCPOFFER from IP address %s"
4675msgstr ""
4676
4677#, c-format
4678msgid " via %s\n"
4679msgstr ""
4680
4681#, c-format
4682msgid ""
4683"DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"
4684msgstr ""
4685
4686#, c-format
4687msgid "DHCPOFFER hardware address did not match our own - ignoring packet\n"
4688msgstr ""
4689
4690#, c-format
4691msgid "Total responses seen on the wire: %d\n"
4692msgstr ""
4693
4694#, c-format
4695msgid "Valid responses for this machine: %d\n"
4696msgstr ""
4697
4698#, c-format
4699msgid "send_dhcp_packet result: %d\n"
4700msgstr ""
4701
4702#, c-format
4703msgid "No (more) data received (nfound: %d)\n"
4704msgstr ""
4705
4706#, c-format
4707msgid "recvfrom() failed, "
4708msgstr ""
4709
4710#, c-format
4711msgid "receive_dhcp_packet() result: %d\n"
4712msgstr ""
4713
4714#, c-format
4715msgid "receive_dhcp_packet() source: %s\n"
4716msgstr ""
4717
4718#, c-format
4719msgid "Error: Could not create socket!\n"
4720msgstr ""
4721
4722#, c-format
4723msgid "Error: Could not set reuse address option on DHCP socket!\n"
4724msgstr ""
4725
4726#, c-format
4727msgid "Error: Could not set broadcast option on DHCP socket!\n"
4728msgstr ""
4729
4730#, c-format
4731msgid ""
4732"Error: Could not bind socket to interface %s. Check your privileges...\n"
4733msgstr ""
4734
4735#, c-format
4736msgid ""
4737"Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"
4738msgstr ""
4739
4740#, c-format
4741msgid "Requested server address: %s\n"
4742msgstr ""
4743
4744#, c-format
4745msgid "Lease Time: Infinite\n"
4746msgstr ""
4747
4748#, c-format
4749msgid "Lease Time: %lu seconds\n"
4750msgstr ""
4751
4752#, c-format
4753msgid "Renewal Time: Infinite\n"
4754msgstr ""
4755
4756#, c-format
4757msgid "Renewal Time: %lu seconds\n"
4758msgstr ""
4759
4760#, c-format
4761msgid "Rebinding Time: Infinite\n"
4762msgstr ""
4763
4764#, c-format
4765msgid "Rebinding Time: %lu seconds\n"
4766msgstr ""
4767
4768#, c-format
4769msgid "Added offer from server @ %s"
4770msgstr ""
4771
4772#, c-format
4773msgid " of IP address %s\n"
4774msgstr ""
4775
4776#, c-format
4777msgid "DHCP Server Match: Offerer=%s"
4778msgstr ""
4779
4780#, c-format
4781msgid " Requested=%s"
4782msgstr ""
4783
4784#, c-format
4785msgid " (duplicate)"
4786msgstr ""
4787
4788#, c-format
4789msgid "\n"
4790msgstr ""
4791
4792#, c-format
4793msgid "No DHCPOFFERs were received.\n"
4794msgstr ""
4795
4796#, c-format
4797msgid "Received %d DHCPOFFER(s)"
4798msgstr ""
4799
4800#, c-format
4801msgid ", %s%d of %d requested servers responded"
4802msgstr ""
4803
4804#, c-format
4805msgid ", requested address (%s) was %soffered"
4806msgstr ""
4807
4808msgid "not "
4809msgstr ""
4810
4811#, c-format
4812msgid ", max lease time = "
4813msgstr ""
4814
4815#, c-format
4816msgid "Infinity"
4817msgstr ""
4818
4819msgid "Got unexpected non-option argument"
4820msgstr ""
4821
4822#, c-format
4823msgid "Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"
4824msgstr ""
4825
4826#, c-format
4827msgid "Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"
4828msgstr ""
4829
4830#, c-format
4831msgid "Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"
4832msgstr ""
4833
4834#, c-format
4835msgid ""
4836"Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"
4837msgstr ""
4838
4839#, c-format
4840msgid "Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"
4841msgstr ""
4842
4843#, c-format
4844msgid "Hardware address: "
4845msgstr ""
4846
4847msgid "This plugin tests the availability of DHCP servers on a network."
4848msgstr ""
4849
4850msgid "IP address of DHCP server that we must hear from"
4851msgstr ""
4852
4853msgid "IP address that should be offered by at least one DHCP server"
4854msgstr ""
4855
4856msgid "Seconds to wait for DHCPOFFER before timeout occurs"
4857msgstr ""
4858
4859msgid "Interface to to use for listening (i.e. eth0)"
4860msgstr ""
4861
4862msgid "MAC address to use in the DHCP request"
4863msgstr ""
4864
4865msgid "Unicast testing: mimic a DHCP relay, requires -s"
4866msgstr ""
4867
4868msgid "specify a target"
4869msgstr ""
4870
4871msgid "Use IPv4 (default) or IPv6 to communicate with the targets"
4872msgstr ""
4873
4874msgid "warning threshold (currently "
4875msgstr ""
4876
4877msgid "critical threshold (currently "
4878msgstr ""
4879
4880msgid "specify a source IP address or device name"
4881msgstr ""
4882
4883msgid "number of packets to send (currently "
4884msgstr ""
4885
4886msgid "max packet interval (currently "
4887msgstr ""
4888
4889msgid "max target interval (currently "
4890msgstr ""
4891
4892msgid "number of alive hosts required for success"
4893msgstr ""
4894
4895msgid "TTL on outgoing packets (currently "
4896msgstr ""
4897
4898msgid "timeout value (seconds, currently "
4899msgstr ""
4900
4901msgid "Number of icmp data bytes to send"
4902msgstr ""
4903
4904msgid "Packet size will be data bytes + icmp header (currently"
4905msgstr ""
4906
4907msgid "verbose"
4908msgstr ""
4909
4910msgid "The -H switch is optional. Naming a host (or several) to check is not."
4911msgstr ""
4912
4913msgid ""
4914"Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"
4915msgstr ""
4916
4917msgid "packet loss. The default values should work well for most users."
4918msgstr ""
4919
4920msgid ""
4921"You can specify different RTA factors using the standardized abbreviations"
4922msgstr ""
4923
4924msgid ""
4925"us (microseconds), ms (milliseconds, default) or just plain s for seconds."
4926msgstr ""
4927
4928msgid "The -v switch can be specified several times for increased verbosity."
4929msgstr ""
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
deleted file mode 100644
index 2436c49..0000000
--- a/po/remove-potcdate.sin
+++ /dev/null
@@ -1,19 +0,0 @@
1# Sed script that remove the POT-Creation-Date line in the header entry
2# from a POT file.
3#
4# The distinction between the first and the following occurrences of the
5# pattern is achieved by looking at the hold space.
6/^"POT-Creation-Date: .*"$/{
7x
8# Test if the hold space is empty.
9s/P/P/
10ta
11# Yes it was empty. First occurrence. Remove the line.
12g
13d
14bb
15:a
16# The hold space was nonempty. Following occurrences. Do nothing.
17x
18:b
19}