Nagios XI, Trial Manual Install

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
liam.carter
Posts: 3
Joined: Sun Apr 04, 2010 1:47 am

Nagios XI, Trial Manual Install

Post by liam.carter »

I am attempting to install Nagios XI on a CentOS 5 server and am
running into various issues.

./0-yum create the following error

Installing Dag repo...
error: nagiosxi/RPM-GPG-KEY.dag.txt: import read failed(0).

I did carry on and then it failed on the ./B-installxi came up with
the following error

Creating product directory...
Adding password for user nagiosadmin
-bash: /tmp/xi/nagiosxi/create_postgres_db.sh: /bin/sh^M: bad
interpreter: No such file or directory
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
psql: FATAL: database "nagiosxi" does not exist
psql: FATAL: database "nagiosxi" does not exist
chown: cannot access `/usr/local/nagios/etc/hosts/*.cfg': No such file
or directory
chown: cannot access `/usr/local/nagios/etc/services/*.cfg': No such
file or directory

Any ideas.

Liam
lance
Posts: 38
Joined: Wed Feb 17, 2010 5:00 pm

Re: Nagios XI, Trial Manual Install

Post by lance »

Hi Liam,

Had the same probs with Centos5.4 myself.

re the Dag repo, did a bit digging with google. Found the following which worked for me:

http://fedoraforum.org/forum/archive/in ... 76363.html


re the create_postgresql_db.sh

I just ran the dos2unix command against the file & that seemed to rectify that (ie #dos2unix /tmp/xi/nagiosxi/create_postgres_db.sh)

Hope this helps

regards

L.
liam.carter
Posts: 3
Joined: Sun Apr 04, 2010 1:47 am

Re: Nagios XI, Trial Manual Install

Post by liam.carter »

Hiya Lance,

Just tried thsi and still the same error when i run ./0-yum

Liam
liam.carter
Posts: 3
Joined: Sun Apr 04, 2010 1:47 am

Re: Nagios XI, Trial Manual Install

Post by liam.carter »

and when i run install i get this

INSERT 0 1
INSERT 0 1
chown: cannot access `/usr/local/nagios/etc/hosts/*.cfg': No such file or directory
chown: cannot access `/usr/local/nagios/etc/services/*.cfg': No such file or directory

i think this might be steming from the first prob with ./0-yum

Liam
jamesconner
Posts: 13
Joined: Thu Feb 25, 2010 2:31 pm

Re: Nagios XI, Trial Manual Install

Post by jamesconner »

There are apparently a lot of dos formatted files in the installation package (don't the devs use Linux?!). As an example:

Code: Select all

[root@bob xi]# ./B-installxi 
Creating product directory...
Adding password for user nagiosadmin
-bash: /tmp/xi/nagiosxi/create_postgres_db.sh: /bin/sh^M: bad interpreter: No such file or directory
Stopping postgresql service:                               [  OK  ]
Starting postgresql service:                               [  OK  ]
psql: FATAL:  database "nagiosxi" does not exist
psql: FATAL:  database "nagiosxi" does not exist
chown: cannot access `/usr/local/nagios/etc/hosts/*.cfg': No such file or directory
chown: cannot access `/usr/local/nagios/etc/services/*.cfg': No such file or directory
The ^M is a carriage return line for DOS/Windows. If you're using vi, here's a tip page for getting rid of 'em. Alternatively, you can use the aforementioned dos2unix application.
jamesconner
Posts: 13
Joined: Thu Feb 25, 2010 2:31 pm

Re: Nagios XI, Trial Manual Install

Post by jamesconner »

Edited. Don't do that :)
Last edited by jamesconner on Mon Apr 05, 2010 4:30 pm, edited 1 time in total.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Nagios XI, Trial Manual Install

Post by mmestnik »

Don't do that there is a better way else where on the forums. Hold on I'll get it.
Edit:
Perhaps there isn't. Well around the office we have two methods, grep and file.
The grep way has an issue were one can't copy paste it, the ^M needs to be typed as Ctrl-v Ctor-m.

Code: Select all

find /usr/local -name .svn -prune -o -type f -exec grep -Z --binary-files=without-match -l '^M' '{}' + | xargs -0 -n1 dos2unix -k
So we have adopted the file way. I don't have the correct syntax in front of me ATM, but it generally looks like so... Well actually the output of file is not consistent across distributions, so don't use that.

I guess you could try and see how copy pasting this works for you.

Code: Select all

find /usr/local -name .svn -prune -o -type f -exec grep -Z --binary-files=without-match \
-l "$(echo -n 'DQo==' | base64 -d 2>/dev/null)" '{}' + | xargs -0 -n1 dos2unix -k
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Nagios XI, Trial Manual Install

Post by mmestnik »

As for the issue here, yes step one is to convert the script for dos2unix. Then IGNORE this error, it's harmless.

This tarball was generated from an svn co and tar on a Fedora system. The line endings came about from setting svn:eol-style to native. This should have caused the correct terminators on a Fedora system... Since it didn't work as expected it's use is abolished here.

If any one has insight into the workings of svn:eof-style please let me know. I plan to write a few scripts that are multi-platform that can be used to test this operation.
jamesconner
Posts: 13
Joined: Thu Feb 25, 2010 2:31 pm

Re: Nagios XI, Trial Manual Install

Post by jamesconner »

Do you have a recommendation on a standalone platform?

RHEL5.5 ended up being a cumbersome install, due to missing deps (php-mcrypt, php-mhash, and so forth, are not included in the base repos), so I've downloaded CentOS 5.4 to see how the install procedure works on that distro (given that the VM is running CentOS 5.4, I'm hoping it goes well).
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Nagios XI, Trial Manual Install

Post by mmestnik »

We are migrating off topic, I stated a new one to continue this discussion on the best installation OS.

http://support.nagios.com/forum/viewtopic.php?f=6&t=248

I think the problem you are having is that you WILL need more then just the base repos. You should configure DAG, I don't think any of the other OS we support will work with just there supplied packages. Debian would have all these packages included as part of there regular(main, contrib, and non-free) channels, but it's not a popular choice for our customer base so we don't support it.

Start a new topic to continue discussion about your DAG/repository issues.
Locked