aboutsummaryrefslogtreecommitdiff
path: root/naemon
diff options
context:
space:
mode:
Diffstat (limited to 'naemon')
-rw-r--r--naemon/.SRCINFO31
-rw-r--r--naemon/PKGBUILD86
-rw-r--r--naemon/naemon-tmpfiles.conf9
-rw-r--r--naemon/naemon.install21
-rw-r--r--naemon/naemon.service18
-rw-r--r--naemon/overflow.patch137
6 files changed, 302 insertions, 0 deletions
diff --git a/naemon/.SRCINFO b/naemon/.SRCINFO
new file mode 100644
index 0000000..cb32b77
--- /dev/null
+++ b/naemon/.SRCINFO
@@ -0,0 +1,31 @@
1pkgbase = naemon
2 pkgdesc = System and network monitoring application
3 pkgver = 1.0.10
4 pkgrel = 1
5 url = http://naemon.org
6 install = naemon.install
7 arch = i686
8 arch = x86_64
9 license = GPL2
10 makedepends = gperf
11 makedepends = help2man
12 depends = icu
13 depends = glib2
14 optdepends = logrotate
15 optdepends = thruk: Web interface for Naemon
16 optdepends = naemon-livestatus: Event broker
17 optdepends = monitoring-plugins
18 backup = etc/logrotate.d/naemon
19 backup = etc/naemon/naemon.cfg
20 backup = etc/naemon/resource.cfg
21 source = naemon-git::git+https://github.com/naemon/naemon-core.git#commit=c2a8730538846f342911764cd7731015f1a6f284
22 source = naemon-tmpfiles.conf
23 source = naemon.service
24 source = overflow.patch
25 sha512sums = SKIP
26 sha512sums = 756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d
27 sha512sums = 28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2
28 sha512sums = ec1ccf09f8c02e8f6dfdf2f6b80eed4b3e07df85703d89bdfdefe0bd9380b832a7f9a1c2976f17f55d74dbb3b1888ae28bf0551c78cb8bbc3acb08cd1e4a85da
29
30pkgname = naemon
31
diff --git a/naemon/PKGBUILD b/naemon/PKGBUILD
new file mode 100644
index 0000000..63aa98c
--- /dev/null
+++ b/naemon/PKGBUILD
@@ -0,0 +1,86 @@
1# Maintainer: Immae <ismael.bouya@normalesup.org>
2# Contributor: Jonathan Steel <jsteel at archlinux.org>
3
4pkgname=naemon
5pkgver=1.0.10
6pkgrel=1
7pkgdesc="System and network monitoring application"
8arch=('i686' 'x86_64')
9url="http://naemon.org"
10license=('GPL2')
11depends=('icu' 'glib2')
12optdepends=('logrotate'
13 'thruk: Web interface for Naemon'
14 'naemon-livestatus: Event broker'
15 'monitoring-plugins')
16makedepends=('gperf' 'help2man')
17source=("naemon-git::git+https://github.com/naemon/naemon-core.git#commit=c2a8730538846f342911764cd7731015f1a6f284"
18 $pkgname-tmpfiles.conf
19 $pkgname.service
20 overflow.patch)
21sha512sums=('SKIP'
22 '756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d'
23 '28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2'
24 'ec1ccf09f8c02e8f6dfdf2f6b80eed4b3e07df85703d89bdfdefe0bd9380b832a7f9a1c2976f17f55d74dbb3b1888ae28bf0551c78cb8bbc3acb08cd1e4a85da')
25backup=('etc/logrotate.d/naemon'
26 'etc/naemon/naemon.cfg'
27 'etc/naemon/resource.cfg')
28install=$pkgname.install
29
30build() {
31 cd "$srcdir/$pkgname-git"
32
33 patch -p1 < $srcdir/overflow.patch
34 ./autogen.sh
35 ./configure --prefix=/usr \
36 --bindir=/usr/bin \
37 --datadir="/usr/share/naemon" \
38 --libdir="/usr/lib/naemon" \
39 --localstatedir="/var/lib/naemon" \
40 --sysconfdir="/etc/naemon" \
41 --with-pkgconfdir="/etc/naemon" \
42 --mandir="/usr/share/man" \
43 --with-pluginsdir="/usr/lib/monitoring-plugins" \
44 --with-tempdir="/var/cache/naemon" \
45 --with-checkresultdir="/var/cache/naemon/checkresults" \
46 --with-logdir="/var/log/naemon" \
47 --with-initdir="/etc/init.d" \
48 --with-logrotatedir="/etc/logrotate.d" \
49 --with-naemon-user="naemon" \
50 --with-naemon-group="naemon" \
51 --with-lockfile="/run/naemon/naemon.pid"
52
53 make
54}
55
56check() {
57 cd "$srcdir/$pkgname-git"
58
59 # One of the tests fail for some reason, upstream notified.
60 make check || true
61}
62
63package() {
64 cd "$srcdir/$pkgname-git"
65
66 make DESTDIR="$pkgdir" install
67
68 install -d "$pkgdir"/etc/naemon/module-conf.d
69
70 rm -rf "$pkgdir"/var/{cache,log}
71
72 install -dm755 "$pkgdir"/var/lib/naemon
73 install -Dm644 "$srcdir"/$pkgname.service \
74 "$pkgdir"/usr/lib/systemd/system/$pkgname.service
75
76 # Move sample config files
77 install -dm755 "$pkgdir"/usr/share/doc/naemon
78 mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/usr/share/doc/naemon/
79 install -d "$pkgdir"/etc/naemon/conf.d/templates
80
81 # Remove non-Arch directories
82 rm -rf "$pkgdir"/etc/init.d
83 rm -rf "$pkgdir"/etc/apache2
84
85 install -Dm644 "$srcdir"/naemon-tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf
86}
diff --git a/naemon/naemon-tmpfiles.conf b/naemon/naemon-tmpfiles.conf
new file mode 100644
index 0000000..a7d9d86
--- /dev/null
+++ b/naemon/naemon-tmpfiles.conf
@@ -0,0 +1,9 @@
1D /var/run/naemon 0770 naemon naemon -
2D /var/cache/naemon 0770 naemon naemon -
3D /var/cache/naemon/checkresults 0770 naemon naemon -
4D /var/lib/naemon/spool 0775 naemon naemon -
5D /var/lib/naemon/spool/checkresults 0775 naemon naemon -
6D /var/lib/naemon/thruk 0775 naemon naemon -
7D /var/lib/naemon/perl5 0775 naemon naemon -
8D /var/log/naemon 0770 naemon naemon -
9D /var/log/naemon/archives 0770 naemon naemon -
diff --git a/naemon/naemon.install b/naemon/naemon.install
new file mode 100644
index 0000000..c32c848
--- /dev/null
+++ b/naemon/naemon.install
@@ -0,0 +1,21 @@
1post_install() {
2 getent group naemon &> /dev/null || groupadd -r naemon -g 44
3 getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \
4 -d /var/lib/naemon -s /usr/bin/false -c "Naemon" naemon
5
6 chown naemon:naemon /var/lib/naemon
7 chown -R naemon:naemon /etc/naemon
8 /usr/bin/systemd-tmpfiles --create naemon.conf
9}
10
11pre_remove() {
12 if [[ -f /run/naemon/naemon.pid ]]; then
13 systemctl stop naemon
14 fi
15 /usr/bin/systemd-tmpfiles --remove naemon.conf
16
17 userdel naemon &> /dev/null
18 groupdel naemon &> /dev/null
19
20 rm -rf /var/lib/naemon
21}
diff --git a/naemon/naemon.service b/naemon/naemon.service
new file mode 100644
index 0000000..0c3a0da
--- /dev/null
+++ b/naemon/naemon.service
@@ -0,0 +1,18 @@
1[Unit]
2Description=Naemon Monitoring Daemon
3Documentation=http://naemon.org/documentation
4After=network.target
5
6[Service]
7Type=forking
8PIDFile=/run/naemon/naemon.pid
9ExecStartPre=/usr/bin/naemon -vp /etc/naemon/naemon.cfg
10ExecStart=/usr/bin/naemon --daemon /etc/naemon/naemon.cfg
11ExecReload=/bin/kill -HUP $MAINPID
12User=naemon
13Group=naemon
14StandardOutput=journal
15StandardError=inherit
16
17[Install]
18WantedBy=multi-user.target
diff --git a/naemon/overflow.patch b/naemon/overflow.patch
new file mode 100644
index 0000000..a700266
--- /dev/null
+++ b/naemon/overflow.patch
@@ -0,0 +1,137 @@
1--- a/src/naemon/xodtemplate.c 2019-07-03 18:34:13.795379190 +0200
2+++ b/src/naemon/xodtemplate.c 2019-07-03 18:33:37.079085158 +0200
3@@ -7488,7 +7488,7 @@
4 } else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
5 temp_host->flap_detection_options = OPT_ALL;
6 } else {
7- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid flap detection option '%s' in host definition.\n", temp_ptr);
8+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid flap detection option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
9 result = ERROR;
10 }
11 }
12@@ -7510,7 +7510,7 @@
13 } else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
14 temp_host->notification_options = OPT_ALL;
15 } else {
16- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid notification option '%s' in host definition.\n", temp_ptr);
17+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid notification option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
18 result = ERROR;
19 }
20 }
21@@ -7537,7 +7537,7 @@
22 } else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
23 temp_host->stalking_options = OPT_ALL;
24 } else {
25- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid stalking option '%s' in host definition.\n", temp_ptr);
26+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid stalking option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
27 result = ERROR;
28 }
29 }
30@@ -7549,29 +7549,29 @@
31 xodtemplate_obsoleted(variable, temp_host->_start_line);
32 } else if (!strcmp(variable, "2d_coords")) {
33 if ((temp_ptr = strtok(value, ", ")) == NULL) {
34- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", temp_ptr);
35+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
36 return ERROR;
37 }
38 temp_host->x_2d = atoi(temp_ptr);
39 if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
40- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", temp_ptr);
41+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
42 return ERROR;
43 }
44 temp_host->y_2d = atoi(temp_ptr);
45 temp_host->have_2d_coords = TRUE;
46 } else if (!strcmp(variable, "3d_coords")) {
47 if ((temp_ptr = strtok(value, ", ")) == NULL) {
48- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
49+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
50 return ERROR;
51 }
52 temp_host->x_3d = strtod(temp_ptr, NULL);
53 if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
54- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
55+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
56 return ERROR;
57 }
58 temp_host->y_3d = strtod(temp_ptr, NULL);
59 if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
60- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
61+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
62 return ERROR;
63 }
64 temp_host->z_3d = strtod(temp_ptr, NULL);
65@@ -8176,13 +8176,13 @@
66 } else if (!strcmp(variable, "2d_coords")) {
67 temp_ptr = strtok(value, ", ");
68 if (temp_ptr == NULL) {
69- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", temp_ptr);
70+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
71 return ERROR;
72 }
73 temp_hostextinfo->x_2d = atoi(temp_ptr);
74 temp_ptr = strtok(NULL, ", ");
75 if (temp_ptr == NULL) {
76- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", temp_ptr);
77+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
78 return ERROR;
79 }
80 temp_hostextinfo->y_2d = atoi(temp_ptr);
81@@ -8190,19 +8190,19 @@
82 } else if (!strcmp(variable, "3d_coords")) {
83 temp_ptr = strtok(value, ", ");
84 if (temp_ptr == NULL) {
85- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
86+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
87 return ERROR;
88 }
89 temp_hostextinfo->x_3d = strtod(temp_ptr, NULL);
90 temp_ptr = strtok(NULL, ", ");
91 if (temp_ptr == NULL) {
92- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
93+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
94 return ERROR;
95 }
96 temp_hostextinfo->y_3d = strtod(temp_ptr, NULL);
97 temp_ptr = strtok(NULL, ", ");
98 if (temp_ptr == NULL) {
99- nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
100+ nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
101 return ERROR;
102 }
103 temp_hostextinfo->z_3d = strtod(temp_ptr, NULL);
104@@ -8369,21 +8369,21 @@
105
106 /* make sure an object type is specified... */
107 if (input[0] == '\x0') {
108- nm_log(NSLOG_CONFIG_ERROR, "Error: No object type specified in file '%s' on line %d.\n", filename, current_line);
109+ nm_log(NSLOG_CONFIG_ERROR, "Error: No object type specified in file '%s' on line %d.\n", filename, (current_line ? current_line : -1));
110 result = ERROR;
111 break;
112 }
113
114 /* we're already in an object definition... */
115 if (in_definition == TRUE) {
116- nm_log(NSLOG_CONFIG_ERROR, "Error: Unexpected start of object definition in file '%s' on line %d. Make sure you close preceding objects before starting a new one.\n", filename, current_line);
117+ nm_log(NSLOG_CONFIG_ERROR, "Error: Unexpected start of object definition in file '%s' on line %d. Make sure you close preceding objects before starting a new one.\n", filename, (current_line ? current_line : -1));
118 result = ERROR;
119 break;
120 }
121
122 /* start a new definition */
123 if (xodtemplate_begin_object_definition(input, xodtemplate_current_config_file, current_line) == ERROR) {
124- nm_log(NSLOG_CONFIG_ERROR, "Error: Could not add object definition in file '%s' on line %d.\n", filename, current_line);
125+ nm_log(NSLOG_CONFIG_ERROR, "Error: Could not add object definition in file '%s' on line %d.\n", filename, (current_line ? current_line : -1));
126 result = ERROR;
127 break;
128 }
129@@ -8401,7 +8401,7 @@
130
131 /* close out current definition */
132 if (xodtemplate_end_object_definition() == ERROR) {
133- nm_log(NSLOG_CONFIG_ERROR, "Error: Could not complete object definition in file '%s' on line %d. Have you named all your objects?\n", filename, current_line);
134+ nm_log(NSLOG_CONFIG_ERROR, "Error: Could not complete object definition in file '%s' on line %d. Have you named all your objects?\n", filename, (current_line ? current_line : -1));
135 result = ERROR;
136 break;
137 }