zabbixagent 4

Questions to IPFire Addons.
Post Reply
andrei
Posts: 32
Joined: November 5th, 2014, 7:21 am

zabbixagent 4

Post by andrei » December 14th, 2018, 10:33 am

Inspired by viewtopic.php?t=20133

create empty file

Code: Select all

touch /opt/pakfire/db/installed/meta-zabbixagent
create daemon control

Code: Select all

 /etc/init.d/zabbixagent
add autorun information

Code: Select all

[root@ipfire ~]# ls -n /etc/rc.d/rc3.d/S65*
lrwxrwxrwx 1 0 0 23 Dec 14 13:08 /etc/rc.d/rc3.d/S65zabbixagent -> /etc/init.d/zabbixagent
pidfile

Code: Select all

[root@ipfire zabbix]# ls -n /var/run/zabbix*
lrwxrwxrwx 1    0    0 32 Dec 14 14:43 /var/run/zabbixagent.pid -> /var/run/zabbix/zabbix_agent.pid

I tried to add information about my zabbix-agent to Status - Services

Agent is runing, but displaed status - STOPPED

I tried to understand function isrunningaddon in (services.cgi line 291) - it is a little bit diffucult for me

I think, that problem in multiple id for agent

Code: Select all

[root@ipfire ~]# /usr/local/bin/addonctrl zabbixagent status
zabbix_agentd is running with Process ID(s) 16100 16099 16098 16097 16096 16095.
How to do right?

ummeegge
Community Developer
Community Developer
Posts: 5001
Joined: October 9th, 2010, 10:00 am

Re: zabbixagent 4

Post by ummeegge » December 16th, 2018, 5:49 pm

Hi andrei,
did you also set init 0 and 6 or just 3 (start) ? How does your initscript looks like ?

Best,

UE
Image
Image

andrei
Posts: 32
Joined: November 5th, 2014, 7:21 am

Re: zabbixagent 4

Post by andrei » December 17th, 2018, 6:30 am

ummeegge wrote:
December 16th, 2018, 5:49 pm
did you also set init 0 and 6 or just 3 (start) ?
Ok,created

Code: Select all

[root@ipfire ~]# ls -n /etc/rc.d/rc0.d/S65*
lrwxrwxrwx 1 0 0 23 Dec 17 09:29 /etc/rc.d/rc0.d/S65zabbixagent -> /etc/init.d/zabbixagent
[root@ipfire ~]# ls -n /etc/rc.d/rc6.d/S65*
lrwxrwxrwx 1 0 0 23 Dec 17 09:29 /etc/rc.d/rc6.d/S65zabbixagent -> /etc/init.d/zabbixagent
Nothing changed in webinterface :(
ummeegge wrote:
December 16th, 2018, 5:49 pm
How does your initscript looks like ?
init script
https://pastebin.com/b3qT3Rx6

how to pack my files to extension for everybody?

ummeegge
Community Developer
Community Developer
Posts: 5001
Joined: October 9th, 2010, 10:00 am

Re: zabbixagent 4

Post by ummeegge » December 17th, 2018, 2:13 pm

Hi,
andrei wrote:
December 17th, 2018, 6:30 am
Nothing changed in webinterface :(
Possibly it is because your symlink/init names differs to PID name ?
andrei wrote:
December 17th, 2018, 6:30 am
how to pack my files to extension for everybody?
Checkout Package definitions --> https://wiki.ipfire.org/devel/ipfire-2.x/addon-howto

UE
Image
Image

Starkstromkonsument
Posts: 7
Joined: November 16th, 2015, 4:04 pm

Re: zabbixagent 4

Post by Starkstromkonsument » January 22nd, 2019, 11:23 pm

Hi,

what ist the status of this project? Can I help? I just updated this Thread: viewtopic.php?f=36&t=20133&p=121951#p121951 before I found this one ...
Image

Image

ummeegge
Community Developer
Community Developer
Posts: 5001
Joined: October 9th, 2010, 10:00 am

Re: zabbixagent 4

Post by ummeegge » January 23rd, 2019, 3:13 pm

Hi Starkstromkonsument,
am not sure what happens with andrei´s project here but i would suggest to wait for a new build cause OpenSSL will be updated with Core 128, may it is better to build zabbix then with a the new lib if you would like to have TLS-support.

Your mentioned vsyscall problem is probably because of an older Glibc which was used to build the old packages.

To enable OpenSSL support i used in the LFS (old 3er version) only '--with-openssl=yes' but a 'configure --help' should points it also for the new version out of how to enable it, also have you checked this side --° https://www.zabbix.com/documentation/4. ... on/install ? May there are also some news available...

Best,

UE
Image
Image

Starkstromkonsument
Posts: 7
Joined: November 16th, 2015, 4:04 pm

Re: zabbixagent 4

Post by Starkstromkonsument » January 24th, 2019, 11:02 pm

Hi UE,

thank you for you're quick response. I upgraded my build-environment to core 127 and my zabbix-sources to Version 4.0.3 today and found some errors in my LFS. I revised all of my files and added some missing ones:

lfs/zabbix_agentd
config/rootfiles/packages/zabbix_agentd
src/paks/zabbix_agentd/install.sh
src/paks/zabbix_agentd/uninstall.sh
src/paks/zabbix_agentd/update.sh
src/initscripts/packages/zabbix_agentd
config/zabbix_agentd/zabbix_agentd.conf
config/backup/includes/zabbix_agentd
config/zabbix_agentd/logrotate

I was finally able to build a complete Pakfire-Package "zabbix_agentd-4.0.3-1.ipfire" incl. TLS-Support for x86_64 now. The update-process on one of my hosts worked well and the agent is running / doing it's job. I'm pretty happy with the result so far ... i will carry on with some tests.

It makes totally sense to wait for Core 128 as you pointed out. What will be the next steps to be done then for the zabbix-agent to become an official Addon? Thank you for your support!

Starkstromkonsument
Image

Image

Starkstromkonsument
Posts: 7
Joined: November 16th, 2015, 4:04 pm

Re: zabbixagent 4

Post by Starkstromkonsument » January 25th, 2019, 11:38 pm

Hi,

I ran into the problem of the install.sh and uninstall.sh-scripts actually not working properly:
  • The Daemon is not started/stopped
  • The backup/restore-process is not performed. Error: no include file for backup (but it exists)
What I tried to do (as explained here):
  1. Copy zabbix_agentd-4.0.3-1.ipfire to /opt/pakfire/tmp
  2. cd /opt/pakfire/tmp
  3. tar -xvf zabbix_agentd-4.0.3-1.ipfire
  4. sudo ./update.sh
The files:

install.sh

Code: Select all

#!/bin/bash

# [...]

. /opt/pakfire/lib/functions.sh

# Add User Zabbix if it does not exist
id -u zabbix &>/dev/null || useradd -r -U -s /bin/false -M -d /var/empty -c "Zabbix Monitoring" zabbix

extract_files

# Create additonal Directories and set permissions
mkdir -pv /etc/zabbix/zabbix_agentd.d
mkdir -pv /etc/zabbix/scripts
mkdir -pv /var/run/zabbix
chown zabbix.zabbix /var/run/zabbix
chown zabbix.zabbix /var/log/zabbix -R

# Create symlinks for runlevel interaction.
ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc3.d/S14zabbix_agentd
ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc0.d/K71zabbix_agentd
ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc6.d/K71zabbix_agentd

restore_backup ${NAME}
start_service --background ${NAME}
uninstall.sh

Code: Select all

#!/bin/bash

# [...]

. /opt/pakfire/lib/functions.sh
stop_service ${NAME}
make_backup ${NAME}
remove_files
rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd
The issue seems to be the variable ${NAME} not beeing set. I guess this is related to the script not being run by pakfire (as supposed to) but directly from shell. Am I right? Is there a workaround to bypass this problem when manually installing an "inofficial" packet?

Best,

Starkstromkonsument
Image

Image

Starkstromkonsument
Posts: 7
Joined: November 16th, 2015, 4:04 pm

Re: zabbixagent 4

Post by Starkstromkonsument » January 26th, 2019, 9:03 am

I figured it out, prepending the definition of the variable to the command does the trick.

Code: Select all

NAME=zabbix_agentd ./update.sh
Is this the correct way to solve this?
Image

Image

ummeegge
Community Developer
Community Developer
Posts: 5001
Joined: October 9th, 2010, 10:00 am

Re: zabbixagent 4

Post by ummeegge » February 2nd, 2019, 6:33 am

Hi Starkstromkonsument,
if you want to deliver Zabbix to IPFire as an addon, i won´t change the VARs. If i use packages personally or share it with other people i´d rewrote mostly the whole PAKS *.sh´s for each package.

To provide your development to IPFire, i would communicate with the developers via mailinglist --> https://lists.ipfire.org/mailman/listinfo/development .

Best,

UE
Image
Image

Post Reply