PDA

View Full Version : Nagios User not found but Nagios User is there


Hildebrand
24th October 2008, 09:48
Hello togehter,

we have Nagios 3.0.4 running on our Server.
Everthing works well with Nagios since many weeks.
No we want to install Centron on the same Server as nice addon.

During the installation we get this error:


Where is your CentPlugins Traps binary
default to [/usr/local/centreon/bin]
>
Path /usr/local/centreon/bin OK
Finding Apache group : www-data
Finding Apache user : www-data
Nagios User not found FAIL
Have you create you nagios user ? use this command
useradd -G

If you want to force a nagios user name, use (FORCE_)NAGIOS_USER variable(s) in a template file and try 'bash install.sh -f file'

Do you want me to remove the centreon temporary working space to continue installation ?
[y/n], default to [y]:
>

But there is a nagios User:

srv-monitor01:/usr/local/src/centreon-2.0-RC7# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:100:65534::/var/run/sshd:/usr/sbin/nologin
nagios:x:1001:1001:,,,:/home/nagios:/bin/bash
ntp:x:101:103::/home/ntp:/bin/false
postfix:x:102:105::/var/spool/postfix:/bin/false
mysql:x:103:107:MySQL Server,,,:/var/lib/mysql:/bin/false
ntop:x:104:108::/var/lib/ntop:/bin/false
snmp:x:105:65534::/var/lib/snmp:/bin/false
srv-monitor01:/usr/local/src/centreon-2.0-RC7#

And also a Nagios group called nagcmd

srv-monitor01:/usr/local/src/centreon-2.0-RC7# cat /etc/group
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
sasl:x:45:
plugdev:x:46:user
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
crontab:x:101:
ssh:x:102:
user:x:1000:
nagios:x:1001:
nagcmd:x:1002:nagios,www-data
ntp:x:103:
ssl-cert:x:104:
postfix:x:105:
postdrop:x:106:
mysql:x:107:
ntop:x:108:
srv-monitor01:/usr/local/src/centreon-2.0-RC7#

So where could be the problem that centron does not find the nagios user ?
Tested under Debian Etch with centron-2.0-RC7 and the SVN Checkout from yesterday.
We tried also to use the installer with the "-f" option and a variable File.
But that does also not work.

LOG_DIR="$BASE_DIR/log"
LOG_FILE="$LOG_DIR/install_centreon.log"
TMPDIR="/tmp/centreon-setup"
SNMP_DIR="/etc/snmp/"
CENTREON_CONF_1_4="/etc/[co][er][ne][to][rn]*.conf"
DEFAULT_CENTREON_CONF="/etc/centreon/centreon.conf"
CENTREON_CONF="/etc/centreon.conf"
#use $CENTREON_ETC/centreon.conf
PEAR_MODULES_LIST="pear.lst"
DEFAULT_INSTALL_DIR_NAGIOS="/usr/local/nagios"
DEFAULT_INSTALL_DIR_CENTREON="/usr/local/centreon"
DEFAULT_NAGIOS_ETC="/usr/local/nagios/etc"
DEFAULT_NAGIOS_PLUGIN="/usr/local/nagios/libexec"
DEFAULT_NAGIOS_IMG="/usr/local/nagios/share/images/s"
DEFAULT_NAGIOS_BINARY="/usr/local/nagios/bin/nagios"
DEFAULT_NAGIOSTATS_BINARY="/usr/local/nagios/bin/nagiostats"
DEFAULT_NAGIOS_VAR="/usr/local/nagios/var"
DEFAULT_NDO2DB_BINARY="/usr/sbin/ndo2db"
DEFAULT_NDOMOD_BINARY="/usr/sbin/ndomod.o"
DEFAULT_RRD_PERL="/usr/lib/perl5"
DEFAULT_SUDO_FILE="/etc/sudoers"
DEFAULT_WEB_USER="www-data"
DEFAULT_WEB_GROUP="www-data"
DEFAULT_NAGIOS_USER="nagios"
DEFAULT_NAGIOS_GROUP="nagcmd"
DEFAULT_BIN_RRDTOOL="/usr/bin/rrdtool"
DEFAULT_BIN_MAIL="/usr/bin/mail"
DEFAULT_BIN_SSH="/usr/bin/ssh"
DEFAULT_BIN_SCP="/usr/bin/scp"
DEFAULT_INIT_D="/etc/init.d"
DEFAULT_CRON_D="/etc/cron.d"
DEFAULT_PEAR_PATH="/usr/share/php"
DEFAULT_PHP_BIN="/usr/bin/php"
DEFAULT_PERL_BIN="/usr/bin/perl"
DEFAULT_CENTREON_LOG="/usr/local/centreon/log"
DEFAULT_CENTREON_ETC="/etc/centreon"
DEFAULT_CENTREON_RUNDIR="/var/run/centreon"
DEFAULT_CENTREON_GENDIR="/usr/local/centreon"
DEFAULT_CENTREON_VARLIB="/var/lib/centreon"
DEFAULT_CENTSTORAGE_RRD="/var/lib/centreon"
DEFAULT_CENTPLUGINS_TMP="/var/lib/centreon/centplugins"
DEFAULT_CENTSTORAGE_BINDIR="bin"
DEFAULT_CENTCORE_BINDIR="bin"
DEFAULT_SNMP_ETC="/etc/snmp"
DEFAULT_SNMPTT_BINDIR="/usr/local/centreon/bin/"
DEFAULT_CENTPLUGINSTRAPS_BINDIR="/usr/local/centreon/bin"



