[MXS-1802] Zabbix monitoring of Maxscale instances Created: 2018-04-13  Updated: 2021-08-30  Resolved: 2021-08-30

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: None
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: markus makela Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None


 Description   

Provide scripts for monitoring MaxScale with Zabbix.

To monitor whether maxscale is up, use the /v1/maxscale/threads endpoint.



 Comments   
Comment by markus makela [ 2018-04-13 ]

Prototype user parameters for monitoring MaxScale.

UserParameter=maxscale.uptime,maxctrl show maxscale --tsv|grep Uptime|cut -f 2
UserParameter=maxscale.sessions,maxctrl list sessions --tsv|wc -l
UserParameter=maxscale.servers.master,maxctrl list servers --tsv|grep "Master,.* Running"|wc -l
UserParameter=maxscale.servers.slave,maxctrl list servers --tsv|grep "Slave,.* Running"|wc -l
UserParameter=maxscale.servers.down,maxctrl list servers --tsv|grep "Down"|wc -l
UserParameter=maxscale.servers.auth_error,maxctrl list servers --tsv|grep "Auth"|wc -l
UserParameter=maxscale.services.connections[*],maxctrl show service $1 --tsv|grep "Current Connections"|cut -f 2

Comment by markus makela [ 2018-05-01 ]

Here's a slightly more refined version:

# Zabbix parameters for MaxScale.                                                                                                                                                             
#                                                                                                                                                                                             
# The ADMIN_USER and ADMIN_PASSWORD macros need to be defined. These are the                                                                                                                  
# credentials that are used to access the REST API.                                                                                                                                           
#                                                                                                                                                                                             
 
# Information about MaxScale itself                                                                                                                                                           
UserParameter=maxscale.uptime,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD show maxscale --tsv|grep "Uptime"|cut -f 2
UserParameter=maxscale.version,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD show maxscale --tsv|grep "Version"|cut -f 2
UserParameter=maxscale.activated,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD show maxscale --tsv|grep "Activated At"|cut -f 2
 
# Global, per service and per server statistics                                                                                                                                               
UserParameter=maxscale.connections,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list sessions --tsv|wc -l
UserParameter=maxscale.services.connections[*],maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD show service $1 --tsv|grep "Current Connections"|cut -f 2
UserParameter=maxscale.servers.connections[*],maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD show server $1 --tsv|grep '"connections"'|sed 's/.*: *([0-9]*).*/\1/'
UserParameter=maxscale.servers.operations[*],maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD show server $1 --tsv|grep '"active_operations"'|sed 's/.*: *([0-9]*).*/\1/'
 
# Server counts by type                                                                                                                                                                       
UserParameter=maxscale.servers,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list servers --tsv|wc -l
UserParameter=maxscale.servers.master,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list servers --tsv|grep -c "Master,.* Running"
UserParameter=maxscale.servers.slave,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list servers --tsv|grep -c "Slave,.* Running"
UserParameter=maxscale.servers.down,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list servers --tsv|grep -c "Down"
UserParameter=maxscale.servers.synced,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list servers --tsv|grep -c "Synced"
UserParameter=maxscale.servers.auth_error,maxctrl -u $ADMIN_USER -p $ADMIN_PASSWORD list servers --tsv|grep -c "Auth"
 
# Stopped services and monitors                                                                                                                                                               
UserParameter=maxscale.stopped_services, curl -s ${ADMIN_USER}:${ADMIN_PASSWORD}@localhost:8989/v1/services|grep -c '"state": "Stopped"'
UserParameter=maxscale.stopped_monitors, curl -s ${ADMIN_USER}:${ADMIN_PASSWORD}@localhost:8989/v1/monitors|grep -c '"state": "Stopped"'

Comment by markus makela [ 2021-08-30 ]

Closing as Won't Do, not really needed and this isn't moving anywhere.

Generated at Thu Feb 08 04:09:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.