How to migrate Linux clients from Nagios Core to Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hkang »

# cat /usr/local/nagios/etc/nrpe.cfg | sed -e '/^\s*$/d' -e '/^#/d'
log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1
dont_blame_nrpe=1
debug=0
command_timeout=60
connection_timeout=300
include_dir=/usr/local/nagios/etc/nrpe
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hsmith »

That looks all right.

Let's take a look at common.cfg:

Code: Select all

cat /usr/local/nagios/etc/nrpe/common.cfg | sed -e '/^\s*$/d' -e '/^#/d' 
Former Nagios Employee.
me.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hkang »

# cat /usr/local/nagios/etc/nrpe/common.cfg | sed -e '/^\s*$/d' -e '/^#/d'
cat: /usr/local/nagios/etc/nrpe/common.cfg: No such file or directory
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hsmith »

Oh.. interesting. What's the output of this?

Code: Select all

ls -lR /usr/local/nagios
Former Nagios Employee.
me.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hkang »

Code: Select all

# ls -lR /usr/local/nagios
/usr/local/nagios:
total 20
drwxrwxr-x. 2 nagios nagios 4096 Nov  6 15:36 bin
drwxrwxr-x. 2 nagios nagios 4096 Jan 14 09:26 etc
drwxr-xr-x. 2 root   root   4096 Nov  6 15:31 include
drwxrwxr-x. 2 nagios nagios 4096 Nov  6 15:42 libexec
drwxr-xr-x. 3 root   root   4096 Nov  6 15:31 share

/usr/local/nagios/bin:
total 144
-rwxrwxr-x. 1 nagios nagios 144684 Nov  6 15:36 nrpe

/usr/local/nagios/etc:
total 20
-rw-r--r--. 1 nagios nagios 7218 Jan 14 10:55 nrpe.cfg
-rw-r--r--. 1 root   root   8435 Jan 14 09:26 nrpe_old.cfg

/usr/local/nagios/include:
total 0

/usr/local/nagios/libexec:
total 6720
-rwxr-xr-x. 1 nagios nagios 172055 Nov  6 15:31 check_apt
-rwxr-xr-x. 1 nagios nagios   2252 Nov  6 15:31 check_breeze
-rwxr-xr-x. 1 nagios nagios 174232 Nov  6 15:31 check_by_ssh
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_clamd -> check_tcp
-rwxr-xr-x. 1 nagios nagios 133066 Nov  6 15:31 check_cluster
-r-xr-xr-x. 1 nagios nagios 170623 Nov  6 15:31 check_dhcp
-rwxr-xr-x. 1 nagios nagios 168986 Nov  6 15:31 check_dig
-rwxr-xr-x. 1 nagios nagios 185644 Nov  6 15:31 check_disk
-rwxr-xr-x. 1 nagios nagios   9290 Nov  6 15:31 check_disk_smb
-rwxr-xr-x. 1 nagios nagios 184862 Nov  6 15:31 check_dns
-rwxr-xr-x. 1 nagios nagios  84987 Nov  6 15:31 check_dummy
-rwxr-xr-x. 1 nagios nagios   3350 Nov  6 15:31 check_file_age
-rwxr-xr-x. 1 nagios nagios   6316 Nov  6 15:31 check_flexlm
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_ftp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 170277 Nov  6 15:31 check_hpjd
-rwxr-xr-x. 1 nagios nagios 331386 Nov  6 15:31 check_http
-r-xr-xr-x. 1 nagios nagios 176976 Nov  6 15:31 check_icmp
-rwxr-xr-x. 1 nagios nagios 139536 Nov  6 15:31 check_ide_smart
-rwxr-xr-x. 1 nagios nagios  15124 Nov  6 15:31 check_ifoperstatus
-rwxr-xr-x. 1 nagios nagios  12601 Nov  6 15:31 check_ifstatus
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_imap -> check_tcp
-rwxr-xr-x. 1 nagios nagios   6888 Nov  6 15:31 check_ircd
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_jabber -> check_tcp
-rwxr-xr-x. 1 nagios nagios 154121 Nov  6 15:31 check_load
-rwxr-xr-x. 1 nagios nagios   5989 Nov  6 15:31 check_log
-rwxr-xr-x. 1 nagios nagios  22394 Nov  6 15:31 check_mailq
-rwxr-xr-x. 1 nagios nagios   2644 Nov 16 11:40 check_mem.sh
-rwxr-xr-x. 1 nagios nagios 138314 Nov  6 15:31 check_mrtg
-rwxr-xr-x. 1 nagios nagios 138599 Nov  6 15:31 check_mrtgtraf
-rwxr-xr-x. 1 nagios nagios 176213 Nov  6 15:31 check_mysql
-rwxr-xr-x. 1 nagios nagios 163139 Nov  6 15:31 check_mysql_query
-rwxr-xr-x. 1 nagios nagios 153019 Nov  6 15:31 check_nagios
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_nntp -> check_tcp
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_nntps -> check_tcp
-rwxrwxr-x. 1 nagios nagios  76777 Nov  6 15:36 check_nrpe
-rwxr-xr-x. 1 nagios nagios 175127 Nov  6 15:31 check_nt
-rwxr-xr-x. 1 nagios nagios 176190 Nov  6 15:31 check_ntp
-rwxr-xr-x. 1 nagios nagios 167915 Nov  6 15:31 check_ntp_peer
-rwxr-xr-x. 1 nagios nagios 164600 Nov  6 15:31 check_ntp_time
-rwxr-xr-x. 1 nagios nagios 205484 Nov  6 15:31 check_nwstat
-rwxr-xr-x. 1 nagios nagios   8779 Nov  6 15:31 check_oracle
-rwxr-xr-x. 1 nagios nagios 156194 Nov  6 15:31 check_overcr
-rwxr-xr-x. 1 nagios nagios 160288 Nov  6 15:31 check_pgsql
-rwxr-xr-x. 1 nagios nagios 179743 Nov  6 15:31 check_ping
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_pop -> check_tcp
-rwxr-xr-x. 1 nagios nagios 180521 Nov  6 15:31 check_procs
-rwxr-xr-x. 1 nagios nagios 151068 Nov  6 15:31 check_real
-rwxr-xr-x. 1 nagios nagios   9582 Nov  6 15:31 check_rpc
-rwxr-xr-x. 1 nagios nagios   1453 Nov  6 15:31 check_sensors
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_simap -> check_tcp
-rwxr-xr-x. 1 nagios nagios 243887 Nov  6 15:31 check_smtp
-rwxr-xr-x. 1 nagios nagios 247366 Nov  6 15:31 check_snmp
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_spop -> check_tcp
-rwxr-xr-x. 1 nagios nagios 150328 Nov  6 15:31 check_ssh
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_ssmtp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 135790 Nov  6 15:31 check_swap
-rwxr-xr-x. 1 nagios nagios 222714 Nov  6 15:31 check_tcp
-rwxr-xr-x. 1 nagios nagios 151126 Nov  6 15:31 check_time
lrwxrwxrwx. 1 nagios nagios      9 Nov  6 15:31 check_udp -> check_tcp
-rwxr-xr-x. 1 nagios nagios 164642 Nov  6 15:31 check_ups
-rwxr-xr-x. 1 nagios nagios 134168 Nov  6 15:31 check_uptime
-rwxr-xr-x. 1 nagios nagios 129430 Nov  6 15:31 check_users
-rwxr-xr-x. 1 nagios nagios   2937 Nov  6 15:31 check_wave
-rwxr-xr-x. 1 nagios nagios 131278 Nov  6 15:31 negate
-rwxr-xr-x. 1 nagios nagios 125500 Nov  6 15:31 urlize
-rwxr-xr-x. 1 nagios nagios   1913 Nov  6 15:31 utils.pm
-rwxr-xr-x. 1 nagios nagios   2791 Nov  6 15:31 utils.sh

