mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
MySQL Application poller (thanks to Ove)
git-svn-id: http://www.observium.org/svn/observer/trunk@1725 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':CDe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':CIt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':CISt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':CLd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:e='.$rrd_filename.':CRe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:f='.$rrd_filename.':CRSt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:g='.$rrd_filename.':CSt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:h='.$rrd_filename.':CUe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:i='.$rrd_filename.':CUMi:AVERAGE ';
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= "AREA:a#22FF22:Delete\ \ ";
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#0022FF:"Insert ":STACK ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:c#FF0000:"Insert Select":STACK ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:d#00AAAA:"Load Data":STACK ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:e#FF00FF:"Replace ":STACK ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:f#FFA500:"Replace Select":STACK ';
|
||||
$rrd_options .= 'GPRINT:f:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:g#CC0000:"Select ":STACK ';
|
||||
$rrd_options .= 'GPRINT:g:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:g:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:g:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:h#0000CC:"Update ":STACK ';
|
||||
$rrd_options .= 'GPRINT:h:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:h:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:h:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:i#0080C0:"Update Multi":STACK ';
|
||||
$rrd_options .= 'GPRINT:i:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:i:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:i:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
51
html/includes/graphs/application/mysql_connections.inc.php
Normal file
51
html/includes/graphs/application/mysql_connections.inc.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' -b 1000 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':MaCs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':MUCs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':ACs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':AdCs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:e='.$rrd_filename.':TCd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:f='.$rrd_filename.':Cs:AVERAGE ';
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#cdcfc4:"Max Connections"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#FFD660:"Max Used Connections"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#22FF22:"Aborted Clients"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:d#0022FF:"Aborted Connects"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE:e#FF0000:"Threads Connected"\ \ ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:f#00AAAA:"New Connections"\ \ ';
|
||||
$rrd_options .= 'GPRINT:f:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
|
||||
?>
|
39
html/includes/graphs/application/mysql_files_tables.inc.php
Normal file
39
html/includes/graphs/application/mysql_files_tables.inc.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' -b 1000 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':TOC:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':OFs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':OTs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':OdTs:AVERAGE ';
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#cdcfc4:"Table Cache"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:b#FFD660:"Open Files"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#22FF22:"Open Tables"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:d#0022FF:"Opened Tables"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
|
||||
?>
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBPse:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBPDBp:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBPFe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':IBPMps:AVERAGE ';
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#FFD660:"Buffer Pool Size"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#CDCFC4:"Database Pages"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#22FF22:"Free Pages"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:d#0022FF:"Modified Pages"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
|
||||
?>
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBRd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBCd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBWr:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:d=a,b,c,+,+ ';
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#22FF22:"Pages Read"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:b#0022FF:"Pages Created"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#FF0000:"Pages Written"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:d#000000:"Total"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
?>
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBIIs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBIMRd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBIMs:AVERAGE ';
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:a#22FF22:"Inserts"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:b#0022FF:"Merged Records"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#FF0000:"Merges"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
38
html/includes/graphs/application/mysql_innodb_io.inc.php
Normal file
38
html/includes/graphs/application/mysql_innodb_io.inc.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBIRd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBIWr:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBILg:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':IBIFSc:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:a#22FF22:"File Reads"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:b#0022FF:"File Writes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#FF0000:"Log Writes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:d#00AAAA:"File syncs"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBILog:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBISc:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBIFLg:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':IBFBl:AVERAGE ';
|
||||
$rrd_options .= ' DEF:e='.$rrd_filename.':IBIIAo:AVERAGE ';
|
||||
$rrd_options .= ' DEF:f='.$rrd_filename.':IBIAd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:g='.$rrd_filename.':IBIAe:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:a#22FF22:"AIO Log"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:b#0022FF:"AIO Sync"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#FF0000:"Buf Pool Flush"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:d#00AAAA:"Log Flushes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:e#FF00FF:"Insert Buf AIO Read"\ \ ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:f#FFA500:"Normal AIO Reads"\ \ ';
|
||||
$rrd_options .= 'GPRINT:f:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:d#CC0000:"Normal AIO Writes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:g:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:g:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:g:MAX:"%6.2lf %s\n" ';
|
||||
?>
|
32
html/includes/graphs/application/mysql_innodb_log.inc.php
Normal file
32
html/includes/graphs/application/mysql_innodb_log.inc.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IDBLBSe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBLFh:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBLWn:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#FAFD9E:"Buffer Size"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:b#22FF22:"KB Flushed"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#0022FF:"KB Written"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IDBRDd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IDBRId:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IDBRRd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':IDBRUd:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:e=a,b,c,d,+,+,+ ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#22FF22:"Deletes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#0022FF:"Inserts":STACK ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:c#FF0000:"Reads":STACK ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:d#00AAAA:"Updates":STACK ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:e#000000:"Total":STACK ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBSRs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':IBSWs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':IBOWs:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#22FF22:"Spin Rounds"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:b#0022FF:"Spin Waits"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#FF0000:"OS Waits"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
?>
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1000 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':IBTNx:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:a#22FF22:"Transactions created"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s" ';
|
||||
?>
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':KRRs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':KRs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':KWR:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':KWs:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:a#22FF22:"Key read requests"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:b#0022FF:"Key reads"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:c#FF0000:"Key write requests"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE1:d#00AAAA:"Key writes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':BRd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':BSt:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:c=a,-1,* ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#00AA00:"Bytes read"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:b#00AA00:"Bytes sent"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
46
html/includes/graphs/application/mysql_query_cache.inc.php
Normal file
46
html/includes/graphs/application/mysql_query_cache.inc.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':QCQICe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':QCHs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':QCIs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':QCNCd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:e='.$rrd_filename.':QCLMPs:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#22FF22:"Queries in cache"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:b#0022FF:"Cache hits"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#FF0000:"Inserts"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:d#00AAAA:"Not cached"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:e#FF00FF:"Low-memory prunes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' -l 0 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':QCs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':QCeFy:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#22FF22:"Cache size"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#0022FF:"Free mem"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
53
html/includes/graphs/application/mysql_select_types.inc.php
Normal file
53
html/includes/graphs/application/mysql_select_types.inc.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' -l 0 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':SFJn:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':SFRJn:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':SRe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':SRCk:AVERAGE ';
|
||||
$rrd_options .= ' DEF:e='.$rrd_filename.':SSn:AVERAGE ';
|
||||
$rrd_options .= ' CDEF:total=a,b,c,d,e,+,+,+,+ ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:a#22FF22:"Full Join"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#0022FF:"Full Range"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:c#FF0000:"Range"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:d#00AAAA:"Range Check"\ \ ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:e#FF00FF:"Scan"\ \ ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:total#000000:"Total"\ \ ';
|
||||
$rrd_options .= 'GPRINT:total:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:total:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:total:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
23
html/includes/graphs/application/mysql_slow_queries.inc.php
Normal file
23
html/includes/graphs/application/mysql_slow_queries.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
/* $rrd_options .= ' -b 1024 '; */
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':SQs:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#22FF22:"Slow queries"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
|
||||
?>
|
38
html/includes/graphs/application/mysql_sorts.inc.php
Normal file
38
html/includes/graphs/application/mysql_sorts.inc.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
$rrd_options .= ' -b 1000 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':SRows:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':SRange:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':SMPs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':SScan:AVERAGE ';
|
||||
|
||||
$rrd_options .= 'COMMENT:"\t Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#22FF22:"Rows Sorted"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= "LINE2:b#0022FF:Range\ \ ";
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#FF0000:"Merge Passes"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= "LINE2:d#FF0000:Scan\ \ ";
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
?>
|
30
html/includes/graphs/application/mysql_table_locks.inc.php
Normal file
30
html/includes/graphs/application/mysql_table_locks.inc.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
/* $rrd_options .= ' -b 1024 '; */
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':TLIe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':TLWd:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#00FF00:"Table locks immed"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:b#0022FF:"Table locks waited"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
|
||||
|
||||
?>
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
|
||||
if(is_file($mysql_rrd)) {
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
|
||||
/* $rrd_options .= ' -b 1024 '; */
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':CTMPDTs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':CTMPTs:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':CTMPFs:AVERAGE ';
|
||||
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:a#22FF22:"Temp disk tables"\ \ ';
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:b#0022FF:"Temp tables"\ \ ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'LINE2:c#FF0000:"Temp files"\ \ ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
|
||||
|
||||
?>
|
@ -27,6 +27,9 @@ if($multiplier)
|
||||
$rrd_options .= " DEF:".$in."octets_max=".$rrd_filename_in.":".$rra_in.":MAX";
|
||||
}
|
||||
|
||||
## No?
|
||||
#print $multiplier;
|
||||
|
||||
$rrd_options .= " CDEF:octets=inoctets,outoctets,+";
|
||||
$rrd_options .= " CDEF:doutoctets=outoctets,-1,*";
|
||||
$rrd_options .= " CDEF:outbits=outoctets,8,*";
|
||||
|
46
html/pages/device/apps/mysql.inc.php
Normal file
46
html/pages/device/apps/mysql.inc.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
global $config;
|
||||
|
||||
$graphs = array('mysql_command_counters' => 'Command Counters',
|
||||
'mysql_connections' => 'Connections',
|
||||
'mysql_files_tables' => 'Files and Tables',
|
||||
'mysql_innodb_buffer_pool' => 'InnoDB Buffer Pool',
|
||||
'mysql_innodb_buffer_pool_activity' => 'InnoDB Buffer Pool Activity',
|
||||
'mysql_innodb_insert_buffer' => 'InnoDB Insert Buffer',
|
||||
'mysql_innodb_io' => 'InnoDB IO',
|
||||
'mysql_innodb_io_pending' => 'InnoDB IO Pending',
|
||||
'mysql_innodb_log' => 'InnoDB Log',
|
||||
'mysql_innodb_row_operations' => 'InnoDB Row Operations',
|
||||
'mysql_innodb_semaphores' => 'InnoDB semaphores',
|
||||
'mysql_innodb_transactions' => 'InnoDB Transactions',
|
||||
'mysql_myisam_indexes' => 'MyISAM Indexes',
|
||||
'mysql_network_traffic' => 'Network Traffic',
|
||||
'mysql_query_cache' => 'Query Cache',
|
||||
'mysql_query_cache_memory' => 'Query Cache Memory',
|
||||
'mysql_select_types' => 'Select Types',
|
||||
'mysql_slow_queries' => 'Slow Queries',
|
||||
'mysql_sorts' => 'Sorts',
|
||||
'mysql_table_locks' => 'Table Locks',
|
||||
'mysql_temporary_objects' => 'Temporary Objects');
|
||||
|
||||
foreach($graphs as $key => $text) {
|
||||
$graph_type = $key;
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $app['app_id'];
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
echo("</td></tr>");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
114
includes/polling/applications/mysql.inc.php
Normal file
114
includes/polling/applications/mysql.inc.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
#Polls MySQL statistics from script via SNMP
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
$mysql_cmd = $config['snmpget'] ." -m NET-SNMP-EXTEND-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||
$mysql_cmd .= " nsExtendOutputFull.5.109.121.115.113.108";
|
||||
|
||||
$mysql = shell_exec($mysql_cmd);
|
||||
|
||||
echo " mysql...";
|
||||
|
||||
|
||||
$data = explode("\n", $mysql);
|
||||
$nstring = trim(implode(':',$data),':');
|
||||
|
||||
if (!is_file($mysql_rrd)) {
|
||||
rrdtool_create ($mysql_rrd, "--step 300 \
|
||||
DS:IDBLBSe:GAUGE:600:0:125000000000 \
|
||||
DS:IBLFh:DERIVE:600:0:125000000000 \
|
||||
DS:IBLWn:DERIVE:600:0:125000000000 \
|
||||
DS:SRows:DERIVE:600:0:125000000000 \
|
||||
DS:SRange:DERIVE:600:0:125000000000 \
|
||||
DS:SMPs:DERIVE:600:0:125000000000 \
|
||||
DS:SScan:DERIVE:600:0:125000000000 \
|
||||
DS:IBIRd:DERIVE:600:0:125000000000 \
|
||||
DS:IBIWr:DERIVE:600:0:125000000000 \
|
||||
DS:IBILg:DERIVE:600:0:125000000000 \
|
||||
DS:IBIFSc:DERIVE:600:0:125000000000 \
|
||||
DS:IDBRDd:DERIVE:600:0:125000000000 \
|
||||
DS:IDBRId:DERIVE:600:0:125000000000 \
|
||||
DS:IDBRRd:DERIVE:600:0:125000000000 \
|
||||
DS:IDBRUd:DERIVE:600:0:125000000000 \
|
||||
DS:IBRd:DERIVE:600:0:125000000000 \
|
||||
DS:IBCd:DERIVE:600:0:125000000000 \
|
||||
DS:IBWr:DERIVE:600:0:125000000000 \
|
||||
DS:TLIe:DERIVE:600:0:125000000000 \
|
||||
DS:TLWd:DERIVE:600:0:125000000000 \
|
||||
DS:IBPse:GAUGE:600:0:125000000000 \
|
||||
DS:IBPDBp:GAUGE:600:0:125000000000 \
|
||||
DS:IBPFe:GAUGE:600:0:125000000000 \
|
||||
DS:IBPMps:GAUGE:600:0:125000000000 \
|
||||
DS:TOC:GAUGE:600:0:125000000000 \
|
||||
DS:OFs:GAUGE:600:0:125000000000 \
|
||||
DS:OTs:GAUGE:600:0:125000000000 \
|
||||
DS:OdTs:GAUGE:600:0:125000000000 \
|
||||
DS:IBSRs:DERIVE:600:0:125000000000 \
|
||||
DS:IBSWs:DERIVE:600:0:125000000000 \
|
||||
DS:IBOWs:DERIVE:600:0:125000000000 \
|
||||
DS:QCs:GAUGE:600:0:125000000000 \
|
||||
DS:QCeFy:GAUGE:600:0:125000000000 \
|
||||
DS:MaCs:GAUGE:600:0:125000000000 \
|
||||
DS:MUCs:GAUGE:600:0:125000000000 \
|
||||
DS:ACs:DERIVE:600:0:125000000000 \
|
||||
DS:AdCs:DERIVE:600:0:125000000000 \
|
||||
DS:TCd:GAUGE:600:0:125000000000 \
|
||||
DS:Cs:DERIVE:600:0:125000000000 \
|
||||
DS:IBTNx:DERIVE:600:0:125000000000 \
|
||||
DS:KRRs:DERIVE:600:0:125000000000 \
|
||||
DS:KRs:DERIVE:600:0:125000000000 \
|
||||
DS:KWR:DERIVE:600:0:125000000000 \
|
||||
DS:KWs:DERIVE:600:0:125000000000 \
|
||||
DS:QCQICe:DERIVE:600:0:125000000000 \
|
||||
DS:QCHs:DERIVE:600:0:125000000000 \
|
||||
DS:QCIs:DERIVE:600:0:125000000000 \
|
||||
DS:QCNCd:DERIVE:600:0:125000000000 \
|
||||
DS:QCLMPs:DERIVE:600:0:125000000000 \
|
||||
DS:CTMPDTs:DERIVE:600:0:125000000000 \
|
||||
DS:CTMPTs:DERIVE:600:0:125000000000 \
|
||||
DS:CTMPFs:DERIVE:600:0:125000000000 \
|
||||
DS:IBIIs:DERIVE:600:0:125000000000 \
|
||||
DS:IBIMRd:DERIVE:600:0:125000000000 \
|
||||
DS:IBIMs:DERIVE:600:0:125000000000 \
|
||||
DS:IBILog:DERIVE:602:0:125000000000 \
|
||||
DS:IBISc:DERIVE:602:0:125000000000 \
|
||||
DS:IBIFLg:DERIVE:600:0:125000000000 \
|
||||
DS:IBFBl:DERIVE:600:0:125000000000 \
|
||||
DS:IBIIAo:DERIVE:600:0:125000000000 \
|
||||
DS:IBIAd:DERIVE:600:0:125000000000 \
|
||||
DS:IBIAe:DERIVE:600:0:125000000000 \
|
||||
DS:SFJn:DERIVE:600:0:125000000000 \
|
||||
DS:SFRJn:DERIVE:600:0:125000000000 \
|
||||
DS:SRe:DERIVE:600:0:125000000000 \
|
||||
DS:SRCk:DERIVE:600:0:125000000000 \
|
||||
DS:SSn:DERIVE:600:0:125000000000 \
|
||||
DS:SQs:DERIVE:600:0:125000000000 \
|
||||
DS:BRd:DERIVE:600:0:125000000000 \
|
||||
DS:BSt:DERIVE:600:0:125000000000 \
|
||||
DS:CDe:DERIVE:600:0:125000000000 \
|
||||
DS:CIt:DERIVE:600:0:125000000000 \
|
||||
DS:CISt:DERIVE:600:0:125000000000 \
|
||||
DS:CLd:DERIVE:600:0:125000000000 \
|
||||
DS:CRe:DERIVE:600:0:125000000000 \
|
||||
DS:CRSt:DERIVE:600:0:125000000000 \
|
||||
DS:CSt:DERIVE:600:0:125000000000 \
|
||||
DS:CUe:DERIVE:600:0:125000000000 \
|
||||
DS:CUMi:DERIVE:600:0:125000000000 \
|
||||
RRA:AVERAGE:0.5:1:600 \
|
||||
RRA:AVERAGE:0.5:6:700 \
|
||||
RRA:AVERAGE:0.5:24:775 \
|
||||
RRA:AVERAGE:0.5:288:797 \
|
||||
RRA:MIN:0.5:1:600 \
|
||||
RRA:MIN:0.5:6:700 \
|
||||
RRA:MIN:0.5:24:775 \
|
||||
RRA:MIN:0.5:3:600 \
|
||||
RRA:MAX:0.5:1:600 \
|
||||
RRA:MAX:0.5:6:700 \
|
||||
RRA:MAX:0.5:24:775 \
|
||||
RRA:MAX:0.5:288:797");
|
||||
}
|
||||
|
||||
rrdtool_update($mysql_rrd, "N:$nstring");
|
||||
echo "done ";
|
||||
?>
|
131
scripts/mysql-stats
Normal file
131
scripts/mysql-stats
Normal file
@ -0,0 +1,131 @@
|
||||
#!/usr/bin/env python
|
||||
import warnings
|
||||
import re
|
||||
warnings.filterwarnings(action="ignore", message='the sets module is deprecated')
|
||||
import sets
|
||||
import MySQLdb
|
||||
import base64
|
||||
conn = MySQLdb.connect(host='',
|
||||
user='',
|
||||
passwd='',
|
||||
db='')
|
||||
|
||||
cursor = conn.cursor ()
|
||||
|
||||
|
||||
cursor.execute ("SHOW GLOBAL STATUS")
|
||||
rows = cursor.fetchall()
|
||||
|
||||
datavariables = {
|
||||
'Command Counters': ['Com_delete','Com_insert','Com_insert_select','Com_load','Com_replace','Com_replace_select', 'Com_select', 'Com_update', 'Com_update_multi'],
|
||||
'Connections': ['max_connections', 'Max_used_connections', 'Aborted_clients', 'Aborted_connects','Threads_connected','Connections'],
|
||||
'Files and Tables': ['table_open_cache','Open_files','Open_tables','Opened_tables'],
|
||||
'InnoDB Buffer Pool': ['ib_bpool_size','ib_bpool_dbpages', 'ib_bpool_free','ib_bpool_modpages'],
|
||||
'InnoDB Buffer Pool Activity': ['ib_bpool_read','ib_bpool_created', 'ib_bpool_written'],
|
||||
'InnoDB Insert Buffer': ['ib_ibuf_inserts','ib_ibuf_merged_rec', 'ib_ibuf_merges'],
|
||||
'InnoDB IO': ['ib_io_read','ib_io_write','ib_io_log', 'ib_io_fsync'],
|
||||
'InnoDB IO Pending': ['ib_iop_log','ib_iop_sync', 'ib_iop_flush_log', 'ib_iop_flush_bpool', 'ib_iop_ibuf_aio','ib_iop_aioread','ib_iop_aiowrite'],
|
||||
'InnoDB Log': ['innodb_log_buffer_size','ib_log_flush','ib_log_written'],
|
||||
'InnoDB Row Operations': ['Innodb_rows_deleted','Innodb_rows_inserted','Innodb_rows_read','Innodb_rows_updated'],
|
||||
'InnoDB Semaphores': ['ib_spin_rounds','ib_spin_waits','ib_os_waits'],
|
||||
'InnoDB Transactions': ['ib_tnx'],
|
||||
'MyISAM Indexes': ['Key_read_requests','Key_reads','Key_write_requests','Key_writes'],
|
||||
'Network Traffic': ['Bytes_received','Bytes_sent'],
|
||||
'Query Cache': ['Qcache_queries_in_cache','Qcache_hits','Qcache_inserts','Qcache_not_cached','Qcache_lowmem_prunes'],
|
||||
'Query Cache Memory': ['query_cache_size','Qcache_free_memory'],
|
||||
'Select Types': ['Select_full_join','Select_full_range_join','Select_range','Select_range_check','Select_scan'],
|
||||
'Slow Queries': ['Slow_queries'],
|
||||
'Sorts': ['Sort_rows','Sort_range','Sort_merge_passes','Sort_scan'],
|
||||
'Table Locks': ['Table_locks_immediate','Table_locks_waited'],
|
||||
'Temporary Objects': ['Created_tmp_disk_tables','Created_tmp_tables','Created_tmp_files']
|
||||
}
|
||||
|
||||
data = {}
|
||||
for row in rows:
|
||||
data[row[0]] = row[1]
|
||||
|
||||
cursor = ""
|
||||
cursor = conn.cursor ()
|
||||
cursor.execute ("SHOW VARIABLES")
|
||||
rows = cursor.fetchall()
|
||||
|
||||
for row in rows:
|
||||
data[row[0]] = row[1]
|
||||
|
||||
cursor = ""
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SHOW ENGINE INNODB STATUS")
|
||||
rows = cursor.fetchall()
|
||||
|
||||
for row in rows:
|
||||
for line in row[2].split("\n"):
|
||||
ib_bpool_size = re.match(r"Buffer\spool\ssize\s+(\d+)", line)
|
||||
ib_bpool_free = re.match(r"Free\sbuffers\s+(\d+)", line)
|
||||
ib_bpool_dbpages = re.match(r"Database\spages\s+(\d+)", line)
|
||||
ib_bpool_modpages = re.match(r"Modified\sdb\spages\s+(\d+)", line)
|
||||
ib_b_reg = re.match(r"Pages\sread\s(\d+),\screated\s(\d+),\swritten (\d+)", line)
|
||||
ib_insert_buffer = re.match(r"(\d+)\sinserts,\s(\d+)\smerged\srecs,\s(\d+)", line)
|
||||
ib_io = re.match(r"(\d+)\sOS\sfile\sreads,\s(\d+)\sOS\sfile\swrites,\s(\d+)\sOS\sfsyncs", line)
|
||||
ib_io_log = re.match(r"(\d+)\slog\si\/o's\sdone.*", line)
|
||||
ib_io_p1 = re.match(r"Pending\snormal\saio\sreads:\s(\d+),\saio\swrites:\s(\d+),", line)
|
||||
ib_io_p2 = re.match(r"\s?ibuf\saio\sreads:\s(\d+),\slog\si\/o's:\s(\d+),\ssync\si\/o's:\s(\d+)", line)
|
||||
ib_io_p3 = re.match(r"\s?Pending\sflushes\s\(fsync\)\slog:\s(\d+);\sbuffer\spool:\s(\d+)\s?", line)
|
||||
ib_log_p1 = re.match(r"\s?Log\ssequence\snumber\s([[a-fA-F\d]+)(?: (\d+))?", line)
|
||||
ib_log_p2 = re.match(r"\s?Log\sflushed\sup\sto\s+([[a-fA-F\d]+)(?: (\d+))?", line)
|
||||
ib_semaphore = re.match(r"\s?Mutex\sspin\swaits\s(\d+),\srounds\s(\d+),\sOS waits\s(\d+)", line)
|
||||
ib_tnx = re.match(r"\s?Trx\sid\scounter\s([[a-fA-F\d]+)(?: (\d+))?", line)
|
||||
|
||||
if ib_bpool_size:
|
||||
data['ib_bpool_size'] = ib_bpool_size.group(1)
|
||||
elif ib_bpool_free:
|
||||
data['ib_bpool_free'] = ib_bpool_free.group(1)
|
||||
elif ib_bpool_dbpages:
|
||||
data['ib_bpool_dbpages'] = ib_bpool_dbpages.group(1)
|
||||
elif ib_bpool_modpages:
|
||||
data['ib_bpool_modpages'] = ib_bpool_modpages.group(1)
|
||||
elif ib_insert_buffer:
|
||||
data['ib_ibuf_inserts'] = ib_insert_buffer.group(1)
|
||||
data['ib_ibuf_merged_rec'] = ib_insert_buffer.group(2)
|
||||
data['ib_ibuf_merges'] = ib_insert_buffer.group(3)
|
||||
elif ib_io:
|
||||
data['ib_io_read'] = ib_io.group(1)
|
||||
data['ib_io_write'] = ib_io.group(2)
|
||||
data['ib_io_fsync'] = ib_io.group(3)
|
||||
elif ib_io_log:
|
||||
data['ib_io_log'] = ib_io_log.group(1)
|
||||
elif ib_io_p1:
|
||||
data['ib_iop_aioread'] = ib_io_p1.group(1)
|
||||
data['ib_iop_aiowrite'] = ib_io_p1.group(2)
|
||||
elif ib_io_p2:
|
||||
data['ib_iop_ibuf_aio'] = ib_io_p2.group(1)
|
||||
data['ib_iop_log'] = ib_io_p2.group(2)
|
||||
data['ib_iop_sync'] = ib_io_p2.group(3)
|
||||
elif ib_io_p3:
|
||||
data['ib_iop_flush_log'] = ib_io_p3.group(1)
|
||||
data['ib_iop_flush_bpool'] = ib_io_p3.group(2)
|
||||
elif ib_log_p1:
|
||||
data['ib_log_written'] = ib_log_p1.group(1)
|
||||
if ib_log_p1.group(2):
|
||||
data['ib_log_written'] = int(data['ib_log_written']) + int(ib_log_p1.group(2))
|
||||
elif ib_log_p2:
|
||||
data['ib_log_flush'] = ib_log_p2.group(1)
|
||||
if ib_log_p2.group(2):
|
||||
data['ib_log_flush'] = int(data['ib_log_flush']) + int(ib_log_p2.group(2))
|
||||
elif ib_semaphore:
|
||||
data['ib_spin_waits'] = ib_semaphore.group(1)
|
||||
data['ib_spin_rounds'] = ib_semaphore.group(2)
|
||||
data['ib_os_waits'] = ib_semaphore.group(3)
|
||||
elif ib_tnx:
|
||||
data['ib_tnx'] = ib_tnx.group(1)
|
||||
if ib_tnx.group(2):
|
||||
data['ib_tnx'] = int(data['ib_tnx']) + int(ib_tnx.group(2))
|
||||
elif ib_b_reg:
|
||||
data['ib_bpool_read'] = ib_b_reg.group(1)
|
||||
data['ib_bpool_created'] = ib_b_reg.group(2)
|
||||
data['ib_bpool_written'] = ib_b_reg.group(3)
|
||||
|
||||
|
||||
for category in datavariables:
|
||||
for variable in datavariables[category]:
|
||||
if variable in data:
|
||||
print data[variable]
|
Reference in New Issue
Block a user