Page 6 of 9

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Sun Apr 16, 2017 5:51 pm
by dwhitfield
ivp2015 wrote: -rwxr-xr-x 1 root root 5897 Nov 14 2013 nagios3
This is a bit of a shot in the dark, but are you actually using Nagios3 on this machine? Also, for clarity, this is not the XI machine correct? You are very likely to have problems with nagios3 and XI!

I also wonder at this point if it just make sense to remove the repo version of NRPE and use our install from source instructions: https://support.nagios.com/kb/article.php?id=515

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Mon Apr 17, 2017 3:38 pm
by ivp2015
yes i have follow the document but and its not working we needs to monitor disk usage of remote server,
Thanks

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Mon Apr 17, 2017 4:18 pm
by tgriep
Try this, edit the nrpe.cfg on the remote server and make sure your check_disk command is defined like the example below

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$ $ARG2$ $ARG3$
If you edit the file, restart the nrpe agent and the check should work for you.

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Mon Apr 17, 2017 4:19 pm
by avandemore
From the XI CLI, what is the output of:

Code: Select all

# nmap -p 5666 <IP of NRPE agent>

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Fri Apr 21, 2017 10:42 am
by ivp2015
ubuntu@ip-172-31-28-18:~$ nano /etc/nagios/nrpe.cfg

added in bottom

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$ $ARG2$ $ARG3$

>Save

On nagios machine

[root@ivpnagiosprod varen]# nmap -p 5666 54.76.125.226

Starting Nmap 5.51 ( http://nmap.org ) at 2017-04-21 21:10 IST
Nmap scan report for ec2-54-76-125-226.eu-west-1.compute.amazonaws.com (54.76.125.226)
Host is up (0.16s latency).
PORT STATE SERVICE
5666/tcp open nrpe

Nmap done: 1 IP address (1 host up) scanned in 7.40 seconds
[root@ivpnagiosprod varen]#

not worked :/

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Fri Apr 21, 2017 2:22 pm
by tgriep
What is the error you are receiving? Can you post it?
Can you run the following on the remote server and post the output?

Code: Select all

ls -l /usr/local/nagios/libexec/
find / -name check_disk

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Mon Apr 24, 2017 6:14 am
by ivp2015
Please find out the output of given command

from client ubuntu server

ls -l /usr/local/nagios/libexec/

oot@ip-172-31-28-18:~# ls -l /usr/local/nagios/libexec/
total 8324
-rwxr-xr-x 1 root root 233312 Apr 17 20:18 check_apt
-rwxr-xr-x 1 root nagios 6897 Mar 23 13:40 check_asterisk.pl
-rwxr-xr-x 1 root nagios 1978 Mar 23 13:40 check_asterisk_sip_peers.sh
-rwxr-xr-x 1 root root 2354 Apr 17 20:18 check_breeze
-rwxr-xr-x 1 root root 235941 Apr 17 20:18 check_by_ssh
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_clamd -> check_tcp
-rwxr-xr-x 1 root root 174110 Apr 17 20:18 check_cluster
-rwxr-xr-x 1 root nagios 5582 Mar 23 13:40 check_cpu_stats.sh
-r-sr-xr-x 1 root root 240287 Apr 17 20:18 check_dhcp
-rwxr-xr-x 1 root root 226052 Apr 17 20:18 check_dig
-rwxr-xr-x 1 root root 244781 Apr 17 20:18 check_disk
-rwxr-xr-x 1 root root 9477 Apr 17 20:18 check_disk_smb
-rwxr-xr-x 1 root root 255931 Apr 17 20:18 check_dns
-rwxr-xr-x 1 root root 135046 Apr 17 20:18 check_dummy
-rwxr-xr-x 1 root root 3868 Apr 17 20:18 check_file_age
-rwxr-xr-x 1 root root 6512 Apr 17 20:18 check_flexlm
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_ftp -> check_tcp
-rwxr-xr-x 1 root root 228837 Apr 17 20:18 check_hpjd
-rwxr-xr-x 1 root root 392866 Apr 17 20:18 check_http
-r-sr-xr-x 1 root root 254681 Apr 17 20:18 check_icmp
-rwxr-xr-x 1 root root 187012 Apr 17 20:18 check_ide_smart
-rwxr-xr-x 1 root root 15283 Apr 17 20:18 check_ifoperstatus
-rwxr-xr-x 1 root root 13435 Apr 17 20:18 check_ifstatus
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_imap -> check_tcp
-rwsr-xr-x 1 root nagios 972 Mar 23 13:40 check_init_service
-rwxr-xr-x 1 root root 6992 Apr 17 20:18 check_ircd
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_jabber -> check_tcp
-rwxr-xr-x 1 root root 199829 Apr 17 20:18 check_load
-rwxr-xr-x 1 root root 6673 Apr 17 20:18 check_log
-rwxr-xr-x 1 root root 22764 Apr 17 20:18 check_mailq
-rwxr-xr-x 1 root root 186210 Apr 17 20:18 check_mrtg
-rwxr-xr-x 1 root root 187775 Apr 17 20:18 check_mrtgtraf
-rwxr-xr-x 1 root root 200759 Apr 17 20:18 check_nagios
-rwxr-xr-x 1 root nagios 25602 Mar 23 13:40 check_netstat.pl
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_nntp -> check_tcp
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_nntps -> check_tcp
-rwxrwxr-x 1 nagios nagios 157845 Apr 17 20:10 check_nrpe
-rwxr-xr-x 1 root root 240175 Apr 17 20:18 check_nt
-rwxr-xr-x 1 root root 249141 Apr 17 20:18 check_ntp
-rwxr-xr-x 1 root root 231672 Apr 17 20:18 check_ntp_peer
-rwxr-xr-x 1 root root 228017 Apr 17 20:18 check_ntp_time
-rwxr-xr-x 1 root root 273936 Apr 17 20:18 check_nwstat
-rwxr-xr-x 1 root nagios 3259 Mar 23 13:40 check_open_files.pl
-rwxr-xr-x 1 root root 9461 Apr 17 20:18 check_oracle
-rwxr-xr-x 1 root root 210618 Apr 17 20:18 check_overcr
-rwxr-xr-x 1 root root 244631 Apr 17 20:18 check_ping
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_pop -> check_tcp
-rwxr-xr-x 1 root root 243318 Apr 17 20:18 check_procs
-rwxr-xr-x 1 root root 209472 Apr 17 20:18 check_real
-rwxr-xr-x 1 root root 9687 Apr 17 20:18 check_rpc
-rwxr-xr-x 1 root root 1537 Apr 17 20:18 check_sensors
-rwxr-xr-x 1 root nagios 2174 Mar 23 13:40 check_services
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_simap -> check_tcp
-rwxr-xr-x 1 root nagios 7599 Mar 23 13:40 check_sip
-rwxr-xr-x 1 root root 294489 Apr 17 20:18 check_smtp
-rwxr-xr-x 1 root root 301280 Apr 17 20:18 check_snmp
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_spop -> check_tcp
-rwxr-xr-x 1 root root 201667 Apr 17 20:18 check_ssh
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_ssmtp -> check_tcp
-rwxr-xr-x 1 root root 178318 Apr 17 20:18 check_swap
-rwxr-xr-x 1 root root 278318 Apr 17 20:18 check_tcp
-rwxr-xr-x 1 root root 203662 Apr 17 20:18 check_time
lrwxrwxrwx 1 root root 9 Apr 17 20:18 check_udp -> check_tcp
-rwxr-xr-x 1 root root 221880 Apr 17 20:18 check_ups
-rwxr-xr-x 1 root root 173528 Apr 17 20:18 check_uptime
-rwxr-xr-x 1 root root 171623 Apr 17 20:18 check_users
-rwxr-xr-x 1 root root 3040 Apr 17 20:18 check_wave
-rwxr-xr-x 1 root nagios 710 Mar 23 13:40 check_yum
-rwxr-xr-x 1 root nagios 3435 Mar 23 13:40 custom_check_mem
-rwxr-xr-x 1 root nagios 915 Mar 23 13:40 custom_check_procs
-rwxr-xr-x 1 root nagios 4176 Mar 23 13:40 nagisk.pl
-rwxr-xr-x 1 root root 169730 Apr 17 20:18 negate
-rwxr-xr-x 1 root root 162287 Apr 17 20:18 urlize
-rwxr-xr-x 1 root root 1949 Apr 17 20:18 utils.pm
-rwxr-xr-x 1 root root 2791 Apr 17 20:18 utils.sh




find / -name check_disk

root@ip-172-31-28-18:~# find / -name check_disk
/usr/local/nagios/libexec/check_disk
/usr/lib/nagios/plugins/check_disk
/tmp/linux-nrpe-agent/subcomponents/nagiosplugins/nagios-plugins-2.0.3/plugins/check_disk
/tmp/nagios-plugins-release-2.2.0/plugins/check_disk
root@ip-172-31-28-18:~#

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Mon Apr 24, 2017 11:11 am
by tgriep
It looks like there could be multiple copies of the NRPE Agent installed on the system and you could be editing the wrong nrpe.cfg file.
If you run the following as root on the server, it will show you which nrpe.cfg file you are using.

Code: Select all

ps -ef |grep nrpe
When you find it, edit it and add the check_disk command to it and restart the nrpe service by running.

Code: Select all

service nrpe restart
If it still fails, look in the /var/log/syslog file for any errors and post the full nrpe.cfg file.

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Tue Apr 25, 2017 3:42 am
by ivp2015
Hi

after this ps -ef |grep nrpe

OUTPUT

root@ip-172-31-28-18:~# ps -ef |grep nrpe
nagios 5341 1 0 Mar13 ? 00:00:01 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root 6293 6219 0 08:35 pts/2 00:00:00 grep --color=auto nrpe


2)

root@ip-172-31-28-18:~# nano /etc/nagios/nrpe.cfg


already added

allowed_hosts=127.0.0.1, 115.114.12.4,182.74.168.35


command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$ $ARG2$ $ARG3$

not worked :/

Re: Error in AWS EC2 Uubuntu Monitoring

Posted: Tue Apr 25, 2017 9:22 am
by tgriep
Can you post the full nrpe.cfg file from your remote server?

Code: Select all

/etc/nagios/nrpe.cfg
Look in the /var/log/syslog file on the remote server for any errors when the check is run, post them here as well.

Also, post how the service check is setup on the nagios server.

Thanks