Page 1 of 1

Install a new application and run in background

Posted: Mon Oct 14, 2019 10:33 pm
by werneck.costa
I'm discovering WTWare and it solve some costumers issue. One of my services is to let the costumers to access their applications remotly, by RDP. It's working fine with WTWare.

Now, i'm wondering some questions, that is crucial to our business:
1 - is it possible to install/run some monitoring application (like Zabbix agent)?
2 - is it possible to install/run some configuration manager (like Ansible/puppet)?

Regards,

Re: Install a new application and run in background

Posted: Tue Oct 15, 2019 1:38 pm
by akatik
There is "extra=" parameter to run external applications. But there are very few libraries in WTware, trivial shell and so on, because WTware is small. So something trivial, compiled statically, may run, but not huge monsters. So, answer is no for both questions.

Re: Install a new application and run in background

Posted: Tue Oct 15, 2019 2:12 pm
by werneck.costa
Ok, thanks. Then one chance at least! :D
Is there some documentation about "extra=" parameter?

Re: Install a new application and run in background

Posted: Tue Oct 15, 2019 3:31 pm
by akatik
Here is an example: viewtopic.php?t=48783

Re: Install a new application and run in background

Posted: Tue Oct 15, 2019 5:21 pm
by werneck.costa
I guess i'm getting close:

| Archive: /tmp/extra-zabbix-agent.zip
| inflating: runme
| inflating: zabbix_agentd
| inflating: zabbix_agentd.conf
[ gm] [ 13.290685] +------------------------
[ gm] [ 13.291332] Run '/bin/sh /runme2unix', log '/tmp/extra.out', env '', pid ''.
[ pfac] [ 13.291472] Run /bin/sh /runme2unix.
[ pfac] [ 13.291748] Ok, PID 754.
[ EXTRA] [ 13.302096] /zabbix_agentd: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
[EXTRA] close kotopipe (n = 0, errno 0).

Until weekend, it will work propertly.

Re: Install a new application and run in background

Posted: Thu Oct 17, 2019 5:20 am
by werneck.costa
Solved with this steps:
  • Raspbian installed on SDCard;
  • Zabbix agent compiled directly on Raspbian;
  • Brought "zabbix_agentd" binary from compilation (in my case: /usr/src/zabbix/zabbix-3.4.15/src/zabbix_agentd);
  • Reinstalled WTWare on SD card;
  • Prepared zabbix_agent.zip following @akatik indication, like this:

Code: Select all

#!/bin/sh
chmod +x zabbix_agentd
/zabbix_agentd -f -c zabbix_agentd.conf
  • Aditional configuration on "zabbix_agentd.conf":

Code: Select all

AllowRoot=1
  • Log results:

Code: Select all

| Archive:  /tmp/extra-zabbix-agent.zip
|   inflating: runme
|   inflating: zabbix_agentd
|   inflating: zabbix_agentd.conf
[            gm] [   15.368923] +------------------------
[            gm] [   15.370280] Run '/bin/sh /runme2unix', log '/tmp/extra.out', env '', pid ''.
[          pfac] [   15.370382] Run /bin/sh /runme2unix.
[          pfac] [   15.370712] Ok, PID 768.
[         EXTRA] [   15.381822] Starting Zabbix Agent [wtwXX27EBZZ5BAA]. Zabbix 3.4.15 (revision 86739).
[         EXTRA] [   15.381859] Press Ctrl+C to exit.

Re: Install a new application and run in background

Posted: Thu Oct 17, 2019 10:34 am
by aka
Does it work? Remove '-f' from command line, it's not foreground.

Re: Install a new application and run in background

Posted: Thu Oct 17, 2019 3:50 pm
by werneck.costa
Yes, it works!
"-f" is for run it in foreground. I believe it's necessary to WTWare get the logs. Is it?

Re: Install a new application and run in background

Posted: Thu Oct 17, 2019 7:02 pm
by aka
There is local syslog in wtware. Daemon may write logs to syslog if possible. I'm afraid foreground process may read from input, but there is no input.

Re: Install a new application and run in background

Posted: Thu Oct 17, 2019 10:44 pm
by werneck.costa
Ok. What is the syslog file path?
My decision to foreground send was based on "docker way" to show logs. But, in this case, i can send to syslog.

Re: Install a new application and run in background

Posted: Fri Oct 18, 2019 3:27 pm
by akatik
In zabbix_agentd.conf:

Code: Select all

LogType=system
How did you compile it? zabbix_agentd binary from Raspbian requires about twenty libraries that are not in wtware on time where extra= package run.

Re: Install a new application and run in background

Posted: Fri Oct 18, 2019 6:16 pm
by werneck.costa
Ok about config file.
For the firts test, it was compiled from the most simple way:

Code: Select all

./configure --enable-agent
make
The second one, if necessary:

Code: Select all

./configure --enable-agent --without-ssl
The second form obligates the compilation processs to don't put any kind of SSL libs on the way. But the default already is "--without-ssl".

Re: Install a new application and run in background

Posted: Fri Oct 18, 2019 9:04 pm
by werneck.costa
It:

Code: Select all

LogType=system
works fine:

Code: Select all

[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: Starting Zabbix Agent [wtw84273B3BAE6D]. Zabbix 3.4.15 (revision 86739).
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: **** Enabled features ****
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: IPv6 support:           NO
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: TLS support:            NO
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: **************************
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: using configuration file: zabbix_agentd.conf
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: agent #0 started [main process]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[731]: agent #1 started [collector]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[732]: agent #2 started [listener #1]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[733]: agent #3 started [active checks #1]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[734]: agent #4 started [active checks #2]
[SYSLOG] <28>Oct 18 14:58:29 zabbix_agentd[734]: no active checks on server [10.18.0.240:10051]: host [wtw84273B3BAE6D] not found
Thanks Aka!

Re: Install a new application and run in background

Posted: Fri Oct 18, 2019 9:34 pm
by werneck.costa
In this link, you can get all files (including the zabbix_agent compiled for Raspberry):
http://bit.ly/wtware-zabbix-raspberry