Monthly Archives: October 2016

nagios check_apt


Return code of 127 is out of bounds – plugin may be missing


On the check_command, I had to prepend check_nrpe! since we are using the nrpe client on the server to read and return us the desired value.

No output returned from plugin


On the check_command, I had to append, with for example !1, since we need to pass $$ARG1$$

NRPE: Command ‘check_apt’ not defined


Check you /etc/nagios/nrpe.cfg you need to set it up there.


Well, I got it working!

On nagios nrpe server my /etc/nagios/nrpe.cfg I add the following line


Restart nagios-nrpe

service nagios-nrpe-server restart


On nagios server my /etc/nagios/hosts/ this is what I have

define service {
   use                     generic-service
   service_description     SYS: system updates
   check_command           check_nrpe!check_apt!1

Restart nagios server

service nagios restart




iptables unban ip and ban entire subnet


unban ip

List entries with line numbers

iptables -L -v --line-numbers

Delete entry

iptables -D name_of_chain number_of_line_with_IP_that_you_want_to_delete

Let’s imagine that we want to unban! chain name is ‘f2b-sshd‘ and line number is 10!


iptables -D f2b-sshd 10
Ban entire subnet

Example (banning some chinese sh*t)

iptables -A INPUT -s -j DROP
iptables -A INPUT -s -j DROP


Ubuntu Nagios NRPE – 1, 2, 3 install!


0. Update the system

apt-get update && apt-get upgrade

1. Install nagios nrpe & nagios plugins

apt-get install nagios-nrpe-server nagios-plugins

2. Configure NRPE

vi /etc/nagios/nrpe.cfg

Search for server_address and replace for the public ip of this machine.
Search for allowed_hosts and replace for the IP of your nagios server.

3. Restart NRPE

/etc/init.d/nagios-nrpe-server restart

That’s kinda it…

Dell PowerEdge R220, 2 × 2 TB SATA

Got a new DELL R220 to replace two existing servers… the HP DL120G7 and the SuperMicro Intel® C2750 (Avoton).

Manufacturer: Dell PowerEdge R220
Processor: Xeon E3 1x Intel® Xeon® E3 1230 v3 4 C / 8T @3.3 Ghz cache L3 8MB, x64, VT
Memory: 32 GB DDR3 ECC
Storage: 2 × 2 TB SATA

This time, I’m using CentOS!