Jump to content
Fi8sVrs

Monitor linux — cross platform firmware with zabbix server

Recommended Posts

  • Active Members

0*VqUOyW0bva_lOOFJ.png

 

About

This is small cross-platform linux-distro with zabbix server. It’s a simple way to deploy powerful monitoring system on ARM platfornms and x86_64.
Work’s like a firmware (non-changeable systemd image with config files), have web-interface for system management like network settings, password and other.

 

Who is this article for?

  • System admins/engineers who need to fast deploy of zabbix server.
  • Everyone, who want to deploy zabbix on ARM.
  • Enthusiasts

 

Ready images

Ready images can be found here:
https://github.com/skif-web/monitor/releases

 

Supported hardware

  • Rasberry pi 4
  • Asus tinker board
  • Beaglebone black (not recommend)
  • qemu/kvm x86_64

 

Building from source

First, clone repo from github:

git clone https://github.com/skif-web/monitor.git

 

Next, going go cloned directory:

cd monitor

 

Run prepare script and select target board:

cd monitor
./run_me.sh
[0] my_asus-tinker_defconfig
[1] my_beaglebone-black_defconfig
[2] my_rasberry-4_defconfig
[3] my_x86-64_defconfig
Select defconfig, press A for abort. Default [0]

 

After that, go to buildroot-2019.11 directory and run command make:

cd  buildroot-2019.11
make

 

After some time (depends on you build machine performance), you will have ready images:

ls -1 output/images/
boot.img
boot.vfat
bzImage
data
data.img
external.img
external.qcow2
grub-eltorito.img
grub.img
intel-ucode
monitor-0.9-beta.tar.gz
qemu.qcow2
rootfs.cpio
sdcard.img
sys
update

Artifacts:

  • sdcard.img — image for microsd-card (write via dd or rufus on windows).
  • qemu.qcow2 — image for qemu (only for x86_64)
  • external.qcow2 — qemu external drive for database files (only for x86_64)
  • monitor-0.9-beta.tar.gz — update arch

 

Option: ramdisk usage

If you use a slow hard drive or do not want to kill ssd (:-D), you can use ramdisk. To do this, open the run_me.sh file in the root directory of the repo and find the following lines:

USE_RAMDISK=y
RAMDISK_SIZE=16G

 

If USE_RAMDISK=y, buuildroot will work on ramdisk. Ramdisk-size in hard coded because i am couch potato.

 

Install generic information

This firmware doesn’t have any installer. Just write image in microsd (or use images in qemu ) and run it. All prepare operations (disk resize, first boot prepare) will be run without your interaction.

 

Install on Asus tinker board, Beaglebone black and raspberry pi 4

First, write image to microsd-card(for example, microsd is /dev/sdb):

dd if=output/images/sdcard.img of=/dev/sdb && sync

 

After that, insert this microsd to your board and boot from them.

Asus tinker board — Always boot from miscosd card

 

Asus tinker board S- Read instructions here:

https://tinkerboarding.co.uk/wiki/index.php/Setup#Boot_Priority

 

Beaglebone black — hold down the USER/BOOT button and apply power OR remove bootloader from build-im emmc

(https://www.erdahl.io/2016/12/beaglebone-black-booting-from-sd-by.html)

 

Raspberry pi 4 — Always boot from microsd card

 

Run in Qemu x86_64

qemu-system-x86_64 -smp 4 -m 4026M -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -net nic -net bridge,br=bridge0 -device virtio-scsi-pci,id=scsi0 -drive file=output/images/qemu.qcow2,format=qcow2,aio=threads -device virtio-scsi-pci,id=scsi0 -drive file=output/images/external.qcow2,format=qcow2,aio=threads

 

This command will run system with 4 cpu, 2048 RAM, enabled KVM, virtio-net device bridged to real NIC and 2 hdd drive: sdcard and second device for data.

 

Work

Boot

First boot can take a long time. It’s happens because of:

  • System resizes partition
  • Postgresql prepares own data directory

 

Also, quite a long time is needed if new external drive connected because system formats it.

 

While system booting, you can see “System starting, please wait” message on display. Wait until it will be replaced by other message like:

current ip 192.168.1.32
Ready to work

Web-interface

Main system management way is through web-interface. It available by accessing recieved ip address (see boot part).

0*HjwHdJQtNAVdCTH3

 

  • Admin panel — web-interface for device manage http://${system_ip}/manage
  • Zabbix management — Zabbix native web-interface http://${system_ip}/zabbix
  • About page http://${system_ip}

 

Default user-pass for ssh and web-console is root:admin. Default zabbix web-interface credentials is Admin:zabbix.

 

Admin panel

Open in web-browser: http://${system_ip}/manage
Available functions:

  • System status: uptime, load average, free memory, free disk space
  • Network settings: hostname, static/dhcp IP4 settings

 

0*8x8cdRs72hbOk9z9.png

 

  • Admin password
  • Backup/restore (settings and database dump separately), factory reset

 

NOTE Warning! Factory reset destroy ALL data!!!
Restore and Reset operations need reboot after them.

 

  • External drive support
  • System upgrade

 

Temperature control

Temperature control use RODOS-5 usb thermometer. Its usb device with dallas 1820. Of course, i know, that dallas 1820 can bi user directly, but you may need to buy 1-wire device (if not exist on your board).

 

Steps to enable thermal control:

  1. insert device to usb port
  2. Create data item in zabbix:
  3. Configuration -> Hosts
  4. Click ITEMS in your server line
  5. Click “Create item” button

 

- name — serverRoomTemp
- Type — zabbix agent
- Key — rodos
- Type- numeric
- Units — C
- History storage period — 10 days
- Trend storage period — 30 days
- New application — server Room Temp
- Click ADD button

 

0*Dn0JlS5uS40stzgO.png

 

Temperature graph:

 

0*YlS_a1MKdj1M46ka.png

 

Use external hard drive

I’m recommend to use external device because postgresql’s intence writing can kill microsd-card. Yes, you can use SLC cards with 30000–50000 cycles, but they are expensive. Just connect usb-device such as a flash stick, external hdd or ssd, enable external drive support in web-interface and reboot.

 

WARNING! System will destroy all data on new external device

WARNING! System does not move data from sdcard to external drive and back. You need to save backup (settings and database dump), enable/disable external drive, reboot and than — restore settings and zabbix database dump and reboot.

 

Final

This work was not planned as standalone project, i am just wanted to port zabbix to Buildroot.
But in progress i have find, that a lot of small organization need monitoring system, but don’t have enought resources, such dedicated computer for monitoring or linux system administrator.
In my case, ARM-based single board computer (like rasberry pi 4) can do a lot of works in office, but will be cost-efficient.

 

Source

 

  • Downvote 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...