/usr/local/nagios/share:
total 4
drwxr-xr-x. 4 root root 4096 Nov  6 15:31 locale

/usr/local/nagios/share/locale:
total 8
drwxr-xr-x. 3 root root 4096 Nov  6 15:31 de
drwxr-xr-x. 3 root root 4096 Nov  6 15:31 fr

/usr/local/nagios/share/locale/de:
total 4
drwxr-xr-x. 2 root root 4096 Nov  6 15:31 LC_MESSAGES

/usr/local/nagios/share/locale/de/LC_MESSAGES:
total 8
-rw-r--r--. 1 root root 7750 Nov  6 15:31 nagios-plugins.mo

/usr/local/nagios/share/locale/fr:
total 4
drwxr-xr-x. 2 root root 4096 Nov  6 15:31 LC_MESSAGES

/usr/local/nagios/share/locale/fr/LC_MESSAGES:
total 92
-rw-r--r--. 1 root root 94001 Nov  6 15:31 nagios-plugins.mo
Last edited by tmcdonald on Thu Jan 14, 2016 5:34 pm, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by tgriep »

On the remote server, can you check the /var/log/messages file for any NRPE errors and post them here?
The server called ipofxi, is that your XI server and cal the hostname be resolved on the remote server?
Try changing it to the IP address and see if that helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hkang »

Here are the error messages in the log file:

Could not open config directory '/usr/local/nagios/etc/nrpe' for reading.
Continuing with errors...
Error: Request contained command arguments!
Client request was invalid, bailing out...
EXIT: nrpe status=0 pid=15566 duration=0(sec)

ipofxi is the IP address of the XI host. I am able to ping the XI host on the remote box by either its host name or IP.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by tgriep »

Login as root and run the following.

Code: Select all

mkdir /usr/local/nagios/etc/nrpe
chown nagios.nagios  /usr/local/nagios/etc/nrpe
chmod 755 /usr/local/nagios/etc/nrpe
This should create the missing config folder.

Try that out and let us know if this resolves the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by hkang »

The folder was created. But it didn't resolve the issue.

Do I need to create or copy common.cfg as well?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to migrate Linux clients from Nagios Core to Nagios

Post by Box293 »

hkang wrote:Do I need to create or copy common.cfg as well?
Yes. You would also need all the plugins reference in command.cfg to be placed in the /usr/local/nagios/libexec/ folder of the client.
hkang wrote:On this box, I installed NRPE plugin (nagios-plugins-2.0.2.tar.gz) which worked fine with Nagios Core monitoring host. After we decided to try Nagios XI, I installed NRPE agent (linux-nrpe-agent.tar.gz) on another box which works with Nagios XI host. I know these are two different files, and the installation steps are also different.
As you may have discovered, linux-nrpe-agent.tar.gz includes NRPE, nagios-plugins and also extra plugins AS well as being configured automatically.

If you installed linux-nrpe-agent.tar.gz on a fresh box, then you could copy the following files to the existing boxes and it should all just work:
  • /usr/local/nagios/etc/nrpe.cfg
    /usr/local/nagios/etc/nrpe/*
    /usr/local/nagios/libexec/* (when copying this directory, I would not overwrite any existing files)
Then service xinetd restart

OR just delete the existing installs and install linux-nrpe-agent.tar.gz from scratch.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked