Comments (9)
The macros in the command are wrong.
The correct command should be in this pattern:
/opt/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="{HOSTNAME}" event="UP" state="{TRIGGER.STATUS}" hostproblemid=1 lasthostproblemid=1 servico="{TRIGGER.NAME}" triggerid="{TRIGGER.ID}" eventzabbix="{EVENT.ID}"
But for you to run the php command in the terminal, you have to replace the macros for valid values.
Ex.:
/opt/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="server" event="DOWN" state="PROBLEM" hostproblemid=1 lasthostproblemid=1 servico="Service httpd is down" triggerid="12345" eventzabbix="53"
run the above command and verify that a ticket was generated in GLPI
any questions, please read the following article
from zabbix-glpi.
Hi,
i'm getting below error while executing the command
[root@ZBX-GLPI-NMS externalscripts]# php /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="{HOST.NAME}" event="UP" state="{TRIGGER.STATUS}" hostproblemid=1 lasthostproblemid=1 servico="{TRIGGER.NAME}" triggerid="{TRIGGER.ID}" eventzabbix="{EVENT.ID}"
- Calling 'glpi.test' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
PHP Fatal error: Call to undefined function xmlrpc_encode_request() in /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php on line 75
[root@ZBX-GLPI-NMS externalscripts]#
[root@ZBX-GLPI-NMS externalscripts]# php tickets_zabbix_glpi.php eventhost="server" event="UP" state="DOWN" hostproblemid=1 lasthostproblemid=1 servico="Service httpd is down" triggerid="12345" eventzabbix="53"
- Calling 'glpi.test' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
PHP Fatal error: Call to undefined function xmlrpc_encode_request() in /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php on line 75
[root@ZBX-GLPI-NMS externalscripts]#
from zabbix-glpi.
Try this:
/opt/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="server" event="DOWN" state="PROBLEM" hostproblemid=1 lasthostproblemid=1 servico="Service httpd is down" triggerid="12345" eventzabbix="53"
from zabbix-glpi.
I've checked the xmlrpc.ini & restarted httpd. after that "PHP Fatal error: Call to undefined function xmlrpc_encode_request()" error got rectified, But still ticket not generated in GLPI & getting below output
[root@ZBX-GLPI-NMS externalscripts]# php /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="server" event="DOWN" state="PROBLEM" hostproblemid=1 lasthostproblemid=1 servico="Service httpd is down" triggerid="12345" eventzabbix="53"
- Calling 'glpi.test' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
[root@ZBX-GLPI-NMS externalscripts]#
[root@ZBX-GLPI-NMS externalscripts]#php /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="server" event="UP" state="PROBLEM" hostproblemid=1 lasthostproblemid=1 servico="Service httpd is down" triggerid="12345" eventzabbix="53"
- Calling 'glpi.test' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
- Calling 'glpi.doLogin' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
- Calling 'glpi.addTicketFollowup' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php?session=qd0g8mpv38hbiqf27ilfi2ivd4
xmlrpc error(14): Bad parameter (ticket) - Calling 'glpi.doLogout' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php?session=qd0g8mpv38hbiqf27ilfi2ivd4
from zabbix-glpi.
Try:
php /var/www/html/glpi/plugins/webservices/scripts/examplesoap.php
This script this script is that you return multiple records, no errors occur. You will see the calls being executed.
If it goes wrong you are having trouble installing the plugin webservices, or is missing a package.
from zabbix-glpi.
Got below output after running the mentioned command, but sorry... could understand the use of it.
[root@GLPI-Ticketing webservices]# php /var/www/html/glpi/plugins/webservices/scripts/examplesoap.php
-
Calling glpi.doLogin on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.createObjects on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.doLogout on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.doLogin on http://localhost//glpi/plugins/webservices/soap.php
PHP Notice: Undefined variable: profile in /var/www/html/glpi/plugins/webservices/scripts/examplesoap.php on line 225 -
Calling glpi.createObjects on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.createObjects on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.createObjects on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.doLogout on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.doLogin on http://localhost//glpi/plugins/webservices/soap.php
-
Calling glpi.getObject on http://localhost//glpi/plugins/webservices/soap.php
Array
(
[name] => WSOAP_Computer_01_TESTING
[id] => 1
[locations_id] => 0
[computertypes_id] => 0
[computermodels_id] => 0
[states_id] => 0
[operatingsystems_id] => 0
[operatingsystemversions_id] => 0
[operatingsystemservicepacks_id] => 0
[autoupdatesystems_id] => 0
[serial] => I98GFD-FF98-F0ZFDF8-980
[otherserial] => 0000134
[users_id] => 6
[groups_id] => 1
[date_mod] => 2016-04-07 16:14:08
[networks_id] => 0
[domains_id] => 0
[manufacturers_id] => 0
[users_id_tech] => 0
[groups_id_tech] => 0
[entities_id] => 1
[Monitor] => Array
(
[1] => Array
(
[name] => WSOAP_Monitor_01_TESTING
[id] => 1
[locations_id] => 0
[monitortypes_id] => 0
[monitormodels_id] => 0
[states_id] => 0
[serial] => I98GFD-8973987-DE98
[otherserial] => 0000190
[users_id] => 6
[groups_id] => 1
[date_mod] => 2016-04-07 16:14:08
[size] => 0
[have_micro] => 0
[have_speaker] => 0
[have_subd] => 0
[have_bnc] => 0
[have_dvi] => 0
[have_pivot] => 0
[have_hdmi] => 0
[have_displayport] => 0
[manufacturers_id] => 0
[users_id_tech] => 0
[groups_id_tech] => 0
[entities_id] => 1
[is_global] => 0
))
)
- Calling glpi.doLogout on http://localhost//glpi/plugins/webservices/soap.php
[root@GLPI-Ticketing webservices]#
I've done some modification (PFB) & now Tickets are generating in GLPI, but macros value are not printing & getting an error (highlighted in bold) Kindly suggest
[root@ZBX-GLPI-NMS scripts]# php /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="{HOST.NAME}" event="DOWN" state="PROBLEM" hostproblemid=0 lasthostproblemid=0 servico="{TRIGGER.NAME}" triggerid="{TRIGGER.ID}" eventzabbix="{EVENT.ID}"
- Calling 'glpi.test' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
- Calling 'glpi.doLogin' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php
- Calling 'glpi.createTicket' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php?session=7i7v8pb88alt9qgjroiupdqq60
PHP Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50173 Library:50312 in /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php on line 223
Traceback (most recent call last):
File "/usr/lib/zabbix/externalscripts/ack_zabbix_glpi.py", line 17, in
reconhecer_evento = conexao.event.acknowledge({"eventids": sys.argv[1], "message": "Ticket " + str(sys.argv[2]) + " criado no GLPI."})
File "/usr/lib/python2.6/site-packages/zabbix_api.py", line 314, in method
return self.universal("%s.%s" % (self.data["prefix"], name), opts[0])
File "/usr/lib/python2.6/site-packages/zabbix_api.py", line 71, in wrapper
return self.do_request(self.json_obj(method, opts))['result']
File "/usr/lib/python2.6/site-packages/zabbix_api.py", line 321, in do_request
return self.parent.do_request(req)
File "/usr/lib/python2.6/site-packages/zabbix_api.py", line 272, in do_request
raise ZabbixAPIException(msg, jobj['error']['code'])
zabbix_api.ZabbixAPIException: (u'Error -32500: Application error., No permissions to referred object or it does not exist! while sending {"params": {"message": "Ticket 1 criado no GLPI.", "eventids": "{EVENT.ID}"}, "jsonrpc": "2.0", "method": "event.acknowledge", "auth": "e4b4169d19666b21bdf5ba942424f39e", "id": 1}', -32500) - Calling 'glpi.doLogout' on http://192.168.233.140/glpi/plugins/webservices/xmlrpc.php?session=7i7v8pb88alt9qgjroiupdqq60
[root@ZBX-GLPI-NMS scripts]#
from zabbix-glpi.
Your problem is that when you execute the command in the shell, you should replace the macros for valid values. That's what makes Zabbix to run the command automatically.
Do this:
In action to create the ticket, you enter the following command:
php /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="{HOSTNAME}" event="DOWN" state="{TRIGGER.STATUS}" hostproblemid=0 lasthostproblemid=0 servico="{TRIGGER.NAME}" triggerid="{TRIGGER.ID}" eventzabbix="{EVENT.ID}"
and in action to close the ticket, you enter the following command:
php /usr/lib/zabbix/externalscripts/tickets_zabbix_glpi.php eventhost="{HOSTNAME}" event="UP" state="{TRIGGER.STATUS}" hostproblemid=1 lasthostproblemid=1 servico="{TRIGGER.NAME}" triggerid="{TRIGGER.ID}" eventzabbix="{EVENT.ID}"
It is enough to work, since it is now opening the ticket in GLPI.
from zabbix-glpi.
Hi Janssen,
Yea I'm able to create ticket with macro values. Thanks a ton for all your support.
Need you help to configure below things
- when event got cleared in zabbix, action become OK, but ack not happening (NO) for that clear event. how can make that to be acknowledged too.
- how i can print usage statistics (like to add some more details about the event) in description along with the existing values.
- How can i configure ack script to ack any event based on the event id from description not from Event Title
Thanks once again... :)
from zabbix-glpi.
Please open an issue for each problem.
from zabbix-glpi.
Related Issues (20)
- Issue in Zabbix opening ticket in GLPI HOT 1
- Bad content
- Problema integração GLPI 0.85.5 + Zabbix 3.2.3 HOT 1
- Plugin webservices + PHP 7.0 error
- Não esta criando Ticket HOT 4
- Acentuação no chamado criado pelo Zabbix HOT 1
- PHP tickets_zabbix_glpi.php
- glpi zabbix
- r
- PHP Warning: file_get_contents...HTTP/1.0 500 Internal Server Error
- Remover
- Acesso negado XMLRPC HOT 2
- Problema com fechamento de Ticket/Chamado no GLPI HOT 7
- Issue in Zabbix-GLPI priority mapping. HOT 4
- erro de acesso negado HOT 4
- Erro Fechamento do Chamado GLPI x Zabbix HOT 2
- Error creating ticket | error(14): Bad parameter (ticket) HOT 7
- Integration with GLPI 0.90.3 + WebServices 1.6.0 + Zabbix 2.4.8 HOT 1
- Script abre chamado somente na Entidade raiz HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zabbix-glpi.