Auteursarchief: Robin

Nagios NRPE Server 2.15 Could not complete SSL handshake. 1

CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with [ip] 1

Found out it had to do with the major version difference 3.x connecting to 2.x. Adding -2 to the command line made no difference. Disabling SSL was an solution. But not preferred.

I recently upgraded (reinstalled) my vps from Debian Jessie to Debian Buster. I chose to install Nagios4 and NRPE client from Debian repositories. (Previous installation was build from source). I was using Nagios4x already, i guess the nrpe-plugins were a bit older.

On the other side i have an Netgear ReadyNAS Pro 6 to be monitored. This system is still running Debian Jessie. To stay compatible with Netgear updates, i am not doing an dist-upgrade on the OS. Debian Jessie has nagios-nrpe-server 2.x in it’s main repository.

While searching online, i came across a solution that rebuilds nagios-nrpe-server 2.x with a dh 2048 signature.

I tried to do the same thing, with success.

With https://wiki.debian.org/BuildingTutorial as base, i proceeded as following:

# Edit /etc/apt/sources.list, add an deb-src line
deb-src http://mirrors.kernel.org/debian jessie main

Now update apt

sudo apt-get update

Create a working directory and get source code

# Create working directory
mkdir -p src/debian
cd src/debian

# Get source
apt-get source nagios-nrpe-server

# Step into source
cd nagios-nrpe-2.15

# Build without patches, to check that all requirements a met
debuild -b -uc -us

# When build failed, try
sudo apt-get install build-essential fakeroot devscripts
# and
sudo apt-get build-dep nagios-nrpe-server

Now apply some changes to the source code.

Edit ./configure

OLD: $sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h
NEW: $sslbin dhparam -C 2048 | awk '/^-----/ {exit} {print}' > include/dh.h

Edit ./configure.in

OLD: $sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h
NEW: $sslbin dhparam -C 2048 | awk '/^-----/ {exit} {print}' > include/dh.h

Edit ./src/nrpe.c

OLD: dh=get_dh512();
NEW: dh=get_dh2048();

We can recompile now.

debuild -b -uc -us

If no error occurred, there should be 2 new .deb packages in your working directory.

Install both
sudo dpkg -i nagios-nrpe-plugin_2.15-1.deb
sudo dpkg -i nagios-nrpe-server_2.15-1.deb

ABB B23 Modbus RTU

CONCEPT MESSAGE.

Connecting to ABB B23 Modbus energymeter.

I have the USB-RS485 plugged into a Debian Linux pc system (x86_64). I used the ModPoll tool from modbusdriver.com for basic connection testing.

#./modpoll /dev/ttyUSB0 -b 9600 -p none -m rtu -a 1 -r 23296 -t 4:int -c 6
  • Offset addres 23296 (or hex 0x5B00) should have L1-N voltage.
  • Read 6 next values also (-c 6)
  • Gave me L-to-N and L-to-L voltages.

Wrote a small C application to poll every second and write to MariaDB/MySQL database table. Should be possible to recompile for Raspberry-PI (ARM) to.

Uses libmodbus(-dev) and libmariadbclient(-dev).

See attachments.

 

 

LM2576T-5 step down switching regulator

First switching power supply working.

I have an ARM board to be powered, which draws between 0.5 and 1.5 ampere’s on 5 volt. Tried using an standard 7805 (2 ampere spec), but the system would not boot. VOut dropped to 4.5 volts and 7805 was getting to hot with +/- 24 volt VIn.

So i made an circuit based on the LM2576T-5.

Partslist:

Part Price
IC1: LM2576T-5 € 1,60
L1: Inductor 100uH € 1,45
D1: SR504 Recoverd from PC PSU 5.0 Amps Schottky Barrier Rectifier
C1: 470uF 35v Reused from other project
C2: 3300uF 10v Also recovered from PC PSU
F1: Fuse holder and 400mA Stock, price n/a

lm2576t-5-schemaInput voltage is an battery+solar power supply that varies between 23-24 to 29 volts.

Working power supply (left) with active load.
img_20160925_184405_edit

Bad output: (spikes)
What happens if an normal (or to slow) diode is used:
Yellow is regulator V-OUT.
Blue line represents voltage output for load (feedback signal).

img_20160924_194739_edit

Good output:
No load:

noload

100mA load

100ma_load

 

Borrowed lm2576 library for Eagle PCB Design from eaglecentral.ca | LM2576 circuit

LinuxCNC 2.7 on Jessie

Running LinuxCNC on fresh Debian Jessie (8) install using custom compiled longterm kernel 4.1.15.

Start with a fresh install of Debian.

Most of the step can be done as a normal user. For apt-get and dpkg commands log in as root or use sudo.

Compile Kernel 4.1.15 with RT patch

With some help from https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO and http://www.cyberciti.biz/faq/debian-ubuntu-building-installing-a-custom-linux-kernel/ .

Install required tools

# apt-get install build-essential ncurses-dev fakeroot kernel-package

Extract kernel and patch

# mkdir /opt/kernel
# cd /opt/kernel
# wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.1.15.tar.xz
# wget https://www.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.15-rt17.patch.gz
# tar xvf linux-4.1.15.tar.xz
# gzip --decompress patch-4.1.15-rt17.patch
# cd linux-4.1.15
# cat ../patch-4.1.15-rt17.patch | patch -p1

Copy current kernel config into this build

# cp /boot/config-$(uname -r) .config

Configure kernel

# make menuconfig
-> Processor type and features
-> -> Preemption Model (Fully Preemptible Kernel (RT))
-> -> Timer frequency (1000 HZ)
<Save>

menuconfig

Compile kernel

# make-kpkg clean
# fakeroot make-kpkg -j4 --initrd kernel_image kernel_headers

Where -j specifies number of cpu cores.
This might take a while and raise room temperature. 🙂

Installing kernel

Execute de following commands as root or use sudo.

# cd ..
# dpkg -i linux-headers-4.1.15-rt17-10.00.Custom_amd64.deb
# dpkg -i linux-image-4.1.15-rt17-10.00.Custom_amd64.deb
# shutdown -r now

Adding LinuxCNC repository to APT

I do not compile my own LinuxCNC, maybe later, for now i am using LinuxCNC APT archive.

Follow http://linuxcnc.org/docs/html/getting-started/getting-linuxcnc.html#_installing_on_debian_wheezy_with_preempt_rt_kernel

Run the following commands as user root or use sudo.

Add the LinuxCNC Archive Signing Key to your apt keyring:

# apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 3cb9fd148f374fef

Now edit /etc/apt/sources.list and add the following line:

deb http://linuxcnc.org/ jessie base 2.7-uspace

and update aptitude.

# apt-get update

Now you can install LinuxCNC by using this line:

# apt-get install linuxcnc-uspace

Please let me know if i wrote something wrong.

ELO Intellitouch 2700 on Debian Jessie

Calibrating ELO IntelliTouch 2700 USB.

Not to hard to do, after finding the right solution 🙂

Get ‘xinput-calibrator’ from Debian repositories and follow its instructions.

# apt-get install xinput-calibrator

Selection_089_kleinIn your desktop envorinment there will be an menu item ‘Calibrate touchscreen’. Click it!

Your screen will turn white and asks to tap on the screen at pointed locations.

After some samples a terminal will show up with a xorg.conf sample config.

Open a new terminal.

# sudo mkdir /etc/X11/xorg.conf.d
# sudo vi /etc/X11/xorg.conf.d/99-calibration.conf
or
# sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

Paste the sample config, save and reboot.