Pull to refresh

Monitor linux — cross platform firmware with zabbix server

Reading time4 min
Views2.4K

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.


Worked as firmware (non-changeable systemd image with config files), have web-interface for system management like network settings, password and other.


Who is interested


  • 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

Build 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

Interesting files:


  • 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


You can decrease build time by using ramdisk. To do it, open run_me.sh in root dir of repo and find this strings:


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 don'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.


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


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 long time. It's happened because:


  • System resizes partition
  • Postgresql prepares own data directory

Also, long time needed if new external drive connected because system format 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 — web-interface. It available by system ip (see boot part).



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
  • 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:
1)Configuration -> Hosts
2)Click ITEMS in your server line
3)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


Graph of temperature



Use external hard drive


I'm recommend to use external device because postgresql can kill microsd-card. Yes, you can use SLC cards with 30000-50000 cycles, but they expensive. Just connect usb-device such flash,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.

Tags:
Hubs:
+3
Comments0

Articles

Change theme settings