Monthly Archives: September 2018

No output on stdout) stderr: connect to address XXX.XXX.XXX.XXX port 5666: Connection refused 

This was tested on a CentOS 7.

This might have TWO possible causes

  • nrpe service is down
    use service nrpe status to test it.
    You might wanna see ‘section’ Add NRPE to service bellow, to activate nrpe as a service.
  • firewall on nrpe machine is blocking it

 

Some important files/directories

nrpe.cfg – /etc/nagios/nrpe.cfg
nagios/nrpe plugins folder – /usr/lib64/nagios/plugins/
logs – /var/log/messages

 

nrpe.cfg

My nrpe.cfg, in a CentOS 7, is located at /etc/nagios/nrpe.cfg

nano /etc/nagios/nrpe.cfg
nrpe log

In a default nrpe installation log is disabled!
You might want to enable it for better debug of the issues… Go to  and enable it.

log_file=/var/run/nrpe.log

nrpe debug mode

Yah!, the default installation will came also with debug disabled.
We want it enabled to see more information while we try to use service nrpe status for example.

debug=1

server_address

Server address… it might confuse you!
Server address ISN’T the NAGIOS’s ip address. It’s the actual external IP address of the current machine! allowed_hosts it’s actually it!

Lets check out the status of 5666 port.
lsof -i:5666
netstat -an |grep 5666

If you don’t see any result… this probably means that nrpe is down!
See the ‘section’ Add NRPE to service bellow.

Open PORT on the firewall
sudo firewall-cmd --permanent --zone=public --add-port=5666/tcp
firewall-cmd --reload
Add NRPE to service  – this will lunch nrpe on reboots –
sudo systemctl enable nrpe.service
sudo systemctl start nrpe.service

Continue reading No output on stdout) stderr: connect to address XXX.XXX.XXX.XXX port 5666: Connection refused 

Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.

So, I was trying to create a SSL certificate with certbot…..

root@sd-5555:~# certbot --apache -d blog.domain.com

This was how I’v done to properly create it.

certbot --authenticator standalone --installer apache -d blog.domain.com --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"

google pagespeed – centos installation

 

Let’s edit/create google-mod-pagespeed.repo

vi /etc/yum.repos.d/google-mod-pagespeed.repo

and add

[googlemodpagespeed]
name=googlemodpagespeed
baseurl=http://dl.google.com/linux/mod-pagespeed/rpm/stable/$basearch
enabled=1
gpgcheck=0
Let’s install it with yum!
yum install mod-pagespeed
Then we need to restart apache!
service httpd restart

 

This is how we test it…

curl -D- http://localhost/ | head -10

 

[root@sd-hooray webroot]# curl -D- http://localhost/ | head -10
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4328 100 4328 0 0 27929 0 –:–:– –:–:– –:–:– 28103
HTTP/1.1 200 OK
Date: Wed, 12 Sep 2018 15:52:41 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.6.38
X-Powered-By: PHP/5.6.38
X-Mod-Pagespeed: 1.13.35.2-0
Vary: Accept-Encoding
Cache-Control: max-age=0, no-cache, s-maxage=10
Content-Length: 4328
Content-Type: text/html; charset=iso-8859-1