Table of Contents

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
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.