OPSI integration with Zabbix

Antworten
aellert
Beiträge: 37
Registriert: 16 Mai 2012, 11:30

OPSI integration with Zabbix

Beitrag von aellert »

Hi,

I'd like to monitore in my Zabbix server when a new client "reported failures" in OPSI.
Can someone help me to find the indicator in OPSI when a product installation status changes from "success (setup)" to "failed (setup)" and vice-versa ?

Thanks for your help.
Zakyl
Beiträge: 68
Registriert: 16 Okt 2012, 11:03

Re: OPSI integration with Zabbix

Beitrag von Zakyl »

Hi,

You can see the .ini conf file from each client here /var/lib/opsi/config/clients/

Look at each file and you can see the "actionresult = failed" if the product have fail the installation.

Don't know if there is a better method
aellert
Beiträge: 37
Registriert: 16 Mai 2012, 11:30

Re: OPSI integration with Zabbix

Beitrag von aellert »

Thanks for the information.
I share with the community my template for zabbix and the recipe ti get it work :

1. Give zabbix user the right to read /var/lib/opsi/config/clients :

Code: Alles auswählen

adduser zabbix pcpatch
2. Add zabbix agent UserParameter :

Code: Alles auswählen

cat /etc/zabbix/zabbix_agentd.conf.d/zabbix_agent.userparams_opsi.conf
UserParameter=opsi.nb_products_errors,grep "actionresult = failed" /var/lib/opsi/config/clients/* | wc -l
UserParameter=opsi.computers_with_errors,grep "actionresult = failed" /var/lib/opsi/config/clients/*| cut -d ':' -f 1 | cut -d '/' -f 7 | sed -e 's/\(.*\)\.ini$/\1/' | sort | uniq
3. Restart zabbix-agent

Code: Alles auswählen

/etc/init.d/zabbix-agent restart
4. Upload the attached template in zabbix and apply it to your OPSI server. Template monitores also these OPSI process : opsi-atftpd, opsiconfd, opsipxeconfd

Any comment or enhancement are welcome !

PS : i can't upload the template, i have error message "Sorry, the board attachment quota has been reached". Can the webmaster fix that ? Here is a temporary link to download it : http://213.251.184.107/zabbix_OPSI_template.xml
Benutzeravatar
tobias
Beiträge: 1294
Registriert: 20 Aug 2008, 12:36
Wohnort: Braunschweig
Kontaktdaten:

Re: OPSI integration with Zabbix

Beitrag von tobias »

you can try to use the OPSI-Webservice to get these informations directly from the OPSI-Backend. (JSON-RPC)
Or if you use the MySQL-Backen (Cofinanced Module) you can get the report out of the database.
(it's not recommend by UIB to get Informations directly out of the Backend, whether from database or filebackend. )

Thats only an idea, I don't know how zabbix works ;)
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: OPSI integration with Zabbix

Beitrag von n.wenselowski »

Hello,

I'd recommend using the webinterface or the command-line tool opsi-admin because with these methods you can change your Backends to whatever you like and still have the functionality you want.
You then could use the methods getClientsWithFailed_hash and productOnClient_getHashes.


Kind regards

N. Wenselowski

Code: Alles auswählen

import OPSI
Benutzeravatar
ueluekmen
uib-Team
Beiträge: 1940
Registriert: 28 Mai 2008, 10:53

Re: OPSI integration with Zabbix

Beitrag von ueluekmen »

Hi,

You can use also use the opsi-nagios-connector Extension from opsi. With this extension you have much more possibilities to monitor your opsi infrastructure. I think the only thing you must do is to modify the check_opsi plugin, that it will run with zabbix.


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


aellert
Beiträge: 37
Registriert: 16 Mai 2012, 11:30

Re: OPSI integration with Zabbix

Beitrag von aellert »

Hi,

I've just bought a Mysql Backend licence and my initial script doesn't work anymore :)
Do you have some example script using API, I will try to do the job using it.

Thanks.
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: OPSI integration with Zabbix

Beitrag von n.wenselowski »

Hello aellert,

the manual has a small section about opsi-admin right here.
You can try to use the methods I suggested in my earlier post or use the opsi-nagios-connector ;)


With kind regards

N. Wenselowski

Code: Alles auswählen

import OPSI
Antworten