Your SlideShare is downloading. ×
Using Zabbix API from Drupal
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Using Zabbix API from Drupal

1,623
views

Published on

Using Zabbix API from Drupal by Walter Heck at Zabbix Conference 2011

Using Zabbix API from Drupal by Walter Heck at Zabbix Conference 2011

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,623
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Extending Zabbix using the APIA real world example October 1st, 2011 Zabbix Conference, Riga, Latvia Walter Heck, Tribily.com
  • 2. Introduction 2 The zabbix API is still quite new, but already quitepowerful. This presentation will show you one of many uses for it. Be inspired!
  • 3. Who am I? 3• Walter Heck, 30 years old• Ex-Delphi programmer• Location independent• MySQL Consultant for Open Query• Narcoleptic• Traveler / hitchhiker / couchsurfer / diver / hiker / geek / environmentalist / metalhead
  • 4. Tribily 4 • Server monitoring as a service (SMaaS) • Role = 1 or more templates • Template is either an App, OS, or hardware • Self-defined Restrictions • Active only hosts • 1 User <=> 1Hostgroup <=> 1Usergroup • Zabbix permissions read-only • All writes done through Drupal module
  • 5. Drupal module 5• Custom module written in PHP, started from scratch• Fully Open Source: http://github.com/tribily•
  • 6. Zabbix 6• Currently 1.8.2, but API is young and buggy, imminent upgrade to 1.8.8• Interfacing using PHP API class by Andrew Farley• Only admin user has API permissions turned on
  • 7. Structure 7• Login first, PHP API will check // This logs into Zabbix, and returns FALSE if it fails return ZabbixAPI::login($API_url, $API_user, $API_pass);• Then execute your method $trigger = ZabbixAPI::fetch_array(trigger, get, $options) or drupal_set_message(Unable to get zabbix triggers: . serialize(ZabbixAPI::getLastError(), TRUE), DRUPAL_MSG_TYPE_ERR);
  • 8. Module functionality - user 8• Create zabbix user, usergroup and hostgroup on creation of drupal user• Create hosts (no IP or DNS, status monitored)• Assign templates based on roles
  • 9. Module functionality – Admin 9• Update actions text (hundreds of users, thousands of actions!)• Configuration options• Zabbix API credentials
  • 10. Challenges 10• Using older 1.8.2, so not everything works or is actually transparent, so lots of searching the zabbix frontend source• Not everything is implemented • Sometimes delete and re-add works better then update
  • 11. Future plans 11• Eventually replace frontend altogether (unless it improves massively before that ;) ) and pull it into drupal• Multiple users / usergroups / hostgroups per drupal user• Daily / weekly / monthly reports
  • 12. 12Questions / Feedback ?
  • 13. The End!http://tribily.comwalter@tribily.com @tribily