Entware icon indicating copy to clipboard operation
Entware copied to clipboard

Package request: icinga2

Open MAngel666 opened this issue 3 months ago • 10 comments

Hi all...

it could be cool to have icinga2 in Entware. https://icinga.com/products/ For me only the icinga2 self (without WebUI, DB etc) is important.

  • [X] No similar package already added and/or this one got some new killer feature(s),
  • [X] Package is in active development (at least, not abandoned for 5 years or more),
  • [X] I'm ready to test added package on my platform x86_64 and get a feedback about it.

MAngel666 avatar Oct 24 '25 14:10 MAngel666

  • [x] I'm ready to test added package on my platform [e.g. mipselsf-k3.4] and get a feedback about it.

http://bin.entware.net/mipselsf-k3.4/test/icinga2_2.15.1-1_mipsel-3.4.ipk Please report if the package is OK.

The-BB avatar Nov 16 '25 13:11 The-BB

Ugh, I see I defined the architecture I have incorrectly. Sorry. Could you perhaps also build it for x86_64?

MAngel666 avatar Nov 16 '25 23:11 MAngel666

https://bin.entware.net/x64-k3.2/test/icinga2_2.15.1-1_x64-3.2.ipk

The-BB avatar Nov 17 '25 00:11 The-BB

Installation works: Installing icinga2 (2.15.1-1) to root... Installing boost-system (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-system_1.88.0-1_x64-3.2.ipk Installing boost-atomic (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-atomic_1.88.0-1_x64-3.2.ipk Installing boost-chrono (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-chrono_1.88.0-1_x64-3.2.ipk Installing boost-context (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-context_1.88.0-1_x64-3.2.ipk Installing boost-thread (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-thread_1.88.0-1_x64-3.2.ipk Installing boost-coroutine (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-coroutine_1.88.0-1_x64-3.2.ipk Installing boost-date_time (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-date_time_1.88.0-1_x64-3.2.ipk Installing boost-filesystem (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-filesystem_1.88.0-1_x64-3.2.ipk Installing boost-random (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-random_1.88.0-1_x64-3.2.ipk Installing icu (77.1-1) to root... Downloading http://bin.entware.net/x64-k3.2/icu_77.1-1_x64-3.2.ipk Installing boost-regex (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-regex_1.88.0-1_x64-3.2.ipk Installing liblzma (5.6.2-2) to root... Downloading http://bin.entware.net/x64-k3.2/liblzma_5.6.2-2_x64-3.2.ipk Installing libzstd (1.5.7-1) to root... Downloading http://bin.entware.net/x64-k3.2/libzstd_1.5.7-1_x64-3.2.ipk Installing boost-iostreams (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-iostreams_1.88.0-1_x64-3.2.ipk Installing boost-program_options (1.88.0-1) to root... Downloading http://bin.entware.net/x64-k3.2/boost-program_options_1.88.0-1_x64-3.2.ipk Installing libedit (20250104.3.1-1) to root... Downloading http://bin.entware.net/x64-k3.2/libedit_20250104.3.1-1_x64-3.2.ipk Configuring boost-system. Configuring boost-chrono. Configuring boost-atomic. Configuring boost-context. Configuring boost-thread. Configuring boost-coroutine. Configuring boost-date_time. Configuring boost-filesystem. Configuring boost-random. Configuring icu. Configuring boost-regex. Configuring liblzma. Configuring libzstd. Configuring boost-iostreams. Configuring boost-program_options. Configuring libedit. Configuring icinga2.

Executable works: icinga2 --help icinga2 - The Icinga 2 network monitoring daemon (version: r2.15.1-1)

Usage: icinga2 []

Supported commands:

  • api setup (setup for API)
  • ca list (lists pending certificate signing requests)
  • ca remove (removes an outstanding certificate request)
  • ca restore (restores a removed certificate request)
  • ca sign (signs an outstanding certificate request)
  • console (Icinga console)
  • daemon (starts Icinga 2)
  • feature disable (disables specified feature)
  • feature enable (enables specified feature)
  • feature list (lists all available features)
  • node setup (set up node)
  • node wizard (wizard for node setup)
  • object list (lists all objects)
  • pki new-ca (sets up a new CA)
  • pki new-cert (creates a new CSR)
  • pki request (requests a certificate)
  • pki save-cert (saves another Icinga 2 instance's certificate)
  • pki sign-csr (signs a CSR)
  • pki ticket (generates a ticket)
  • pki verify (verify TLS certificates: CN, signed by CA, is CA; Print certificate)
  • variable get (gets a variable)
  • variable list (lists all variables)

Global options: -h [ --help ] show this help message -V [ --version ] show version information --color use VT100 color codes even when stdout is not a terminal -D [ --define ] arg define a constant -I [ --include ] arg add include search directory -x [ --log-level ] arg specify the log level for the console log. The valid value is either debug, notice, information (default), warning, or critical -X [ --script-debugger ] whether to enable the script debugger

Report bugs at https://github.com/Icinga/icinga2 Get support: https://icinga.com/support/ Documentation: https://icinga.com/docs/ Icinga home page: https://icinga.com/

I was able to successfully connect the agent to my Icinga2 master on a Synology NAS. Everything is working so far. If I find anything, I'll report it in a bug report. Now I just need to write a startup script for the Synology. Great work! Thank you!

MAngel666 avatar Nov 17 '25 09:11 MAngel666

 ~  $ /opt/etc/init.d/S90icinga2 
Usage: /opt/etc/init.d/S90icinga2 {start|stop|restart|reload|checkconfig|status}
 ~  $ 
 ~  $ /opt/etc/init.d/S90icinga2 status
Icinga 2 status: Not running
 ~  $ 
 ~  $ /opt/etc/init.d/S90icinga2 start
Checking configuration: Done
Starting Icinga 2: Done
 ~  $ 
 ~  $ /opt/etc/init.d/S90icinga2 status
Icinga 2 status: Running
 ~  $ 
 ~  $ /opt/etc/init.d/S90icinga2 stop
Stopping Icinga 2: .Done
 ~  $ 

The-BB avatar Nov 17 '25 09:11 The-BB

Perfect! not seen it...

MAngel666 avatar Nov 17 '25 10:11 MAngel666

I tried it with a few checks from the community synology package "monitoring-plugins" and linuxfabrik monitoring plugins. After minor adjustments (python paths etc), they work correctly. However, the Icinga agent runs with root privileges. Is this adjustment part of the package? Linux distributions include this in packages (creating users, etc.), or do I have to do it manually here?

MAngel666 avatar Nov 17 '25 11:11 MAngel666

or do I have to do it manually here?

Yes, you can edit /opt/etc/sysconfig/icinga2 and change the owner of all dirs /opt/etc/icinga2 and /opt/var/*/icinga2 to icinga.

 ~  $ ls -ld /proc/$(pgrep -f icinga2 | head -n 1)
dr-xr-xr-x    8 icinga   icinga           0 Nov 18 12:03 /proc/4166
 ~  $ 

The-BB avatar Nov 18 '25 09:11 The-BB

Try https://bin.entware.net/x64-k3.2/test/icinga2_2.15.1-2_x64-3.2.ipk

Added postinst script:

define Package/icinga2/postinst
#!/bin/sh

grep -q "^icinga" /opt/etc/group || echo 'icinga:x:333:icinga' >> /opt/etc/group
grep -q "^icinga" /opt/etc/passwd || echo 'icinga:x:333:333:user "icinga"::' >> /opt/etc/passwd

chown -R icinga:icinga /opt/etc/icinga2
find /opt/var -type d -name "icinga2" -exec chown -R icinga:icinga {} +
endef

The-BB avatar Nov 18 '25 20:11 The-BB

Hmm, is Entware only intended for Synology devices? I added a user/group on my Synology to passwd/group and now Hyper Backup isn't working properly. There seem to be problems with the system settings backup. I don't think it's that simple. I try to debug it in the next few days and write here the "right" way do add user/group on Syno.

MAngel666 avatar Nov 18 '25 22:11 MAngel666