Thanks for any help.
- Hildebrand

WAtt
24th October 2008, 10:32
Hi,

To define nagios user and group, I use nagios.cfg file.

Could you check in this file if user exist ?


I use this method on install script:
[code]
* get user and group in nagios.cfg
* test if user exist on server
[code]

Hildebrand
24th October 2008, 10:58
And exaclty this was the problem/solution.
The User and the Group was not defind in the nagios.cfg.

Now i can go on with the installation.

Thanks!

Hildebrand
3rd November 2008, 12:49
This was exactly the Problem and solution. THANKS!

BTW: I replied a week before here and a message said that my post first must be read by an Mod and then get unlock.

SUIKOX
21st April 2009, 14:29
Hello,

I've got the same problem, but in my file nagios.cfg, I've define my nagios_user and my nagios_group so I don't understand where come from this problem ?

there is my nagios user

nagios: x:1001:1001::/home/nagios:/bin/noshell

and there is my nagios group


nagios: x:1001:
nagiosgrp: x:1002:nagios,www-data

and in my nagios.cfg :


# NAGIOS USER
# This determines the effective user that Nagios should run as.
# You can either supply a username or a UID.

nagios_user=nagios



# NAGIOS GROUP
# This determines the effective group that Nagios should run as.
# You can either supply a group name or a GID.

nagios_group=nagios


my file nagios.cfg is in /etc/nagios3/ (I've installed nagios with debian lenny) and I've nothing in /usr/local/nagios/etc/ but only the ndo2db.cfg and ndomod.cfg is that correct ?


I've tried this:

./install.sh -i -f /etc/nagios3/nagios.cfg

but that didn't work.


someone can help me please?

fcge
22nd April 2009, 16:18
./install.sh -i -f /etc/nagios3/nagios.cfg
The -f option can't work with such a file. It's only to give the script a template containing main installation variables.

To make a template, just use the models contained in "tmpl/vardistrib/sample.tmpl".

Juste copy this file, then complete it with the right informations and then use it with the option -f of the script.

Perhaps could it correct your problem...

I've juste installed centreon using this way without any problem to find nagios user.

SUIKOX
23rd April 2009, 10:33
Hello,

I've installed centreon 2, but when I go back on my web interface nagios I've got this:

Whoops!

Error: Could not read object configuration data!

And the worst, all my services with nagisk who works in nagios are not in centreon. :mad:

It is possible to get back my web interface nagios ??

fcge
24th April 2009, 15:31
Error: Could not read object configuration data!
Are the rights on the files in nagios etc directory ok ?


And the worst, all my services with nagisk who works in nagios are not in centreon
Is ndo well running ?
Is there anything related to it in nagios.log ?
Is the event broker module well configured ?

SUIKOX
29th April 2009, 11:39
the right of my file nagios.cfg is :

-rwxrwxr-x 1 www-data www-data 3850 avr 27 11:47 nagios.cfg

the ndo run
and for my nagios.log I've got this:

[1240322366] Warning: Duplicate definition found for service 'Disk Space' on ho$
[1240322366] Warning: Duplicate definition found for service 'Check Zaptel Span$
[1240322366] Warning: Duplicate definition found for service 'Check Zaptel card$
[1240322366] Warning: Duplicate definition found for service 'Check SIP channel$
[1240322366] Warning: Duplicate definition found for service 'Check SIP peers' $
[1240322366] Warning: Duplicate definition found for service 'Check SIP' on hos$
[1240322366] Warning: Duplicate definition found for service 'ASTERISK Alive' o$
[1240322366] Warning: Duplicate definition found for service 'IAX trunk' on hos$
[1240322366] Warning: Duplicate definition found for service 'SIP' on host 'mon$
[1240322366] Warning: Duplicate definition found for service 'Current Users' on$
[1240322366] Warning: Duplicate definition found for service 'Disk Space' on ho$
[1240322366] Warning: Duplicate definition found for service 'PING' on host 'mo$
[1240322366] Warning: Duplicate definition found for service 'SSH' on host 'monitored' (config file '/etc/nagios3/conf.d/services_nagios2.cfg', starting on line
[1240322366] Warning: Duplicate definition found for service 'HTTP' on host 'monitored' (config file '/etc/nagios3/conf.d/services_nagios2.cfg', starting on line 3)

[1240322366] Finished daemonizing... (New PID=26163)

fcge
29th April 2009, 11:59
I've got the same rights on the config file...

As far as the definitions are concerned... I don't really know what to answer. I'm new in the nagios world...
I think these services are defined in two places, in the config files.

Something is broken... but I'm afraid I'm not able to help you... :s

SUIKOX
29th April 2009, 16:59
hello,

my host si UP, I don't really understand why ? but here my code I've change:

define host{
use generic-host
host_name monitored
alias monitored
address 192.168.2.240
max_check_attempts 5
notification_interval 60
notification_period 24x7
notification_options d,u,r
check_command check-host-alive
}