Created
June 13, 2016 23:11
-
-
Save clonemeagain/846abb02c9507bdc62d4440ac37a2103 to your computer and use it in GitHub Desktop.
Monitoring osTicket unassigned and open ticket count with Nagios3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An example service definition for nagios that assumes you have the following information: | |
$DATABASE_{HOST,NAME,USER,PASS} for connecting to the database | |
$DOMAIN = to create a Nagios link | |
$PREFIX = what you used to prefix your db in osTicket (commonly ost) | |
Ensure check_mysql_query is installed and working, create a read-only db-user from your nagios host to your database, | |
tweak the open and unassigned ticket count to your liking, in this example 100 = warning, 250 = critical | |
define service { | |
host_name $DATABASE_HOST | |
service_description OsTickets Open Tickets | |
use generic-service | |
check_command check_mysql_query!"SELECT COUNT(*) FROM $PREFIX_ticket WHERE status='open' AND staff_id=0"!"$DATABASE_USER"!"$DATABASE_PASS"!"$DATABASE_NAME"!100!250 | |
action_url https://$DOMAIN/support/scp/tickets.php | |
register 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm a fan of both osTicket and Nagios, thought I'd share how I monitor one from tother.. I'm sure there is a way of creating tickets from nagios alerts too, but I haven't used that yet.