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.
Download zbx_average.rb.gz (Ruby) Script to total or average an item over a period of time. Works with Delta and non-Delta values. Requires MySQL Ruby libraries
-
-
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.
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
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.
Graph items referencing non-existent items - rarely usable, can be removed by gitemid;
items that reference non-existent host;
items without description;
triggers without function references
actions with zero eventid - might be possible to “rescue”, see alerts table patching for upgrade to 1.6.