ODT Export
 

Scripts

This area is for scripts which are used to gather data for Zabbix, perform maintenance or configuration tasks on Zabbix.

When adding scripts please denote the “language” used to write the script, eg, Ruby, Python, PHP, Bash, Perl etc, along with any requirements.

1 Gathering data

1.1 Server Scripts

1.2 Agent Scripts

1.2.1 MySQL Scripts n Queries

Totals From Delta Stored procedure to return totals from an item stored as deltas.

2 Configuration and maintenance

2.1 Configuration

2.2 Maintenance

There's proof of concept script which checks for some possible problems in the Zabbix database. There are many more checks that could be added, some listed here.

2.2.1 Checks to add
  • functions, not referenced in trigger expressions;
  • functions, referencing non-existent triggerid;
  • functions that reference non-existent itemids;
  • audit/action log migration problem - eventid or somethin was left empty ?;
  • screens with zero id elements, screens with non-valid elements (how to know which are valid ?);
  • maps with invalid elemenets ?;
  • mediatypeid field in media table references existing mediatypeid from media_type table;
  • valuemapid fields in items and mappings tables reference valid mappingid from valuemaps table;
  • all entries in the screens_items table with a particular screenid have x & y in the bounds of the corresponding screens table screenid field hsize and ysize values;
  • screenid field in screens_items table refers to existing screenid in the screens table;
  • in screens_items, no two items share the same cell for single screen;
  • there are no event entries where eventid > any previous entry, but time < any previous entry
2.2.2 Actions to perform

For most problems, most sensible action would be to remove offending records - they usually are not visible on the frontend, sometimes make other elements invisible in the frontend and can't be reasonably fixed. Sometimes, though, fixing entries like that might be possible.

  1. Graph items referencing non-existent items - rarely usable, can be removed by gitemid;
  2. items that reference non-existent host;
  3. items without description;
  4. triggers without function references
  5. actions with zero eventid - might be possible to “rescue”, see alerts table patching for upgrade to 1.6.
 
scripts/start.txt · Last modified: 2009/09/18 06:55 by richlv
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki