Shell scripts in conjunction zabbix monitoring mysql
To give a typical example, used zabbix should know monitors some applications need to write scripts. The following script relatively straightforward and simple, we will need to monitor each item written as a function, when executed calls just fine. $ 1 to the end of the actual script to accept the first argument can be used to fill in the monitored items in zabbix.
#!/bin/bash uptime() { mysqladmin status -uroot -p123123 | awk '{print $2}' } Threads() { mysqladmin status -uroot -p123123 | awk '{print $4}' } question() { mysqladmin status -uroot -p123123 | awk '{print $6}' } Slow_querie() { mysqladmin extended-status -uroot -p123123 | grep Slow | awk 'NR==2 {print $4}' } $1