Hi All!
In our organization we use Zabbix as a monitoring solution for our
servers and network hardware. So, I wrote a small addon to the
SystemMonitoring module, which adds Zabbix acknowledgement functions to
this module.
Work sequence in general:
1. OTRS receives e-mail with text like "Event: 1234567".
2. PostMaster filter SystemMonitoring gets EventID by regexp and writes
it into TicketFreeText field.
3. Ticket Event stack calls ZabbixAcknowledge module.
4. ZabbixAcknowledge module fetches EventID from the ticket and sends
JSON request to Zabbix.
The attachments contain changed files. What was added:
1. In Kernel/System/PostMaster/Filter/SystemMonitoring.pm: additional
TicketFreeField (#3 by default) for storing Zabbix EventID.
2. Added Kernel/System/Ticket/Event/ZabbixAcknowledge.pm - filter
module, which sends acknowledgement to Zabbix server when TicketFreeText
with key='Event' and value=ZabbixEventID is added to the ticket.
3. In Kernel/Config/Files/SystemMonitoring.xml: options for the
ZabbixAcknowledge module.
Options description:
1. PostMaster::PreFilterModule###1-SystemMonitoring
Added fields:
- FreeTextEvent - FreeText number for EventID
- EventRegExp - RegExp to find EventID in the mail.
2. Ticket::EventModulePost###930-NagiosAcknowledge
Adds NagiosAcknowledge module to the EventModule stack for the Ticket.
3. Ticket::EventModulePost###931-ZabbixAcknowledge
Adds ZabbixAcknowledge module to the EventModule stack for the Ticket.
4. Zabbix::Acknowledge::Enable - self-explainory :)
5. Zabbix::Acknowledge::FreeField::Event - TicketFreeField for EventID.
6. Zabbix::Acknowledge::HTTP::URL, Zabbix::Acknowledge::HTTP::User,
Zabbix::Acknowledge::HTTP::Password - Zabbix JSON API URL, user name and
password.
7. Zabbix::Acknowledge::Message - message to post in Zabbix when
acknowledging. See NagiosAcknowledge, format is the same.
Zabbix configuration:
1. Add group with API access rights and GUI access set to "Internal".
2. Grant permissions to all the objects, events from which you want to
acknowledge.
3. Create a user and add it to the group. Set user's e-mail to one of
the OTRS mail addresses.
4. Configure Zabbix::Acknowledge::HTTP::User,
Zabbix::Acknowledge::HTTP::Password corresponding to this users parameters.
5. In Zabbix in Configuration -> Actions add new action to send mail
event reports to the user you created with text like:
Trigger: {TRIGGER.NAME}
Host: {HOSTNAME}
Service: {TRIGGER.KEY}
Severity: {TRIGGER.NSEVERITY} ({TRIGGER.SEVERITY})
State: {TRIGGER.STATUS}
Event: {EVENT.ID}
Last value: {ITEM.LASTVALUE}
URL:
http://zabbix.example.com/zabbix/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}
6. Set "Restore message" with the same text.
7/ Save config and enjoy :)
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev