We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Error nagios-exec-start-pre

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Error nagios-exec-start-pre

Postby l4t1g0 » Thu Jun 16, 2022 4:10 pm

Hi guys,
I installed nagios-4.4.7-1.1.i586 on tumbleweed 20220527, when I try to start it I get the next error:

jun 16 15:47:27 repo01 systemd[1]: Starting Network Monitor Nagios...
jun 16 15:47:28 repo01 nagios-exec-start-pre[5827]: /usr/lib/nagios/nagios-exec-start-pre: línea 17: shift: contador de desplazamiento fuera de rango
jun 16 15:47:28 repo01 nagios-exec-start-pre[5873]: chmod: cambiando los permisos de '/etc/nagios/resource.cfg': Sistema de ficheros de sólo lectura
jun 16 15:47:28 repo01 nagios-exec-start-pre[5874]: chown: cambiando el propietario de '/etc/nagios/resource.cfg': Sistema de ficheros de sólo lectura
jun 16 15:47:28 repo01 systemd[1]: nagios.service: Control process exited, code=exited, status=1/FAILURE
jun 16 15:47:28 repo01 systemd[1]: nagios.service: Failed with result 'exit-code'.
jun 16 15:47:28 repo01 systemd[1]: Failed to start Network Monitor Nagios.


Current installed packages are:
nagios-theme-switcher-1.4-2.14.noarch
nagios-4.4.7-1.1.i586
nagios-rpm-macros-0.14-3.3.noarch
nagios-www-4.4.7-1.1.i586

resource.cfg perms
repo01:/home/jose # ll /etc/nagios/resource.cfg
-rw-rw-rw- 1 nagios nagcmd 1308 may 25 13:40 /etc/nagios/resource.cfg

This is the first 20 lines from /usr/lib/nagios/nagios-exec-start-pre
1 #! /bin/sh
2 # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany
3 #
4 # Original Author: Tim Hardeck
5 # bases on the SUSE Icinga init script from Wolfgang Rosenauer, Lars Vogdt
6 #
7 CONFIG='/etc/nagios/nagios.cfg'
8
9 # grab a config option
10 get_var() {
11 echo "$(whoami)," $1 "," $2 >> /tmp/0.txt
12 if [ -n "$2" ]; then
13 set -- `grep ^$1 $2 | sed 's@=@ @' | tr -d '[:cntrl:]'`
14 else
15 set -- `grep ^$1 "$CONFIG" | sed 's@=@ @' | tr -d '[:cntrl:]'`
16 fi
17 shift # remove first ARG => search-string
18 echo $*
19 }
20

Any ideas?
Thanks!
l4t1g0
 
Posts: 1
Joined: Thu Jun 16, 2022 4:02 pm

Re: Error nagios-exec-start-pre

Postby DevinPomsilina » Wed Jun 22, 2022 12:42 am

I created this file:

sudo vi /etc/systemd/system/nagios.service
and added the following:

[Unit]
Description=Nagios
BindTo=network.target


[Install]
WantedBy=multi-user.target

[Service]
User=nagios
Group=nagios
Type=simple
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
Then the following:

sudo systemctl enable /etc/systemd/system/nagios.service
sudo systemctl start nagios
sudo systemctl restart nagios
DevinPomsilina
 
Posts: 4
Joined: Sun May 15, 2022 6:43 am


Return to Community Support

Who is online

Users browsing this forum: No registered users and 8 guests

cron