/usr/bin
NameSizeModeActions
2to31060755editdlrm
2to3-3.61060755editdlrm
ab743680755editdlrm
aclocal364780755editdlrm
aclocal-1.16364780755editdlrm
acyclic127120755editdlrm
addr2line342240755editdlrm
alias290755editdlrm
animate121280755editdlrm
apropos553360755editdlrm
ar634480755editdlrm
arch382320755editdlrm
aria_chk56372320755editdlrm
aria_dump_log54318640755editdlrm
aria_ftdump54444320755editdlrm
aria_pack54708640755editdlrm
aria_read_log55913840755editdlrm
arpaname121040755editdlrm
as9112640755editdlrm
aspell1633280755editdlrm
at587040755editdlrm
atq587040755editdlrm
atrm587040755editdlrm
aulast210720755editdlrm
aulastlog127360755editdlrm
ausyscall125680755editdlrm
authselect421120755editdlrm
autoconf147680755editdlrm
autoheader85340755editdlrm
autom4te321810755editdlrm
automake2579490755editdlrm
automake-1.162579490755editdlrm
autopoint265720755editdlrm
autoreconf210660755editdlrm
autoscan171240755editdlrm
autoupdate338720755editdlrm
auvirt335120755editdlrm
awk6858480755editdlrm
b2sum590720755editdlrm
base32424640755editdlrm
base64424800755editdlrm
basename383120755editdlrm
bash11546800755editdlrm
bashbug73480755editdlrm
bashbug-6473480755editdlrm
batch1370755editdlrm
bc972560755editdlrm
bcomps211120755editdlrm
bdftopcf464880755editdlrm
bg260755editdlrm
bind9-config34160755editdlrm
bison4482240755editdlrm
bluemoon1000480755editdlrm
bluetoothctl2941200755editdlrm
bond2team232890755editdlrm
bootctl462320755editdlrm
brotli7569440755editdlrm
btattach916880755editdlrm
btmon9667360755editdlrm
bunzip2377440755editdlrm
busctl791200755editdlrm
bwrap712960755editdlrm
bzcat377440755editdlrm
bzcmp21280755editdlrm
bzdiff21280755editdlrm
bzegrep16770755editdlrm
bzfgrep16770755editdlrm
bzgrep16770755editdlrm
bzip2377440755editdlrm
bzip2recover168320755editdlrm
bzless12590755editdlrm
bzmore12590755editdlrm
c++12666160755editdlrm
c++filt295840755editdlrm
c892240755editdlrm
c992150755editdlrm
ca-legacy16440755editdlrm
cairo-sphinx713840755editdlrm
cal675600755editdlrm
captoinfo873600755editdlrm
cat383600755editdlrm
catchsegv32830755editdlrm
catman424480755editdlrm
cc12665760755editdlrm
ccomps253120755editdlrm
cd260755editdlrm
centrino-decode115360755editdlrm
certutil2039280755editdlrm
chacl167680755editdlrm
chage795440755editdlrm
chardetect4000755editdlrm
chattr168000755editdlrm
chcon720240755editdlrm
checkmodule4372560755editdlrm
checkpolicy5003680755editdlrm
chfn336880711editdlrm
chgrp678640755editdlrm
chmem465600755editdlrm
chmod636880755editdlrm
chown719760755editdlrm
chronyc1306640755editdlrm
chrt380800755editdlrm
chsh253120711editdlrm
chvt128320755editdlrm
cifsiostat423440755editdlrm
ciptool2158160755editdlrm
circo125520755editdlrm
cksum382880755editdlrm
clear128400755editdlrm
cloud-id4020755editdlrm
cloud-init4060755editdlrm
cloud-init-per21080755editdlrm
cluster5307680755editdlrm
cmp1062480755editdlrm
cmsutil1254000755editdlrm
col297040755editdlrm
colcrt168720755editdlrm
colrm254800755editdlrm
column506560755editdlrm
comm425600755editdlrm
command310755editdlrm
compare121360755editdlrm
compile_et13420755editdlrm
composite121200755editdlrm
config_data71380755editdlrm
conjure121200755editdlrm
convert121200755editdlrm
coredumpctl459920755editdlrm
corelist149950755editdlrm
cp1515280755editdlrm
cpan83700755editdlrm
cpan-mirrors42880755editdlrm
cpapi134969120755editdlrm
cpapi234969120755editdlrm
cpapi334969120755editdlrm
cpio1636400755editdlrm
cpp12665520755editdlrm
cpupower685120755editdlrm
crb26440744editdlrm
crc3210430755editdlrm
crlutil1381840755editdlrm
cronnext510000755editdlrm
crontab631524755editdlrm
csplit549680755editdlrm
csslint-0.6251520755editdlrm
curl2356000755editdlrm
cut507040755editdlrm
cvtsudoers2910320755editdlrm
cxpm298080755editdlrm
date1084960755editdlrm
dbilogstrip13800755editdlrm
dbiprof62060755editdlrm
dbus-binding-tool1130800755editdlrm
dbus-cleanup-sockets167840755editdlrm
dbus-daemon2454480755editdlrm
dbus-monitor292640755editdlrm
dbus-run-session162640755editdlrm
dbus-send292240755editdlrm
dbus-test-tool251920755editdlrm
dbus-update-activation-environment168080755editdlrm
dbus-uuidgen126720755editdlrm
dbxtool252400755editdlrm
db_archive127520755editdlrm
db_checkpoint168720755editdlrm
db_deadlock168720755editdlrm
db_dump169040755editdlrm
db_dump185712240755editdlrm
db_hotbackup209840755editdlrm
db_load292960755editdlrm
db_log_verify169120755editdlrm
db_printlog342000755editdlrm
db_recover169040755editdlrm
db_replicate168880755editdlrm
db_stat168720755editdlrm
db_tuner251440755editdlrm
db_upgrade127520755editdlrm
db_verify168560755editdlrm
dc542960755editdlrm
dd798400755editdlrm
deallocvt128400755editdlrm
debuginfo-install37020755editdlrm
debuginfod-find168640755editdlrm
delv434800755editdlrm
df932720755editdlrm
diff2744400755editdlrm
diff31316880755editdlrm
diffimg125680755editdlrm
dig1660640755editdlrm
dijkstra171120755editdlrm
dir1432480755editdlrm
dircolors507440755editdlrm
dirmngr5938080755editdlrm
dirmngr-client1230000755editdlrm
dirname341600755editdlrm
display121280755editdlrm
dltest121520755editdlrm
dmesg797440755editdlrm
dnf21040755editdlrm
dnf-321040755editdlrm
dnsdomainname216640755editdlrm
dnstap-read209200755editdlrm
domainname216640755editdlrm
dot125520755editdlrm
dot2gxl422880755editdlrm
dotty20850755editdlrm
doveadm9735040755editdlrm
doveconf3978480755editdlrm
dovecot-sysreport64310755editdlrm
dpkg3237600755editdlrm
dpkg-deb1694720755editdlrm
dpkg-divert1615360755editdlrm
dpkg-maintscript-helper211620755editdlrm
dpkg-query1698240755editdlrm
dpkg-realpath41490755editdlrm
dpkg-split1355680755editdlrm
dpkg-statoverride680080755editdlrm
dpkg-trigger897680755editdlrm
dracut691820755editdlrm
dtrace178080755editdlrm
du1095680755editdlrm
dumpkeys1739520755editdlrm
dumpsexp168320755editdlrm
dwp22334400755editdlrm
dwz1716640755editdlrm
ea-php7463827840755editdlrm
ea-php74-pear3830755editdlrm
ea-php74-pecl2990755editdlrm
ea-php8281471280755editdlrm
ea-php82-pear3830755editdlrm
ea-php82-pecl2990755editdlrm
ea-php8381757760755editdlrm
ea-php83-pear3830755editdlrm
ea-php83-pecl2990755editdlrm
ea-wappspector1000755editdlrm
easy_install-32460755editdlrm
easy_install-3.62460755editdlrm
echo382480755editdlrm
edgepaint4308880755editdlrm
egrep280755editdlrm
eject591680755editdlrm
elfedit340800755editdlrm
enc2xs419580755editdlrm
encguess29800755editdlrm
env423520755editdlrm
envml41970755editdlrm
envsubst501680755editdlrm
eps2eps6390755editdlrm
eqn2377280755editdlrm
event_rpcgen.py555590755editdlrm
evmctl640400755editdlrm
ex11805600755editdlrm
expand425920755editdlrm
expr507520755editdlrm
factor880320755editdlrm
fallocate296560755editdlrm
false341200755editdlrm
fc260755editdlrm
fc-cache1320755editdlrm
fc-cache-64208400755editdlrm
fc-cat167440755editdlrm
fc-conflist125440755editdlrm
fc-list125440755editdlrm
fc-match166480755editdlrm
fc-pattern125520755editdlrm
fc-query125360755editdlrm
fc-scan125520755editdlrm
fc-validate166480755editdlrm
fdp125520755editdlrm
fg260755editdlrm
fgconsole128480755editdlrm
fgrep280755editdlrm
filan969920755editdlrm
file252800755editdlrm
fincore338320755editdlrm
find2286320755editdlrm
find-repos-of-install37020755editdlrm
findmnt723040755editdlrm
fips-finish-install13230755editdlrm
fips-mode-setup40070755editdlrm
firewall-cmd1429550755editdlrm
firewall-offline-cmd1236240755editdlrm
flex4387280755editdlrm
flex++4387280755editdlrm
flock339920755editdlrm
fmt465840755editdlrm
fold424160755editdlrm
fonttosfnt421680755editdlrm
free212880755editdlrm
freetype-config44160755editdlrm
fribidi216480755editdlrm
ftp1036320755editdlrm
funzip375040755editdlrm
fwupdmgr1620800755editdlrm
fwupdtool2118480755editdlrm
g++12666160755editdlrm
g132170640755editdlrm
galera_new_cluster12680755editdlrm
galera_recovery33660755editdlrm
gapplication209360755editdlrm
garb-systemd13450755editdlrm
garbd17353040755editdlrm
gatttool3801760755editdlrm
gawk6858480755editdlrm
gc170400755editdlrm
gcc12665760755editdlrm
gcc-ar375360755editdlrm
gcc-nm375360755editdlrm
gcc-ranlib375360755editdlrm
gcov13774080755editdlrm
gcov-dump5846640755editdlrm
gcov-tool6223600755editdlrm
gdbmtool1142480755editdlrm
gdbm_dump215600755editdlrm
gdbm_load259200755editdlrm
gdbus498880755editdlrm
gdk-pixbuf-query-loaders-64163120755editdlrm
gdk-pixbuf-thumbnailer209440755editdlrm
gdlib-config28610755editdlrm
gencat254320755editdlrm
genl-ctrl-list123280755editdlrm
geqn2377280755editdlrm
GET162170755editdlrm
getconf332400755editdlrm
getent339200755editdlrm
getfacl293840755editdlrm
getkeycodes128400755editdlrm
getopt210240755editdlrm
getopts310755editdlrm
gettext501440755editdlrm
gettext.sh46290755editdlrm
gettextize437180755editdlrm
ghostscript126480755editdlrm
gio872640755editdlrm
gio-querymodules-64166960755editdlrm
git276658160755editdlrm
git-receive-pack276658160755editdlrm
git-shell165537680755editdlrm
git-upload-archive276658160755editdlrm
git-upload-pack276658160755editdlrm
glib-compile-schemas500240755editdlrm
gmake2409680755editdlrm
gml2gv422160755editdlrm
gneqn9080755editdlrm
gnroff33120755editdlrm
gpasswd841444755editdlrm
gpg10903440755editdlrm
gpg-agent4293600755editdlrm
gpg-connect-agent1692720755editdlrm
gpg-error349760755editdlrm
gpg-error-config23180755editdlrm
gpg-wks-server2116720755editdlrm
gpg-zip35250755editdlrm
gpg210903440755editdlrm
gpgconf1803280755editdlrm
gpgme-json877360755editdlrm
gpgparsemail294320755editdlrm
gpgrt-config23180755editdlrm
gpgsm5268080755editdlrm
gpgsplit891120755editdlrm
gpgv4623440755editdlrm
gpgv24623440755editdlrm
gpic3008960755editdlrm
gpio-event-mon153200755editdlrm
gpio-hammer153200755editdlrm
gprof1058320755editdlrm
gr2fonttest306720755editdlrm
graphml2gv211440755editdlrm
grep1982800755editdlrm
groff1279200755editdlrm
grops1957280755editdlrm
grotty1453040755editdlrm
groups382880755editdlrm
growpart298950755editdlrm
grub2-editenv4588480755editdlrm
grub2-file9508320755editdlrm
grub2-fstest12104560755editdlrm
grub2-glue-efi2861200755editdlrm
grub2-kbdcomp16680755editdlrm
grub2-menulst2cfg2689600755editdlrm
grub2-mkfont3196160755editdlrm
grub2-mkimage4417600755editdlrm
grub2-mklayout2964320755editdlrm
grub2-mknetdir4974880755editdlrm
grub2-mkpasswd-pbkdf22988880755editdlrm
grub2-mkrelpath2859680755editdlrm
grub2-mkrescue11702080755editdlrm
grub2-mkstandalone6085600755editdlrm
grub2-render-label9595760755editdlrm
grub2-script-check3235840755editdlrm
grub2-syslinux2cfg8822880755editdlrm
gs126480755editdlrm
gsettings292960755editdlrm
gsnd2770755editdlrm
gsoelim435760755editdlrm
gss-client251520755editdlrm
gtar4597680755editdlrm
gtbl1583200755editdlrm
gtk-query-immodules-2.0-64166800755editdlrm
gtk-update-icon-cache338240755editdlrm
gtroff8243440755editdlrm
gunzip23450755editdlrm
gv2gml252880755editdlrm
gv2gxl422880755editdlrm
gvcolor480240755editdlrm
gvgen253920755editdlrm
gvmap5389440755editdlrm
gvmap.sh21900755editdlrm
gvpack4716400755editdlrm
gvpr80160755editdlrm
gxl2dot422880755editdlrm
gxl2gv422880755editdlrm
gzexe63750755editdlrm
gzip969440755editdlrm
h2ph293820755editdlrm
h2xs608660755editdlrm
hash280755editdlrm
hciattach2073280755editdlrm
hciconfig2009840755editdlrm
hcidump4932400755editdlrm
hcitool2169840755editdlrm
HEAD162170755editdlrm
head466000755editdlrm
hex2hcd167760755editdlrm
hexdump588880755editdlrm
hmac256172720755editdlrm
host1457120755editdlrm
hostid341360755editdlrm
hostname216640755editdlrm
hostnamectl213280755editdlrm
htdbm324800755editdlrm
htdigest222320755editdlrm
html2text4060755editdlrm
htpasswd323040755editdlrm
httxt2dbm216080755editdlrm
hunspell1481680755editdlrm
i386212560755editdlrm
iceauth428720755editdlrm
iconv629040755editdlrm
id465280755editdlrm
identify121280755editdlrm
idiag-socket-details123760755editdlrm
idn403520755editdlrm
ifnames41280755editdlrm
iio_event_monitor235280755editdlrm
iio_generic_buffer276240755editdlrm
import121200755editdlrm
imunify-agent-proxy137819220755editdlrm
imunify-antivirus10240755editdlrm
imunify-fgw-dump81830000755editdlrm
imunify-service10200755editdlrm
imunify360-agent10240755editdlrm
imunify360-command-wrapper122100755editdlrm
info2558880755editdlrm
infocmp625120755editdlrm
infotocap873600755editdlrm
innochecksum47652960755editdlrm
install1598880755editdlrm
install-tools41580755editdlrm
instmodsh41940755editdlrm
intel-speed-select952560755editdlrm
ionice296800755editdlrm
iostat590720755editdlrm
ipcalc471840755editdlrm
ipcmk298400755editdlrm
ipcrm296880755editdlrm
ipcs546800755editdlrm
isc-config.sh34160755editdlrm
isosize254800755editdlrm
ispell9880755editdlrm
isql374560755editdlrm
iusql293440755editdlrm
jcat-tool419120755editdlrm
jobs280755editdlrm
join549840755editdlrm
journalctl788400755editdlrm
jq290960755editdlrm
jsondiff10330755editdlrm
jsondiff-310330755editdlrm
jsondiff-3.610330755editdlrm
jsonpatch36760755editdlrm
jsonpatch-336760755editdlrm
jsonpatch-3.636760755editdlrm
jsonpointer13560755editdlrm
jsonpointer-313560755editdlrm
jsonpointer-3.613560755editdlrm
jsonschema-34090755editdlrm
json_pp42860755editdlrm
json_reformat169520755editdlrm
json_verify125680755editdlrm
json_xs70020755editdlrm
kbdinfo169600755editdlrm
kbdrate168400755editdlrm
kbd_mode128560755editdlrm
kbxutil1816080755editdlrm
kdumpctl337220755editdlrm
kernel-install45110755editdlrm
keyctl377040755editdlrm
kill381760755editdlrm
killall304800755editdlrm
kmod1637840755editdlrm
krb5-config71440755editdlrm
kvm_stat623070755editdlrm
l2ping1676880755editdlrm
l2test1844960755editdlrm
last504160755editdlrm
lastb504160755editdlrm
lastlog211200755editdlrm
lchfn208400755editdlrm
lchsh167440755editdlrm
ld17890800755editdlrm
ld.bfd17890800755editdlrm
ld.gold24676560755editdlrm
ld.so11040640755editdlrm
ldd54410755editdlrm
lefty3118320755editdlrm
less1779280755editdlrm
lessecho126960755editdlrm
lesskey225200755editdlrm
lesspipe.sh31430755editdlrm
lex4387280755editdlrm
lexgrog959520755editdlrm
libgcrypt-config39310755editdlrm
libnetcfg157750755editdlrm
libpng-config23820755editdlrm
libpng16-config23820755editdlrm
libtool3677240755editdlrm
libtoolize1291970755editdlrm
libwmf-fontmap133400755editdlrm
link341360755editdlrm
linux-boot-prober59930755editdlrm
linux32212560755editdlrm
linux64212560755editdlrm
ln721920755editdlrm
lneato15470755editdlrm
loadkeys2155840755editdlrm
loadunimap297280755editdlrm
locale577920755editdlrm
localectl295520755editdlrm
localedef3148480755editdlrm
logger511840755editdlrm
login419440755editdlrm
loginctl586560755editdlrm
logname341440755editdlrm
logresolve219680755editdlrm
look168560755editdlrm
ls1432480755editdlrm
lsattr122160755editdlrm
lsblk923040755editdlrm
lscpu836560755editdlrm
lsgpio154240755editdlrm
lsiio235280755editdlrm
lsinitrd88860755editdlrm
lsipc755120755editdlrm
lslocks384320755editdlrm
lslogins671920755editdlrm
lsmem464240755editdlrm
lsns504720755editdlrm
lsof1796080755editdlrm
lsphp9370755editdlrm
lsscsi880720755editdlrm
lua209440755editdlrm
luac1564400755editdlrm
lwp-download102920755editdlrm
lwp-dump27110755editdlrm
lwp-mirror24130755editdlrm
lwp-request162170755editdlrm
m41900160755editdlrm
Mail4187040755editdlrm
mail4187040755editdlrm
mailx4187040755editdlrm
make2409680755editdlrm
make-dummy-cert6100755editdlrm
makedb254320755editdlrm
man1152240755editdlrm
mandb1377440755editdlrm
manpath342240755editdlrm
mapscrn254400755editdlrm
mariadb55014880755editdlrm
mariadb-access1119610755editdlrm
mariadb-admin50426560755editdlrm
mariadb-binlog53285040755editdlrm
mariadb-check50355760755editdlrm
mariadb-config124880755editdlrm
mariadb-conv47561040755editdlrm
mariadb-convert-table-format42200755editdlrm
mariadb-dump51282240755editdlrm
mariadb-dumpslow82420755editdlrm
mariadb-embedded249113200755editdlrm
mariadb-find-rows32900755editdlrm
mariadb-fix-extensions12500755editdlrm
mariadb-hotcopy353590755editdlrm
mariadb-import50304480755editdlrm
mariadb-install-db226920755editdlrm
mariadb-plugin47349120755editdlrm
mariadb-secure-installation137990755editdlrm
mariadb-service-convert25060755editdlrm
mariadb-setpermission179770755editdlrm
mariadb-show50247360755editdlrm
mariadb-slap50442800755editdlrm
mariadb-tzinfo-to-sql47343360755editdlrm
mariadb-upgrade51858560755editdlrm
mariadb-waitpid47216160755editdlrm
mariadbd-multi274250755editdlrm
mariadbd-safe312140755editdlrm
mariadbd-safe-helper46917920755editdlrm
mariadb_config124880755editdlrm
mcookie340640755editdlrm
mcpp92320755editdlrm
md5sum466400755editdlrm
mdig496800755editdlrm
memstrack857920755editdlrm
mesg167520755editdlrm
miniterm-3.6.py338870755editdlrm
miniterm-3.py338870755editdlrm
mkdir846800755editdlrm
mkfifo680560755editdlrm
mkfontdir650755editdlrm
mkfontscale425920755editdlrm
mkinitrd65850755editdlrm
mknod721600755editdlrm
mktemp467600755editdlrm
mm2gv927040755editdlrm
mmdblookup171440755editdlrm
modulecmd3939800755editdlrm
modulemd-validator255600755editdlrm
modutil1816880755editdlrm
mogrify121200755editdlrm
mokutil511840755editdlrm
montage121200755editdlrm
more460160755editdlrm
mount503280755editdlrm
mountpoint168800755editdlrm
mpicalc208720755editdlrm
mpris-proxy1013680755editdlrm
mpstat547920755editdlrm
msgattrib261920755editdlrm
msgcat261680755editdlrm
msgcmp267440755editdlrm
msgcomm261680755editdlrm
msgconv220720755editdlrm
msgen220640755editdlrm
msgexec220720755editdlrm
msgfilter353600755editdlrm
msgfmt924640755editdlrm
msggrep446480755editdlrm
msginit694800755editdlrm
msgmerge732000755editdlrm
msgunfmt366640755editdlrm
msguniq261760755editdlrm
msql2mysql14460755editdlrm
mv1474080755editdlrm
myisamchk51451360755editdlrm
myisamlog50024160755editdlrm
myisampack50416000755editdlrm
myisam_ftdump50203120755editdlrm
mysql55014880755editdlrm
mysqlaccess1119610755editdlrm
mysqladmin50426560755editdlrm
mysqlbinlog53285040755editdlrm
mysqlcheck50355760755editdlrm
mysqldump51282240755editdlrm
mysqld_multi274250755editdlrm
mysqld_safe312140755editdlrm
mysqld_safe_helper46917920755editdlrm
mysqlimport50304480755editdlrm
mysqlshow50247360755editdlrm
mysqlslap50442800755editdlrm
mysql_config46230755editdlrm
mysql_embedded249113200755editdlrm
mysql_find_rows32900755editdlrm
mysql_fix_extensions12500755editdlrm
mysql_install_db226920755editdlrm
mysql_plugin47349120755editdlrm
mysql_tzinfo_to_sql47343360755editdlrm
mysql_upgrade51858560755editdlrm
mysql_waitpid47216160755editdlrm
mytop737570755editdlrm
my_print_defaults47262880755editdlrm
nail4187040755editdlrm
named-rrchecker203520755editdlrm
namei338960755editdlrm
nano2538880755editdlrm
nc505760755editdlrm
ncurses6-config60150755editdlrm
ncursesw6-config60180755editdlrm
ndptool250400755editdlrm
neato125520755editdlrm
needs-restarting37020755editdlrm
neqn9080755editdlrm
netcat505760755editdlrm
netstat1624880755editdlrm
newgidmap489600755editdlrm
newgrp434800755editdlrm
newuidmap489200755editdlrm
nf-ct-add168560755editdlrm
nf-ct-events126720755editdlrm
nf-ct-list168880755editdlrm
nf-exp-add172720755editdlrm
nf-exp-delete170560755editdlrm
nf-exp-list168880755editdlrm
nf-log126480755editdlrm
nf-monitor126560755editdlrm
nf-queue167440755editdlrm
ngettext501440755editdlrm
nice382240755editdlrm
nisdomainname216640755editdlrm
nl466480755editdlrm
nl-addr-add126320755editdlrm
nl-addr-delete171680755editdlrm
nl-addr-list172800755editdlrm
nl-class-add171280755editdlrm
nl-class-delete129280755editdlrm
nl-class-list128960755editdlrm
nl-classid-lookup127680755editdlrm
nl-cls-add171680755editdlrm
nl-cls-delete171760755editdlrm
nl-cls-list130400755editdlrm
nl-fib-lookup128000755editdlrm
nl-link-enslave121520755editdlrm
nl-link-ifindex2name121520755editdlrm
nl-link-list125280755editdlrm
nl-link-name2ifindex121440755editdlrm
nl-link-release121440755editdlrm
nl-link-set130720755editdlrm
nl-link-stats128880755editdlrm
nl-list-caches125680755editdlrm
nl-list-sockets121520755editdlrm
nl-monitor128160755editdlrm
nl-neigh-add129280755editdlrm
nl-neigh-delete129680755editdlrm
nl-neigh-list124800755editdlrm
nl-neightbl-list122960755editdlrm
nl-pktloc-lookup128640755editdlrm
nl-qdisc-add129520755editdlrm
nl-qdisc-delete129280755editdlrm
nl-qdisc-list171440755editdlrm
nl-route-add167840755editdlrm
nl-route-delete172880755editdlrm
nl-route-get126480755editdlrm
nl-route-list168320755editdlrm
nl-rule-list123360755editdlrm
nl-tctree-list129600755editdlrm
nl-util-addr121360755editdlrm
nm515840755editdlrm
nm-online213360755editdlrm
nmcli10332160755editdlrm
nmtui8029360755editdlrm
nmtui-connect8029360755editdlrm
nmtui-edit8029360755editdlrm
nmtui-hostname8029360755editdlrm
nohup383120755editdlrm
nop128000755editdlrm
nproc383040755editdlrm
nroff33120755editdlrm
nsenter340960755editdlrm
nslookup1497680755editdlrm
nss-policy-check166960755editdlrm
nsupdate748080755editdlrm
numfmt672160755editdlrm
objcopy2458320755editdlrm
objdump4298320755editdlrm
od755760755editdlrm
odbcinst295760755editdlrm
odbc_config121280755editdlrm
open214720755editdlrm
openssl7638480755editdlrm
openvt214720755editdlrm
os-prober59150755editdlrm
osage125520755editdlrm
p11-kit380400755editdlrm
package-cleanup37020755editdlrm
page_owner_sort116160755editdlrm
pango-list121600755editdlrm
pango-view588160755editdlrm
paperconf133840755editdlrm
passwd335604755editdlrm
paste382800755editdlrm
patch2114160755editdlrm
patchwork125520755editdlrm
pathchk382240755editdlrm
pathfix.py67900755editdlrm
pcre2-config19500755editdlrm
pdf2dsc6980755editdlrm
pdf2ps9090755editdlrm
pdnsutil54421120755editdlrm
pdns_control4979360755editdlrm
peekfd169040755editdlrm
perl127280755editdlrm
perl5.26.3127280755editdlrm
perlbug454580755editdlrm
perldoc1180755editdlrm
perlivp108130755editdlrm
perlml67680755editdlrm
perlthanks454580755editdlrm
perror49280080755editdlrm
pflags26360755editdlrm
pftp1036320755editdlrm
pgrep295360755editdlrm
php9370755editdlrm
pic3008960755editdlrm
piconv82710755editdlrm
pidof170960755editdlrm
pidstat672960755editdlrm
pigz1283920755editdlrm
pinentry24040755editdlrm
pinentry-curses797600755editdlrm
ping677120755editdlrm
pinky424560755editdlrm
pip-32090755editdlrm
pip-3.62090755editdlrm
pip32090755editdlrm
pip3.62090755editdlrm
pk12util1137840755editdlrm
pkaction167760755editdlrm
pkcheck250160755editdlrm
pkexec290880755editdlrm
pkg-config410000755editdlrm
pkgconf410000755editdlrm
pkill295360755editdlrm
pkla-admin-identities263360755editdlrm
pkla-check-authorization345920755editdlrm
pkttyagent208720755editdlrm
pl2pm45330755editdlrm
pldd171520755editdlrm
pmap335680755editdlrm
png-fix-itxt121360755editdlrm
pngfix541200755editdlrm
pod2html41340755editdlrm
pod2man150340755editdlrm
pod2text108030755editdlrm
pod2usage39480755editdlrm
podchecker36580755editdlrm
podselect25270755editdlrm
POST162170755editdlrm
post-grohtml2444560755editdlrm
powernow-k8-decode111360755editdlrm
pr841200755editdlrm
pre-grohtml1336880755editdlrm
precat56560755editdlrm
preconv590320755editdlrm
preunzip56560755editdlrm
prezip56560755editdlrm
prezip-bin122640755editdlrm
printenv341200755editdlrm
printf548480755editdlrm
prlimit384400755editdlrm
prl_backup75440755editdlrm
procan845840755editdlrm
protoc168880755editdlrm
protoc-c2506640755editdlrm
protoc-gen-c2506640755editdlrm
prove135620755editdlrm
prtstat210000755editdlrm
prune171280755editdlrm
ps1379840755editdlrm
ps2ascii6310755editdlrm
ps2epsi27520755editdlrm
ps2pdf2720755editdlrm
ps2pdf122150755editdlrm
ps2pdf132150755editdlrm
ps2pdf142150755editdlrm
ps2pdfwr10970755editdlrm
ps2ps6470755editdlrm
ps2ps26690755editdlrm
psfaddtable211520755editdlrm
psfgettable211520755editdlrm
psfstriptable211520755editdlrm
psfxtable211520755editdlrm
pslog127840755editdlrm
pstree343360755editdlrm
pstree.x11343360755editdlrm
ptar34560755editdlrm
ptardiff25350755editdlrm
ptargrep42990755editdlrm
ptx798640755editdlrm
pure-pw397680755editdlrm
pure-pwconvert109760755editdlrm
pure-statsdecode109760755editdlrm
pv753280755editdlrm
pwd383200755editdlrm
pwdx129840755editdlrm
pwmake125600755editdlrm
pwscore125600755editdlrm
pybabel3880755editdlrm
pydoc-3890755editdlrm
pydoc3890755editdlrm
pydoc3.6890755editdlrm
pydoc3.12790755editdlrm
pyjwt3840755editdlrm
python-html2text4060755editdlrm
python3118720755editdlrm
python3-config2040755editdlrm
python3-html2text4060755editdlrm
python3.6118720755editdlrm
python3.6-config2040755editdlrm
python3.6m118720755editdlrm
python3.6m-config2040755editdlrm
python3.6m-x86_64-config36260755editdlrm
python3.1277520755editdlrm
pyvenv-34460755editdlrm
pyvenv-3.64460755editdlrm
qemu-ga10044080755editdlrm
quota936884755editdlrm
quotasync764800755editdlrm
ranlib634560755editdlrm
raw168960755editdlrm
rctest2157440755editdlrm
read280755editdlrm
readelf6395280755editdlrm
readlink469840755editdlrm
realpath511440755editdlrm
recode-sr-latin184240755editdlrm
rename168960755editdlrm
renew-dummy-cert7250755editdlrm
renice168560755editdlrm
replace47040880755editdlrm
repo-graph37020755editdlrm
repoclosure37020755editdlrm
repodiff37020755editdlrm
repomanage37020755editdlrm
repoquery37020755editdlrm
reposync37020755editdlrm
repotrack37020755editdlrm
rescan-scsi-bus.sh391610755editdlrm
reset253520755editdlrm
resizecons212720755editdlrm
resolvectl2004480755editdlrm
resolveip47215600755editdlrm
resolve_stack_dump47257280755editdlrm
rev127600755editdlrm
rfcomm1766640755editdlrm
rm720640755editdlrm
rmdir465520755editdlrm
rnano2538880755editdlrm
rpcbind630240755editdlrm
rpcinfo334240755editdlrm
rpm213520755editdlrm
rpm2archive209520755editdlrm
rpm2cpio121280755editdlrm
rpmdb173680755editdlrm
rpmkeys172720755editdlrm
rpmquery213520755editdlrm
rpmverify213520755editdlrm
rsync5348880755editdlrm
rsyslog-recover-qi.pl60980755editdlrm
run-parts19830755editdlrm
run-with-aspell850755editdlrm
runcon382720755editdlrm
rvi11805600755editdlrm
rview11805600755editdlrm
rvim30678560755editdlrm
sadf3426000755editdlrm
sar1390240755editdlrm
sccmap211120755editdlrm
scl377520755editdlrm
scl_enabled2580755editdlrm
scl_source18630755editdlrm
scp1053120755editdlrm
script376800755editdlrm
scriptreplay296960755editdlrm
scsi-rescan391610755editdlrm
scsi_logging_level85850755editdlrm
scsi_mandat36020755editdlrm
scsi_readcap13270755editdlrm
scsi_ready11210755editdlrm
scsi_satl38570755editdlrm
scsi_start12850755editdlrm
scsi_stop14740755editdlrm
scsi_temperature9360755editdlrm
sdiff1078560755editdlrm
sdptool2813600755editdlrm
secon260720755editdlrm
secret-tool216800755editdlrm
sed1180400755editdlrm
sedismod2802320755editdlrm
sedispol2032480755editdlrm
semodule_expand125760755editdlrm
semodule_link125760755editdlrm
semodule_package170800755editdlrm
semodule_unpackage125920755editdlrm
seq547280755editdlrm
sessreg178000755editdlrm
setarch212560755editdlrm
setfacl460640755editdlrm
setfont462720755editdlrm
setkeycodes128640755editdlrm
setleds170000755editdlrm
setmetamode128640755editdlrm
setpriv462400755editdlrm
setsid167680755editdlrm
setterm462080755editdlrm
setup-nsssysinit15390755editdlrm
setup-nsssysinit.sh15390755editdlrm
setvtrgb170400755editdlrm
sfdp125520755editdlrm
sftp1635840755editdlrm
sg434800755editdlrm
sginfo766480755editdlrm
sgm_dd333440755editdlrm
sgp_dd378480755editdlrm
sg_bg_ctl164640755editdlrm
sg_compare_and_write214080755editdlrm
sg_copy_results213200755editdlrm
sg_dd456640755editdlrm
sg_decode_sense208320755editdlrm
sg_emc_trespass125600755editdlrm
sg_format341840755editdlrm
sg_get_config341280755editdlrm
sg_get_lba_status209680755editdlrm
sg_ident165680755editdlrm
sg_inq1207440755editdlrm
sg_logs1536320755editdlrm
sg_luns254640755editdlrm
sg_map168080755editdlrm
sg_map26254800755editdlrm
sg_modes449440755editdlrm
sg_opcodes293760755editdlrm
sg_persist349600755editdlrm
sg_prevent123680755editdlrm
sg_raw249840755editdlrm
sg_rbuf213520755editdlrm
sg_rdac162640755editdlrm
sg_read250160755editdlrm
sg_readcap213760755editdlrm
sg_read_attr356400755editdlrm
sg_read_block_limits124160755editdlrm
sg_read_buffer214800755editdlrm
sg_read_long166640755editdlrm
sg_reassign166240755editdlrm
sg_referrals166320755editdlrm
sg_rep_zones211680755editdlrm
sg_requests167040755editdlrm
sg_reset171440755editdlrm
sg_reset_wp165680755editdlrm
sg_rmsn123680755editdlrm
sg_rtpg165680755editdlrm
sg_safte207600755editdlrm
sg_sanitize251840755editdlrm
sg_sat_identify171280755editdlrm
sg_sat_phy_event210880755editdlrm
sg_sat_read_gplog166960755editdlrm
sg_sat_set_features166640755editdlrm
sg_scan169120755editdlrm
sg_seek172720755editdlrm
sg_senddiag258880755editdlrm
sg_ses1210880755editdlrm
sg_ses_microcode302000755editdlrm
sg_start214480755editdlrm
sg_stpg208000755editdlrm
sg_stream_ctl207600755editdlrm
sg_sync166240755editdlrm
sg_test_rwbuf212480755editdlrm
sg_timestamp212560755editdlrm
sg_turs171600755editdlrm
sg_unmap249120755editdlrm
sg_verify209600755editdlrm
sg_vpd1113760755editdlrm
sg_write_buffer217680755editdlrm
sg_write_long167360755editdlrm
sg_write_same250800755editdlrm
sg_write_verify212960755editdlrm
sg_write_x550560755editdlrm
sg_wr_mode207920755editdlrm
sg_xcopy415760755editdlrm
sg_zone166960755editdlrm
sh11546800755editdlrm
sha1hmac334400755editdlrm
sha1sum466480755editdlrm
sha224hmac334400755editdlrm
sha224sum466720755editdlrm
sha256hmac334400755editdlrm
sha256sum466720755editdlrm
sha384hmac334400755editdlrm
sha384sum466800755editdlrm
sha512hmac334400755editdlrm
sha512sum466880755editdlrm
shasum98920755editdlrm
showconsolefont212320755editdlrm
showkey169760755editdlrm
showrgb133680755editdlrm
shred633360755editdlrm
shuf594880755editdlrm
sieve-dump358720755editdlrm
sieve-filter455520755editdlrm
sieve-test413920755editdlrm
sievec361280755editdlrm
signver1175440755editdlrm
sim_client166640755editdlrm
size340480755editdlrm
skill294880755editdlrm
slabinfo370160755editdlrm
slabtop213440755editdlrm
sleep382960755editdlrm
slencheck125840755editdlrm
sm3hmac334400755editdlrm
snice294880755editdlrm
socat4162480755editdlrm
soelim435760755editdlrm
sort1264320755editdlrm
sotruss42810755editdlrm
spell1220755editdlrm
splain191500755editdlrm
split594400755editdlrm
sprof293600755editdlrm
sqlite313465120755editdlrm
ssh7757760755editdlrm
ssh-add3544480755editdlrm
ssh-agent3333840755editdlrm
ssh-copy-id106940755editdlrm
ssh-keygen4374320755editdlrm
ssh-keyscan4429920755editdlrm
ssltap1336400755editdlrm
sss_ssh_authorizedkeys294720755editdlrm
sss_ssh_knownhostsproxy294720755editdlrm
stat882320755editdlrm
stdbuf506880755editdlrm
strace20298320755editdlrm
strace-log-merge18210755editdlrm
stream121120755editdlrm
strings383280755editdlrm
strip2458560755editdlrm
stty794720755editdlrm
stunnel2305040755editdlrm
su501684750editdlrm
sudo1910004111editdlrm
sudoedit1910004111editdlrm
sudoreplay1220560111editdlrm
sum466240755editdlrm
sw-engine210956320755editdlrm
sxpm295040755editdlrm
sync382560755editdlrm
systemctl2236960755editdlrm
systemd-analyze16348640755editdlrm
systemd-ask-password123120755editdlrm
systemd-cat164160755editdlrm
systemd-cgls168320755editdlrm
systemd-cgtop336720755editdlrm
systemd-delta250320755editdlrm
systemd-detect-virt121680755editdlrm
systemd-escape163920755editdlrm
systemd-firstboot378720755editdlrm
systemd-hwdb296000755editdlrm
systemd-inhibit164160755editdlrm
systemd-machine-id-setup253440755editdlrm
systemd-mount538960755editdlrm
systemd-notify164160755editdlrm
systemd-path164000755editdlrm
systemd-resolve2004480755editdlrm
systemd-run501200755editdlrm
systemd-socket-activate253680755editdlrm
systemd-stdio-bridge164080755editdlrm
systemd-sysusers543200755editdlrm
systemd-tmpfiles750560755editdlrm
systemd-tty-ask-password-agent336080755editdlrm
systemd-umount538960755editdlrm
tabs169520755editdlrm
tac424880755editdlrm
tail759120755editdlrm
tapestat423120755editdlrm
tar4597680755editdlrm
taskset381520755editdlrm
tbl1583200755editdlrm
tclsh92560755editdlrm
tclsh8.692560755editdlrm
tcptraceroute15850755editdlrm
teamd1643680755editdlrm
teamdctl310960755editdlrm
teamnl209600755editdlrm
tee424720755editdlrm
test548480755editdlrm
tic873600755editdlrm
timedatectl378480755editdlrm
timeout428640755editdlrm
tload171600755editdlrm
tmon405760755editdlrm
tmpwatch363200755editdlrm
toe168480755editdlrm
top1246160755editdlrm
touch961920755editdlrm
tput253920755editdlrm
tr508160755editdlrm
tracepath209280755editdlrm
traceroute726720755editdlrm
traceroute6726720755editdlrm
tred169840755editdlrm
troff8243440755editdlrm
true341280755editdlrm
truncate423520755editdlrm
trust2248240755editdlrm
tset253520755editdlrm
tsort424880755editdlrm
tty341120755editdlrm
turbostat1339360755editdlrm
twopi125520755editdlrm
type280755editdlrm
tzselect153700755editdlrm
uapi34969120755editdlrm
ucs2any250000755editdlrm
udevadm4347520755editdlrm
udisksctl621920755editdlrm
ul210800755editdlrm
ulimit300755editdlrm
umask290755editdlrm
umount335360755editdlrm
unalias310755editdlrm
uname382240755editdlrm
uname26212560755editdlrm
unexpand466880755editdlrm
unflatten170240755editdlrm
unicode_start26130755editdlrm
unicode_stop3630755editdlrm
uniq508320755editdlrm
unlink341440755editdlrm
unpigz1283920755editdlrm
unshare255280755editdlrm
unversioned-python1570755editdlrm
unxz840560755editdlrm
unzip2067280755editdlrm
unzipsfx1039120755editdlrm
update-ca-trust12680755editdlrm
update-crypto-policies870755editdlrm
update-gtk-immodules3130755editdlrm
update-mime-database585920755editdlrm
uptime128880755editdlrm
users382960755editdlrm
usleep121440755editdlrm
utmpdump293520755editdlrm
uuclient162560755editdlrm
uuidgen167680755editdlrm
uuidparse380240755editdlrm
vdir1432560755editdlrm
vi11805600755editdlrm
view11805600755editdlrm
vim30678560755editdlrm
vimdiff30678560755editdlrm
vimdot10820755editdlrm
vimtutor21210755editdlrm
vlock213280755editdlrm
vmstat376720755editdlrm
w212480755editdlrm
wait280755editdlrm
wall338400755editdlrm
watch298880755editdlrm
watchgnupg168320755editdlrm
wc508320755editdlrm
wdctl378640755editdlrm
wget5339440755editdlrm
whatis553360755editdlrm
whereis299760755editdlrm
which300880755editdlrm
whiptail338800755editdlrm
who548800755editdlrm
whoami341360755editdlrm
wmf2eps175600755editdlrm
wmf2fig175600755editdlrm
wmf2gd175520755editdlrm
wmf2svg175760755editdlrm
wmf2x175360755editdlrm
word-list-compress122800755editdlrm
write211120755editdlrm
wsrep_sst_backup24470755editdlrm
wsrep_sst_common701410644editdlrm
wsrep_sst_mariabackup542650755editdlrm
wsrep_sst_mysqldump82960755editdlrm
wsrep_sst_rsync314730755editdlrm
wsrep_sst_rsync_wan314730755editdlrm
x86_64212560755editdlrm
x86_64-redhat-linux-c++12666160755editdlrm
x86_64-redhat-linux-g++12666160755editdlrm
x86_64-redhat-linux-gcc12665760755editdlrm
x86_64-redhat-linux-gcc-812665760755editdlrm
x86_64-redhat-linux-gnu-pkg-config4240755editdlrm
x86_energy_perf_policy327200755editdlrm
xargs758880755editdlrm
xb-tool293920755editdlrm
xgamma174880755editdlrm
xgettext2906960755editdlrm
xhost175280755editdlrm
xinput651360755editdlrm
xkill175120755editdlrm
xml2-config17460755editdlrm
xmlcatalog208720755editdlrm
xmllint751360755editdlrm
xmlwf378560755editdlrm
xmodmap409360755editdlrm
xorg-x11-fonts-update-dirs13220744editdlrm
xrandr670320755editdlrm
xrdb348000755editdlrm
xrefresh183680755editdlrm
xset380880755editdlrm
xsetpointer133680755editdlrm
xsetroot219520755editdlrm
xslt-config24180755editdlrm
xsltproc291520755editdlrm
xstdcmap181040755editdlrm
xsubpp50800755editdlrm
xxd210320755editdlrm
xz840560755editdlrm
xzcat840560755editdlrm
xzcmp66320755editdlrm
xzdec168800755editdlrm
xzdiff66320755editdlrm
xzegrep59020755editdlrm
xzfgrep59020755editdlrm
xzgrep59020755editdlrm
xzless18020755editdlrm
xzmore21610755editdlrm
yat2m341440755editdlrm
yes341680755editdlrm
ypdomainname216640755editdlrm
yum21040755editdlrm
yum-builddep37020755editdlrm
yum-config-manager37020755editdlrm
yum-debug-dump37020755editdlrm
yum-debug-restore37020755editdlrm
yum-groups-manager37020755editdlrm
yumdownloader37020755editdlrm
zcat19830755editdlrm
zcmp16770755editdlrm
zdiff58790755editdlrm
zegrep290755editdlrm
zfgrep290755editdlrm
zforce20800755editdlrm
zgrep75820755editdlrm
zip2344960755editdlrm
zipcloak1053760755editdlrm
zipdetails505760755editdlrm
zipgrep29530755editdlrm
zipinfo2067280755editdlrm
zipnote1001040755editdlrm
zipsplit1001040755editdlrm
zless22050755editdlrm
zmore18410755editdlrm
znew45520755editdlrm
zone2json14526480755editdlrm
zone2sql14737760755editdlrm
zsoelim435760755editdlrm
[548880755editdlrm
Edit: /usr/bin/mytop (73757B)
#!/usr/bin/perl # # $Id: mytop,v 1.99-maria8 2025/07/16 17:59:26 jweisbuch Exp $ =pod =head1 NAME mytop - display MariaDB/MySQL server performance info like `top' =cut ## most of the POD is at the bottom of the file use 5.005; use strict; use warnings; use DBI; use Getopt::Long; use Socket; use List::Util qw(min max); use File::Basename; $main::VERSION = "1.99-maria8"; my $path_for_script = dirname($0); $| = 1; $0 = 'mytop'; my $WIN = ($^O eq 'MSWin32') ? 1 : 0; ## Test for color support. eval { require Term::ANSIColor; }; my $HAS_COLOR = $@ ? 0 : 1; $HAS_COLOR = 0 if $WIN; ## Test of Time::HiRes support eval { require Time::HiRes }; my $HAS_TIME = $@ ? 0 : 1; my $debug = 0; ## Try to lower our priority (which, who, pri) setpriority(0,0,10) unless $WIN; ## Prototypes sub Clear(); sub GetData(); sub GetQPS(); sub FullQueryInfo($); sub Explain($); sub PrintTable(@); sub PrintHelp(); sub Sum(@); sub commify($); sub make_short($); sub Hashes($); sub Execute($); sub StringOrRegex($); sub GetInnoDBStatus(); sub GetCmdSummary(); sub GetShowVariables(); sub GetShowStatus(); sub cmd_s; sub cmd_S; sub cmd_q; ## Default Config Values my %config = ( batchmode => 0, color => 1, db => '', database => '', delay => 5, filter_user => qr/.?/, filter_db => qr/.?/, filter_host => qr/.?/, filter_state => qr/.?/, header => 1, help => 0, host => 'localhost', idle => 1, long => 120, long_nums => 0, mode => 'top', prompt => 0, pass => '', password => '', port => 3306, resolve => 0, slow => 10, ## slow query time socket => '', sort => 1, ## default or reverse sort ("s") user => 'root', fullqueries => 0, ## shows untruncated queries usercol_width => 8, ## User column width dbcol_width => 9, ## DB column width hide_progress => 0 ## hide the "%" column when available ); my %qcache = (); ## The query cache--used for full query info support. my %ucache = (); ## The user cache--used for full killing by user my %dbcache = (); ## The db cache. This should be merged at some point. my %statcache = (); ## The show status cache for GetShowStatus() my (%STATUS, %OLD_STATUS); # header stuff. my $CLEAR = $WIN ? '': `clear`; ## Term::ReadKey values my $RM_RESET = 0; my $RM_NOBLKRD = 3; ## using 4 traps Ctrl-C :-( ## Add options from .my.cnf first my $my_print_defaults; if (!defined($my_print_defaults=my_which("my_print_defaults"))) { print "Warning: Can't find my_print_defaults. Please add it to your PATH!\n"; exit(1); } unshift @ARGV, split "\n", `$my_print_defaults client mytop`; ## Read the user's config file, if it exists. my $config = "$ENV{HOME}/.mytop"; if (-e $config) { if (open CFG, "<$config") { while () { next if /^\s*($|#)/; ## skip blanks and comments chomp; if (/(\S+)\s*=\s*(.*\S)/) { my ($k, $v) = ($1, $2); if ($k =~ /^filter_/i) { $config{lc $k} = StringOrRegex($v) if exists $config{lc $k}; } else { $config{lc $k} = $v if exists $config{lc $k}; } } } close CFG; } ## map database/password onto db/pass ## short version gets precedence for historical reasons $config{'db'} = $config{'database'} unless $config{'db'}; $config{'pass'} = $config{'password'} unless $config{'pass'}; } ## Command-line args. use vars qw($opt_foo); Getopt::Long::Configure('no_ignore_case', 'bundling'); GetOptions( "color!" => \$config{color}, "user|u=s" => \$config{user}, "pass|password|p=s" => \$config{pass}, "database|db|d=s" => \$config{db}, "host|h=s" => \$config{host}, "port|P=i" => \$config{port}, "socket|S=s" => \$config{socket}, "delay|s=i" => \$config{delay}, "batch|batchmode|b" => \$config{batchmode}, "header!" => \$config{header}, "idle|i!" => \$config{idle}, "resolve|r!" => \$config{resolve}, "prompt!" => \$config{prompt}, "long=i" => \$config{long}, "long_nums!" => \$config{long_nums}, "mode|m=s" => \$config{mode}, "slow=i" => \$config{slow}, "sort=s" => \$config{sort}, "fullqueries|L!" => \$config{fullqueries}, "usercol_width=i" => \$config{usercol_width}, "dbcol_width=i" => \$config{dbcol_width}, "hide_progress|a!" => \$config{hide_progress} ); ## User may have put the port with the host. if ($config{host} =~ s/:(\d+)$//) { $config{port} = $1; } ## Don't use Term::ReadKey unless running interactively. if (not $config{batchmode}) { require Term::ReadKey; Term::ReadKey->import(); } ## User may want to disable color. if ($HAS_COLOR and not $config{color}) { $HAS_COLOR = 0; } if ($HAS_COLOR) { import Term::ANSIColor ':constants'; } else { *RESET = sub { }; *YELLOW = sub { }; *RED = sub { }; *MAGENTA = sub { }; *GREEN = sub { }; *BLUE = sub { }; *WHITE = sub { }; *BOLD = sub { }; } my $RESET = RESET() || ''; my $YELLOW = YELLOW() || ''; my $RED = RED() || ''; my $MAGENTA = MAGENTA() || ''; my $GREEN = GREEN() || ''; my $BLUE = BLUE() || ''; my $WHITE = WHITE() || ''; my $BOLD = BOLD() || ''; ## Connect my $dsn; ## Socket takes precedence. my $prefix= 'mysql'; if (eval {DBI->install_driver("MariaDB")}) { $dsn = "DBI:MariaDB:database=$config{db};mariadb_read_default_group=mytop;"; $prefix= 'mariadb' } else { $dsn = "DBI:mysql:database=$config{db};mysql_read_default_group=mytop;"; } if ($config{socket} and -S $config{socket}) { $dsn .= "${prefix}_socket=$config{socket}"; } elsif($config{host} eq "localhost") { $dsn .= "host=$config{host}"; } else { $dsn .= "host=$config{host};port=$config{port}"; } if ($config{prompt}) { print "Password: "; ReadMode(2); chomp($config{pass} = ); ReadMode(0); print "\n"; } my $dbh = DBI->connect($dsn, $config{user}, $config{pass}, { PrintError => 0 }); if (not ref $dbh) { my $Error = <{Variable_name} eq "version") { $db_version = $_->{Value}; $db_version =~ /^(\d+)/; $db_release = $1; $server = "MariaDB" if ($db_version =~ /maria/i); # Get the version number only $db_version = $1 if($db_version =~ m/(.*?)-/); next; } if ($_->{Variable_name} eq "have_query_cache") { if ($_->{Value} ne 'NO') { $have_query_cache = 1; } else { $have_query_cache = 0; } next; } } my ($has_is_processlist, $has_time_ms, $has_progress); $has_is_processlist = $has_time_ms = $has_progress = 0; ## Check if the server has the INFORMATION_SCHEMA.PROCESSLIST table ## for backward compatibility $has_is_processlist = Execute("SELECT /*mytop*/ 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'PROCESSLIST';")->rows; if ($has_is_processlist == 1) { ## Check if the server has the TIME_MS column on the I_S.PROCESSLIST table ## If it is the case, it will fetch the query time with decimal precision ## for queries that has been running for less than 10k seconds $has_time_ms = Execute("SELECT /*mytop*/ 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'PROCESSLIST' AND COLUMN_NAME = 'TIME_MS';")->rows; if ($has_time_ms == 1) { ## Check if the server has the STAGE column on the I_S.PROCESSLIST ## table (MariaDB) to retreive query completion information $has_progress = Execute("SELECT /*mytop*/ 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'PROCESSLIST' AND COLUMN_NAME = 'STAGE';")->rows; } } ######################################################################### ## ## The main loop ## ######################################################################### ReadMode($RM_NOBLKRD) unless $config{batchmode}; while (1) { my $key; if ($config{mode} eq 'qps') { GetQPS(); $key = ReadKey(1); next unless $key; if ($key =~ /t/i) { $config{mode} = 'top'; } if ($key =~ /q/) { cmd_q(); } next; } if ($config{mode} eq 'top') { GetData(); last if $config{batchmode}; $key = ReadKey($config{delay}); next unless $key; } elsif ($config{mode} eq 'cmd') { GetCmdSummary(); last if $config{batchmode}; $key = ReadKey($config{delay}); next unless $key; } elsif ($config{mode} eq 'innodb') { GetInnoDBStatus(); last if $config{batchmode}; print "InnoDB Status [hit t to exit this mode or q to exit the application]\n"; $key = ReadKey($config{delay}); next unless $key; } elsif ($config{mode} eq 'status') { GetShowStatus(); last if $config{batchmode}; $key = ReadKey($config{delay}); next unless $key; } ## ## keystroke command processing (if we get this far) ## if ($key eq '!') { Execute("STOP /*mytop*/ SLAVE;"); Execute("SET /*mytop*/ GLOBAL sql_slave_skip_counter=1"); Execute("START /*mytop*/ SLAVE"); } # t - top if ($key =~ /t/i) { $config{mode} = 'top'; } ## q - quit if ($key eq 'q') { cmd_q(); } if ($key eq 'D') { require Data::Dumper; print Data::Dumper::Dumper([\%config]); ReadKey(0); } ## l - change long running hightling if ($key eq 'l') { cmd_l(); next; } ## m - mode switch to qps if ($key eq 'm') { $config{mode} = 'qps'; Clear() unless $config{batchmode}; print "Queries Per Second [hit t to exit this mode or q to exit the application]\n"; next; } ## c - mode switch to command summary if ($key eq 'c') { $config{mode} = 'cmd'; Clear() unless $config{batchmode}; print "Command Summary\n"; next; } ## C - change Color on and off if ($key eq 'C') { if ($HAS_COLOR) { $HAS_COLOR = 0; } else { $HAS_COLOR = 1; } } ## s - seconds of delay if ($key eq 's') { cmd_s(); next; } if ($key eq 'S') { cmd_S(); next; } ## R - resolve hostnames if ($key eq 'R') { if ($config{resolve}) { $config{resolve} = 0; } else { $config{resolve} = 1; } } ## t - username based filter if ($key eq 't') { ReadMode($RM_RESET); print RED(), "Which state (blank for all, /.../ for regex): ", RESET(); $config{filter_state} = StringOrRegex(ReadLine(0)); ReadMode($RM_NOBLKRD); next; } ## u - username based filter if ($key eq 'u') { ReadMode($RM_RESET); print RED(), "Which user (blank for all, /.../ for regex): ", RESET(); $config{filter_user} = StringOrRegex(ReadLine(0)); ReadMode($RM_NOBLKRD); next; } ## d - database name based filter if ($key eq 'd') { ReadMode($RM_RESET); print RED(), "Which database (blank for all, /.../ for regex): ", RESET(); $config{filter_db} = StringOrRegex(ReadLine(0)); ReadMode($RM_NOBLKRD); next; } ## h - hostname based filter if ($key eq 'h') { ReadMode($RM_RESET); print RED(), "Which hostname (blank for all, /.../ for regex): ", RESET(); $config{filter_host} = StringOrRegex(ReadLine(0)); ReadMode($RM_NOBLKRD); next; } ## E - Show full Replication Error if ($key eq 'E') { my ($data) = Hashes('SHOW /*mytop*/ SLAVE STATUS'); Clear(); print "Error is: $data->{Last_Error}\n"; print RED(), "-- paused. press any key to resume --", RESET(); ReadKey(0); next; } ## F - remove all filters if ($key eq 'F') { $config{filter_host} = qr/.?/; $config{filter_db} = qr/.?/; $config{filter_user} = qr/.?/; $config{filter_state} = qr/.?/; print RED(), "-- display unfiltered --", RESET(); sleep 1; next; } ## p - pause if ($key eq 'p') { print RED(), "-- paused. press any key to resume --", RESET(); ReadKey(0); next; } ## i - idle toggle if ($key =~ /i/) { if ($config{idle}) { $config{idle} = 0; $config{sort} = 1; print RED(), "-- idle (sleeping) processed filtered --", RESET(); sleep 1; } else { $config{idle} = 1; $config{sort} = 0; print RED(), "-- idle (sleeping) processed unfiltered --", RESET(); sleep 1; } } ## I - InnoDB status if ($key =~ 'I') { $config{mode} = 'innodb'; Clear() unless $config{batchmode}; print "InnoDB Status\n"; next; } ## o - sort order if ($key =~ /o/) { if ($config{sort}) { $config{sort} = 0; print RED(), "-- sort order reversed --", RESET(); sleep 1; } else { $config{sort} = 1; print RED(), "-- sort order reversed --", RESET(); sleep 1; } } ## ? - help if ($key eq '?') { Clear(); PrintHelp(); ReadKey(0); next; } ## k - kill if ($key eq 'k') { ReadMode($RM_RESET); print RED(), "Thread id to kill: ", RESET(); my $id = ReadLine(0); $id =~ s/\s//g; if ($id =~ /^\d+$/) { Execute("KILL /*mytop*/ $id"); } else { print RED(), "-- invalid thread id --", RESET(); sleep 1; } ReadMode($RM_NOBLKRD); next; } ## K - kill based on a username if ($key =~ /K/) { ReadMode($RM_RESET); print RED(), "User to kill: ", RESET(); my $user = ReadLine(0); $user =~ s/\s//g; if ($user =~ /^\S+$/) { for my $pid (keys %ucache) { next unless $ucache{$pid} eq $user; Execute("KILL /*mytop*/ $pid"); select(undef, undef, undef, 0.2); } } else { print RED(), "-- invalid thread id --", RESET(); sleep 1; } ReadMode($RM_NOBLKRD); } ## f - full info if ($key =~ /f/) { ReadMode($RM_RESET); print RED(), "Full query for which thread id: ", RESET(); my $id = ReadLine(0); chomp $id; FullQueryInfo($id); ReadMode($RM_NOBLKRD); print RED(), "-- paused. press any key to resume or (e) to explain --", RESET(); my $key = ReadKey(0); if ($key eq 'e') { Explain($id); print RED(), "-- paused. press any key to resume --", RESET(); ReadKey(0); } next; } ## e - explain if ($key =~ /e/) { ReadMode($RM_RESET); print RED(), "Explain which query (id): ", RESET(); my $id = ReadLine(0); chomp $id; Explain($id); ReadMode($RM_NOBLKRD); print RED(), "-- paused. press any key to resume --", RESET(); ReadKey(0); next; } ## r - reset status counters if ($key =~ /r/) { Execute("FLUSH /*mytop*/ STATUS"); print RED(), "-- counters reset --", RESET(); sleep 1; next; } ## H - header toggle if ($key eq 'H') { if ($config{header}) { $config{header} = 0; } else { $config{header}++; } } ## # - magic debug key if ($key eq '#') { $debug = 1; } if ($key eq 'V') { GetShowVariables(); print RED(), "-- paused. press any key to resume --", RESET(); ReadKey(0); } ## M - switch to SHOW STATUS mode if ($key eq 'M') { $config{mode} = 'status'; } ## L - full queries toggle if ($key eq 'L') { if ($config{fullqueries}) { $config{fullqueries} = 0; print RED(), "-- full queries OFF --", RESET(); sleep 1; } else { $config{fullqueries} = 1; print RED(), "-- full queries ON --", RESET(); sleep 1; } } ## w - change columns width for the "User" and "Database" columns if ($key eq 'w') { ReadMode($RM_RESET); print RED(), "Width for the 'User' column (the actual value is ". $config{usercol_width}."): "; my $readWidth = ReadLine(0); chomp($readWidth); if (defined($readWidth) && $readWidth ne "") { if ($readWidth > 4 && $readWidth < 60) { $config{usercol_width} = $readWidth; } else { print RED(), "-- Invalid value ($readWidth), the previous value". "has been kept, press a key to resume --"; ReadKey(0); } } print RESET(), RED(), "Width for the 'DB' column (the actual value is ". $config{dbcol_width}."): ", RESET(); $readWidth = ReadLine(0); chomp($readWidth); if (defined($readWidth) && $readWidth ne "") { if ($readWidth > 2 && $readWidth < 60) { $config{dbcol_width} = $readWidth } else { print RED(), "-- Invalid value ($readWidth), the previous value". "has been kept, press a key to resume --", RESET(); ReadKey(0); } } undef $readWidth; ReadMode($RM_NOBLKRD); next; } ## a - progress column toggle (the column is only displayed ## if progress information are available from the processlist) if ($key eq 'a') { if ($config{hide_progress}) { $config{hide_progress} = 0; print RED(), "-- progress display ON --", RESET(); sleep 1; } else { $config{hide_progress} = 1; print RED(), "-- progress display OFF --", RESET(); sleep 1; } } } ReadMode($RM_RESET) unless $config{batchmode}; exit; ####################################################################### sub Clear() { if (not $WIN) { print "$CLEAR" } else { print "\n" x 90; ## dumb hack for now. Anyone know how to ## clear the screen in dos window on a Win32 ## system?? } } my $last_time; sub GetData() { ## Get terminal info my $now_time; %qcache = (); ## recycle memory %dbcache = (); my ($width, $height, $wpx, $hpx, $lines_left); if (not $config{batchmode}) { ($width, $height, $wpx, $hpx) = GetTerminalSize(); $lines_left = $height - 2; } else { $height = 999_999; ## I hope you don't have more than that! $lines_left = 999_999; $width = 80; } ## ## Header stuff. ## if ($config{header}) { my @recs = ""; if ($db_release > 4) { @recs = Hashes("SHOW /*mytop*/ GLOBAL STATUS"); } else { @recs = Hashes("SHOW /*mytop*/ STATUS"); } ## if the server died or we lost connectivity if (not @recs) { ReadMode($RM_RESET); exit 1; } ## get high-res or low-res time my ($t_delta); if ($HAS_TIME) { $now_time = Time::HiRes::gettimeofday(); } else { $now_time = time; } if ($last_time and $last_time != $now_time) { $t_delta = $now_time - $last_time; } %OLD_STATUS = %STATUS; # Set some status that may not exist in all versions $STATUS{Handler_tmp_write} = 0; $STATUS{Handler_tmp_update} = 0; $STATUS{Rows_tmp_read} = 0; foreach my $ref (@recs) { my $key = $ref->{Variable_name}; my $val = $ref->{Value}; $STATUS{$key} = $val; } ## Compute Key Cache Hit Stats $STATUS{Key_read_requests} ||= 1; ## can't divide by zero next my $cache_hits_percent = (100-($STATUS{Key_reads}/$STATUS{Key_read_requests}) * 100); $cache_hits_percent = sprintf("%2.2f",$cache_hits_percent); ## Query Cache info for <= Ver. 4.1 ## ## mysql> show status like 'qcache%'; ## +-------------------------+----------+ ## | Variable_name | Value | ## +-------------------------+----------+ ## | Qcache_queries_in_cache | 81 | ## | Qcache_inserts | 4961668 | ## | Qcache_hits | 1374170 | ## | Qcache_not_cached | 5656249 | ## | Qcache_free_memory | 33164800 | ## | Qcache_free_blocks | 2 | ## | Qcache_total_blocks | 168 | ## +-------------------------+----------+ ## ## Query Cache info for => Ver. 5.0 ## ## mysql> show status like 'qcache%'; ## +-------------------------+------------+ ## | Variable_name | Value | ## +-------------------------+------------+ ## | Qcache_free_blocks | 37652 | ## | Qcache_free_memory | 110289712 | ## | Qcache_hits | 1460617356 | ## | Qcache_inserts | 390563495 | ## | Qcache_lowmem_prunes | 6414172 | ## | Qcache_not_cached | 93002420 | ## | Qcache_queries_in_cache | 66558 | ## | Qcache_total_blocks | 192031 | ## +-------------------------+------------+ my $query_cache_hits = 0; my $query_cache_hits_per_sec = 0; my $now_query_cache_hits_per_sec = 0; if ($have_query_cache) { $query_cache_hits = $STATUS{Qcache_hits}; $query_cache_hits_per_sec = $STATUS{Qcache_hits} / $STATUS{Uptime}; if (defined $last_time and $last_time != $now_time) { my $q_delta = $STATUS{Qcache_hits} - $OLD_STATUS{Qcache_hits}; $now_query_cache_hits_per_sec = sprintf "%.2f", $q_delta / $t_delta; } } my $l; if (-e "/proc/loadavg") { ## To avoid warnings if the OS is not Linux open (my $fh, "<", "/proc/loadavg"); ## Only the first 3 values are interresting $l = join(" ", (split /\s+/, <$fh>)[0..2]); close $fh; } $last_time = $now_time; ## Server Uptime in meaningful terms... my $time = $STATUS{Uptime}; my ($d,$h,$m,$s) = (0, 0, 0, 0); $d += int($time / (60*60*24)); $time -= $d * (60*60*24); $h += int($time / (60*60)); $time -= $h * (60*60); $m += int($time / (60)); $time -= $m * (60); $s += int($time); my $uptime = sprintf("%d+%02d:%02d:%02d", $d, $h, $m, $s); ## Queries per second... my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Questions} / $STATUS{Uptime}); my $num_queries = $STATUS{Questions}; my @t = localtime(time); my $current_time = sprintf "[%02d:%02d:%02d]", $t[2], $t[1], $t[0]; my $host_width = length("$server $db_version on $config{host}"); my $up_width = $width - $host_width - 1; Clear() unless $config{batchmode}; print RESET(); printf "%-.${host_width}s %${up_width}s\n", "$server $db_version on $config{host}", defined($l) ? "load ($l) up $uptime $current_time" : "up $uptime $current_time"; $lines_left--; printf " Queries: %-7s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f\n", make_short( $STATUS{Questions} ), # q total $STATUS{Questions} / $STATUS{Uptime}, # qps, average make_short( $STATUS{Slow_queries} ), # slow # hmm. a Qcache hit is really a select and should be counted. 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $STATUS{Questions}, 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $STATUS{Questions}, 100 * ($STATUS{Com_update} ) / $STATUS{Questions}, 100 * $STATUS{Com_delete} / $STATUS{Questions}; $lines_left--; if ($t_delta) { my $q_diff = ( $STATUS{Questions} - $OLD_STATUS{Questions} ); # print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $t_delta = $q_diff\n"); printf(" Sorts: %6.0f qps now: %4.0f Slow qps: %3.1f Threads: %4.0f (%4.0f/%4.0f) %02.0f/%02.0f/%02.0f/%02.0f\n", ( $STATUS{Sort_rows} - $OLD_STATUS{Sort_rows} ) / $t_delta, ( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta, ( # slow now (qps) ($STATUS{Slow_queries} ) ? ( $STATUS{Slow_queries} - $OLD_STATUS{Slow_queries} ) / $t_delta : 0 ), $STATUS{Threads_connected}, $STATUS{Threads_running}, $STATUS{Threads_cached}, (100 * ($STATUS{Com_select} - $OLD_STATUS{Com_select} + ($STATUS{Qcache_hits}||0) - ($OLD_STATUS{Qcache_hits}||0) ) ) / ($q_diff ), (100 * ($STATUS{Com_insert} - $OLD_STATUS{Com_insert} + $STATUS{Com_replace} - $OLD_STATUS{Com_replace} ) ) / ($q_diff ), (100 * ($STATUS{Com_update} - $OLD_STATUS{Com_update}) ) / ($q_diff ), (100 * ($STATUS{Com_delete} - $OLD_STATUS{Com_delete}) ) / ($q_diff ), ); } else { print "\n"; } $lines_left--; if ($have_query_cache and $STATUS{Com_select} and $query_cache_hits) { printf(" Cache Hits: %-5s Hits/s: %4.1f Hits now: %5.1f Ratio: ", make_short($STATUS{Qcache_hits}), # cache hits $STATUS{Qcache_hits} / $STATUS{Uptime}, # hits / sec ($t_delta) ? ($STATUS{Qcache_hits} - $OLD_STATUS{Qcache_hits}) / $t_delta : 0, # Hits Now ); my ($Ratio) = 100 * ($STATUS{Qcache_hits}) / ($STATUS{Qcache_hits} + $STATUS{Com_select} ); if ($HAS_COLOR) { print YELLOW() if ($Ratio < 80.0); print RED() if ($Ratio < 50.0); print MAGENTA() if ($Ratio < 20.0); } printf("%4.1f%% ",$Ratio); if ($HAS_COLOR) { print RESET(); } print " Ratio now: "; my ($Ratio_now) = ($t_delta) ? # ratio now 100 * ($STATUS{Qcache_hits} - $OLD_STATUS{Qcache_hits} ) / ( ($STATUS{Com_select} + $STATUS{Qcache_hits} - ($OLD_STATUS{Qcache_hits} + $OLD_STATUS{Com_select}) ) || 1) : 0; if ($HAS_COLOR) { print GREEN() if ($Ratio_now >= 80.0); print YELLOW() if ($Ratio_now < 80.0); print RED() if ($Ratio_now < 50.0); print MAGENTA() if ($Ratio_now < 20.0); } printf("%4.1f%% \n",$Ratio_now); if ($HAS_COLOR) { print RESET(); } $lines_left--; } if ($t_delta) { my $rows_read; if (defined($STATUS{Rows_read})) { $rows_read= $STATUS{Rows_read} - $OLD_STATUS{Rows_read}; } else { $rows_read= ($STATUS{Handler_read_first} + $STATUS{Handler_read_key} + $STATUS{Handler_read_next} + $STATUS{Handler_read_prev} + $STATUS{Handler_read_rnd} + $STATUS{Handler_read_rnd_next} - $OLD_STATUS{Handler_read_first} - $OLD_STATUS{Handler_read_key} - $OLD_STATUS{Handler_read_next} - $OLD_STATUS{Handler_read_prev} - $OLD_STATUS{Handler_read_rnd} - $OLD_STATUS{Handler_read_rnd_next}); } printf(" Handler: (R/W/U/D) %5d/%5d/%5d/%5d Tmp: R/W/U: %5d/%5d/%5d\n", $rows_read/$t_delta, ($STATUS{Handler_write} - $OLD_STATUS{Handler_write}) / $t_delta, ($STATUS{Handler_update} - $OLD_STATUS{Handler_update}) / $t_delta, ($STATUS{Handler_delete} - $OLD_STATUS{Handler_delete}) / $t_delta, ($STATUS{Rows_tmp_read} - $OLD_STATUS{Rows_tmp_read}) / $t_delta, ($STATUS{Handler_tmp_write} -$OLD_STATUS{Handler_tmp_write})/$t_delta, ($STATUS{Handler_tmp_update} - $OLD_STATUS{Handler_tmp_update})/$t_delta); } else { print "\n"; } $lines_left--; printf(" MyISAM Key Cache Efficiency: %2.1f%% Bps in/out: %5s/%5s ", $cache_hits_percent, make_short($STATUS{Bytes_received} / $STATUS{Uptime} ), make_short($STATUS{Bytes_sent} / $STATUS{Uptime})); printf("Now in/out: %5s/%5s", make_short(($STATUS{Bytes_received} - $OLD_STATUS{Bytes_received}) / $t_delta ), make_short(($STATUS{Bytes_sent} - $OLD_STATUS{Bytes_sent}) / $t_delta )) if ($t_delta); print "\n"; $lines_left--; my ($data) = Hashes('SHOW /*mytop*/ GLOBAL VARIABLES LIKE "read_only"'); if ($data->{Value} ne "OFF") { print RED() if ($HAS_COLOR) ; print " ReadOnly"; RESET() if ($HAS_COLOR); } ($data) = Hashes('SHOW /*mytop*/ SLAVE STATUS'); if (defined($data->{Master_Host})) { if (defined($data->{Seconds_Behind_Master})) { if ($HAS_COLOR) { print GREEN(); print YELLOW() if ($data->{Seconds_Behind_Master} > 60); print MAGENTA() if ($data->{Seconds_Behind_Master} > 360); } } print " Replication "; print "IO:$data->{Slave_IO_Running} "; print "SQL:$data->{Slave_SQL_Running} "; print RESET() if ($HAS_COLOR); if (defined($data->{Seconds_Behind_Master})) { if ($HAS_COLOR) { print GREEN(); print YELLOW() if ($data->{Seconds_Behind_Master} > 60); print MAGENTA() if ($data->{Seconds_Behind_Master} > 360); } print "Delay: $data->{Seconds_Behind_Master} sec."; } else { my $free = $width - 45; my $Err = substr $data->{Last_Error},0 ,$free; printf(" ERR: %-${free}s", $Err) if ($Err ne ""); } print WHITE() if ($HAS_COLOR); print "\n"; $lines_left--; } print "\n"; } if (not $config{batchmode} and not $config{header}) { Clear(); print RESET(); } ## ## Threads ## my $proc_cmd; ## Query used to fetch the processlist my $time_format = "6d"; if ($has_is_processlist == 1) { if ($has_time_ms == 1) { $time_format = "6.6s"; if ($has_progress == 1) { ## To have a computed value of "Progress" like the ## "SHOW PROCESSLIST" one, the Progress column of the query ## must be replaced by : ## "CASE WHEN Max_Stage < 2 THEN Progress ELSE ## (Stage-1)/Max_Stage*100+Progress/Max_Stage END AS Progress" $proc_cmd = "SELECT /*mytop*/ Id, User, Host, db, Command, CASE WHEN TIME > 10000 THEN Time ELSE ROUND(TIME_MS/1000, 1) END AS Time, State, Info, Progress, Stage, Max_Stage FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID != CONNECTION_ID();"; } else { $proc_cmd = "SELECT /*mytop*/ Id, User, Host, db, Command, CASE WHEN TIME > 10000 THEN Time ELSE ROUND(TIME_MS/1000, 1) END AS Time, State, Info FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID != CONNECTION_ID();"; } } else { $proc_cmd = "SELECT /*mytop*/ Id, User, Host, db, Command, Time, State, Info FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID != CONNECTION_ID();"; } } else { $proc_cmd = "SHOW /*mytop*/ FULL PROCESSLIST;"; } ## Minimal width values for columns with a dynamic width if ($config{usercol_width} < 4) { $config{usercol_width} = 4; } if ($config{dbcol_width} < 2) { $config{dbcol_width} = 2; } my @sz = (9, $config{usercol_width}, 15, $config{dbcol_width}, 6, 6, 8); if ($has_progress == 1 && !$config{hide_progress}) { push @sz, 5; }; my $used = scalar(@sz) + Sum(@sz); undef(@sz); ## If the terminal width <= 80, the state column will have a width of 6 ## chars else it will be between 6 and 15 depending on the terminal width my $state = $width <= 80 ? 6 : int(min(6+($width-80)/3, 15)); ## $free = The number of chars between the beginning of the "Query" ## column and the end of the line my $free = $width - $used - ($state - 6); my $format= "%9s %$config{usercol_width}s %15s %$config{dbcol_width}s %6s "; if ($has_progress == 1 && !$config{hide_progress}) { $format .= "%5s "; } $format .= "%6s %${state}s %-.${free}s\n"; my $format2 = "%9d %$config{usercol_width}.$config{usercol_width}s %15.15s %$config{dbcol_width}.$config{dbcol_width}s %${time_format} "; if ($has_progress == 1 && !$config{hide_progress}) { $format2 .= "%5.1f "; } $format2 .= "%6.6s %${state}.${state}s "; if ($config{fullqueries}) { $format2 .= "%-${free}s\n"; } else { $format2 .= "%-${free}.${free}s\n"; } print BOLD() if ($HAS_COLOR); if ($has_progress == 1 && !$config{hide_progress}) { printf $format, 'Id','User','Host/IP','DB','Time', '%', 'Cmd', 'State', 'Query'; } else { printf $format, 'Id','User','Host/IP','DB','Time', 'Cmd', 'State', 'Query'; } print RESET() if ($HAS_COLOR); ## Id User Host DB if ($has_progress == 1 && !$config{hide_progress}) { printf $format, '--','----','-------','--','----', '-', '---', '-----', '----------'; } else { printf $format, '--','----','-------','--','----', '---', '-----', '----------'; } $lines_left -= 2; my @data = Hashes($proc_cmd); foreach my $thread (@data) { last if not $lines_left; ## Drop Domain Name, unless it looks like an IP address. If ## it's an IP, we'll strip the port number because it's rarely ## interesting. my $is_ip = 0; if ($thread->{Host} =~ /^(\d{1,3}\.){3}(\d{1,3})(:\d+)?$/) { $thread->{Host} =~ s/:.*$//; $is_ip = 1; } else { $thread->{Host} =~ s/^([^.]+).*/$1/; } ## Otherwise, look up the IP (if resolve is set) and strip the ## name if ($is_ip and $config{resolve}) { $thread->{Host} =~ s/:\d+$//; my $host = gethostbyaddr(inet_aton($thread->{Host}), AF_INET); if ($host) { ## Only the hostname part of the DNS is kept $host =~ s/^([^.]+).*/$1/; } $thread->{Host} = $host; } ## Fix possible undefs $thread->{db} ||= ''; $thread->{Info} ||= ''; $thread->{Time} ||= 0 ; $thread->{Id} ||= 0 ; $thread->{User} ||= ''; $thread->{Command} ||= ''; $thread->{Host} ||= ''; $thread->{State} ||= ""; $thread->{Progress} ||= 0; ## Alter double hyphen comments so they don't break ## the query when newlines are removed - http://freshmeat.net/users/jerjones $thread->{Info} =~ s~\s--(.*)$~ /* $1 */ ~mg; ## Normalize spaces -- mostly disabled for now. This can ## break EXPLAIN if you try to explain a mangled query. It ## may be re-enabled later as an option. ## Replace newlines and carriage returns with a space $thread->{Info} =~ tr/\n\r/ /; ## Leading space removal $thread->{Info} =~ s/^\s*//; ## Strip non printing control symbols $thread->{Info} =~ tr/[[:cntrl:]]//; ## Collpase whitespace $thread->{Info} =~ s/\s+/ /g; ## Trailing space removal $thread->{Info} =~ s/\s$//; ## Put the first letter of the query uppercase for a better readability ## with long State strings $thread->{Info} = ucfirst $thread->{Info}; ## Stow it in the cache $qcache{$thread->{Id}} = $thread->{Info}; $dbcache{$thread->{Id}} = $thread->{db}; $ucache{$thread->{Id}} = $thread->{User}; ## If Progress information is available and a multi-stage query is ## running, the actual stage and the total number of stages of the ## thread are shown at the beginning of the State column if ($has_progress == 1 && $thread->{Max_Stage} && $thread->{Max_Stage} > 1) { $thread->{State} = $thread->{Stage}."/". $thread->{Max_Stage}." ".$thread->{State}; } } ## Sort by idle time (closest thing to CPU usage I can think of). my @sorted; if (not $config{sort}) { @sorted = sort { $a->{Time} <=> $b->{Time} } @data } else { @sorted = sort { $b->{Time} <=> $a->{Time} } @data } foreach my $thread (@sorted) { ## Check to see if we can skip out. ## We skip out if we know the given line doesn't match. next if (($thread->{Command} eq "Sleep") and (not $config{idle})); next if (($thread->{Command} eq "Binlog Dump") and (not $config{idle})); next if (($thread->{Command} eq "Daemon") and (not $config{idle})); next if ($thread->{User} !~ $config{filter_user}); next if ($thread->{db} !~ $config{filter_db}); next if ($thread->{Host} !~ $config{filter_host}); next if ($thread->{State} !~ $config{filter_state}); ## Otherwise, print. my $smInfo; if ($thread->{Info}) { if ($config{fullqueries}) { $smInfo = $thread->{Info}; if (length($smInfo) > $free) { $lines_left -= int((length($smInfo) - $free)/$width) + 1; } } else { $smInfo = substr $thread->{Info}, 0, $free; } } # if ($thread->{State}) # { # $smInfo = substr $thread->{State}, 0, $free; # } else { $smInfo = ""; } $lines_left--; if ($lines_left < 0) { print WHITE(), "-- Truncated query list -- "; last; } if ($HAS_COLOR) { print YELLOW() if $thread->{Command} eq 'Query'; print WHITE() if $thread->{Command} eq 'Sleep'; print GREEN() if $thread->{Command} eq 'Connect'; print BOLD() if $thread->{Time} > $config{slow}; print MAGENTA() if $thread->{Time} > $config{long}; } if ($has_progress == 1 && !$config{hide_progress}) { printf $format2, $thread->{Id}, $thread->{User}, $thread->{Host}, $thread->{db}, $thread->{Time}, $thread->{Progress}, $thread->{Command}, $thread->{State}, $smInfo; } else { printf $format2, $thread->{Id}, $thread->{User}, $thread->{Host}, $thread->{db}, $thread->{Time}, $thread->{Command}, $thread->{State}, $smInfo; } print RESET() if $HAS_COLOR; } } ########################################################################### my $questions; sub GetQPS() { my ($data) = Hashes('SHOW /*mytop*/ STATUS LIKE "Questions"'); my $num = $data->{Value}; if (not defined $questions) ## first time? { $questions = $num; return; } my $qps = $num - $questions; $questions = $num; print "$qps\n"; } ########################################################################### sub GetInnoDBStatus() { if (not $config{pager}) { if (not $config{pager} = my_which('less')) { $config{pager} = my_which('more'); } } my @data = Hashes("SHOW /*mytop*/ ENGINE INNODB STATUS"); open P, "|$config{pager}" or die "$!"; print keys %{$data[0]}; print $data[0]->{Status},"\n"; close P; } ########################################################################### my %prev_data; sub GetCmdSummary() { my ($width, $height, $wpx, $hpx, $lines_left); if (not $config{batchmode}) { ($width, $height, $wpx, $hpx) = GetTerminalSize(); $lines_left = $height - 2; } else { $height = 999_999; ## I hope you don't have more than that! $lines_left = 999_999; $width = 80; } ## Variable_name and Value pairs come back... my @data = Hashes("SHOW /*mytop*/ STATUS LIKE 'Com\\_%'"); my %cmd_data; my %cmd_delta; my %cmd_pct; my %cmd_delta_pct; my $total; my $delta_total; for my $item (@data) { next unless $item->{Value}; $item->{Variable_name} =~ s/^Com_//; $item->{Variable_name} =~ s/_/ /g; $cmd_data{$item->{Variable_name}} = $item->{Value}; $total += $item->{Value}; } ## Populate other stats for my $item (keys %cmd_data) { $cmd_delta{$item} = $cmd_data{$item} - ($prev_data{$item} || $cmd_data{$item} - 1); $delta_total += $cmd_delta{$item}; $cmd_pct{$item} = int(($cmd_data{$item} / $total) * 100); } for my $item (keys %cmd_data) { $cmd_delta_pct{$item} = int(($cmd_delta{$item} / $delta_total) * 100); } ## Display Clear() unless $config{batchmode}; print RESET(); printf "%18s %10s %4s | %5s %4s\n", 'Command', 'Total', 'Pct', 'Last', 'Pct'; printf "%18s %10s %4s | %5s %4s\n", '-------', '-----', '---', '----', '---'; $lines_left -= 2; for my $item (sort { $cmd_data{$b} <=> $cmd_data{$a} } keys %cmd_data) { printf "%18s %10d %4s | %5d %4s\n", $item, $cmd_data{$item}, $cmd_pct{$item} . "%", $cmd_delta{$item}, $cmd_delta_pct{$item} . "%"; last if not $lines_left; $lines_left -= 1; } %prev_data = %cmd_data; } ########################################################################### sub GetShowVariables() { if (not $config{pager}) { if (not $config{pager} = my_which('less')) { $config{pager} = my_which('more'); } } my @rows = Hashes("SHOW /*mytop*/ VARIABLES"); open P, "|$config{pager}" or die "$!"; for my $row (@rows) { my $name = $row->{Variable_name}; my $value = $row->{Value}; printf P "%32s: %s\n", $name, $value; } close P; } ########################################################################### sub GetShowStatus() { Clear() unless $config{batchmode}; my @rows = Hashes("SHOW /*mytop*/ STATUS"); printf "%32s %10s %10s Toggle idle with 'i'\n", 'Counter', 'Total', 'Change'; printf "%32s %10s %10s\n", '-------', '-----', '------'; for my $row (@rows) { my $name = $row->{Variable_name}; my $value = $row->{Value}; my $old = $statcache{$name}; my $delta = 0; next if $name =~ m/^Com_/; ## skip Com_ stats next if $value =~ m/^[^0-9]*$/; ## skip non-numeric ## TODO: if Qcache is off, we should skip Qcache_ values if ($HAS_COLOR and defined $old and $old =~ /^\d/) { if ($value > $old) { print YELLOW(); $delta = $value - $old; } elsif ($value < $old) { print RED(); $delta = $value - $old; } if (not $config{idle} and $value == $old) { ## filter unchanging stats, maybe print RESET(); next; } } printf "%32s: %10s %10s\n", $name, $value, $delta; print RESET() if $HAS_COLOR; $statcache{$name} = $value; } } ########################################################################### sub FullQueryInfo($) { my $id = shift; if (not exists $qcache{$id} or not defined $qcache{$id}) { print "*** Invalid id. ***\n"; return; } my $sql = $qcache{$id}; print $CLEAR; print "Thread $id was executing following query:\n\n"; print YELLOW(), $sql,"\n\n", RESET(); } ########################################################################### sub Explain($) { my $id = shift; if (not exists $qcache{$id} or not defined $qcache{$id}) { print "*** Invalid id. ***\n"; return; } my $sql = $qcache{$id}; my $db = $dbcache{$id}; Execute("USE /*mytop*/ $db"); my @info = Hashes("EXPLAIN $sql"); print $CLEAR; print "EXPLAIN $sql:\n\n"; PrintTable(@info); } ########################################################################### sub PrintTable(@) { my $cnt = 1; my @cols = qw(table type possible_keys key key_len ref rows Extra); for my $row (@_) { print "*** row $cnt ***\n"; for my $key (@cols) { my $val = $row->{$key} || 'NULL'; printf "%15s: %s\n", $key, $val; } $cnt++; } } ########################################################################### sub StringOrRegex($) { my $input = shift; chomp $input; if (defined $input) { ## regex, strip /.../ and use via qr// if ($input =~ m{^/} and $input =~ m{/$}) { $input =~ s{^/}{} if $config{filter_user}; $input =~ s{/$}{} if $config{filter_user}; $input = qr/$input/; } ## reset to match anything elsif ($input eq '') { $input = qr/.*/; } ## string, build a simple regex else { $input = '^' . $input . '$'; $input = qr/$input/; } } ## reset to match anything else { $input = qr/.*/; } return $input; } ########################################################################### sub cmd_l { ReadMode($RM_RESET); print RED(), "Seconds for long queries: ", RESET(); my $secs = ReadLine(0); if ($secs =~ /^\s*(\d+)/) { $config{long} = $1; if ($config{long} < 1) { $config{long} = 1; } } ReadMode($RM_NOBLKRD); } sub cmd_s { ReadMode($RM_RESET); print RED(), "Seconds of Delay: ", RESET(); my $secs = ReadLine(0); if ($secs =~ /^\s*(\d+)/) { $config{delay} = $1; if ($config{delay} < 1) { $config{delay} = 1; } } ReadMode($RM_NOBLKRD); } sub cmd_S { ReadMode($RM_RESET); print RED(), "Seconds for Slow queries: ", RESET(); my $secs = ReadLine(0); if ($secs =~ /^\s*(\d+)/) { $config{slow} = $1; if ($config{slow} < 1) { $config{slow} = 1; } } ReadMode($RM_NOBLKRD); } sub cmd_q { ReadMode($RM_RESET); print "\n"; exit; } sub trim($) { my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } ########################################################################### sub PrintHelp() { my $help = qq[Help for mytop version $main::VERSION by Jeremy D. Zawodny <${YELLOW}Jeremy\@Zawodny.com${RESET}> with updates by Mark Grennan <${YELLOW}mark\@grennan.com${RESET}> and Jean Weisbuch <${YELLOW}jean\@phpnet.org${RESET}> ? - display this screen # - debug mode (toggle) c - command summary view (based on Com_* counters) C - turn color on and off d - show only a specific database e - explain the query that a thread is running E - display current replication error f - show full query info for a given thread F - unfilter the display h - show only a specifc host's connections H - toggle the mytop header i - toggle the display of idle (sleeping) threads I - show innodb status k - kill a thread p - pause the display l - change long running queries hightlighing m - switch [mode] to qps (queries/sec) scrolling view M - switch [mode] to status o - reverse the sort order (toggle) q - quit r - reset the status counters (via FLUSH STATUS on your server) R - change reverse IP lookup s - change the delay between screen updates S - change slow query hightlighting t - switch to thread view (default) u - show only a specific user V - show variables : - enter a command (not yet implemented) ! - Skip an error that has stopped replications (at your own risk) L - show full queries (do not strip to terminal width) w - adjust the User and DB columns width a - toggle the progress column Base version from ${GREEN}http://www.mysqlfanboy.com/mytop-3${RESET} This version comes as part of the ${GREEN}MariaDB${RESET} distribution. ]; print $help; } sub Sum(@) { my $sum; while (my $val = shift @_) { $sum += $val; } return $sum; } ## A useful routine from perlfaq sub commify($) { local $_ = shift; return 0 unless defined $_; 1 while s/^([-+]?\d+)(\d{3})/$1,$2/; return $_; } ## Compact numeric representation (10,000 -> 10.0k) sub make_short($) { my $number = shift; return commify($number) if $config{long_nums}; my $n = 0; while ($number > 1_025) { $number /= 1024; $n++; }; return sprintf "%.1f%s", $number, ('','k','M','G', 'T')[$n]; } ## Run a query and return the records has an array of hashes. sub Hashes($) { my $sql = shift; my @records; if (my $sth = Execute($sql)) { while (my $ref = $sth->fetchrow_hashref) { print "record\n" if $debug; push @records, $ref; } } return @records; } ## Execute an SQL query and return the statement handle. sub Execute($) { my $sql = shift; $sql =~ s/\n/ /sg; my $sth = $dbh->prepare($sql); if (not $sth) { ReadMode($RM_RESET); die $DBI::errstr; } my $ReturnCode = $sth->execute; if (not $ReturnCode) { if ($debug) { print "query failed\n"; sleep 10; } return undef; } return $sth; } #### #### my_which is used, because we can't assume that every system has the #### which command. my_which can take only one argument at a time. #### Return values: requested system command with the first found path, #### or undefined, if not found. #### sub my_which { my ($command) = @_; my (@paths, $path); return $command if (-f $command && -x $command); ## Check first if this is a source distribution, then if this binary distribution and last in the path push @paths, "./extra"; push @paths, $path_for_script; push @paths, split(':', $ENV{'PATH'}); foreach $path (@paths) { $path .= "/$command"; return $path if (-f $path && -x $path); } return undef(); } =pod =head1 SYNOPSIS B [options] =head1 AVAILABILITY Base version from B. This version comes as part of the B distribution. See B. And older (the original) version B is available from http://www.mysqlfanboy.com/mytop-3/ it B also be on CPAN as well. =head1 REQUIREMENTS In order for B to function properly, you must have the following: * Perl 5.005 or newer * Getopt::Long * DBI and DBD::MariaDB or DBD::mysql * Term::ReadKey from CPAN Most systems are likely to have all of those installed--except for Term::ReadKey. You will need to pick that up from the CPAN. You can pick up Term::ReadKey here: http://search.cpan.org/search?dist=TermReadKey And you obviously need access to a MariaDB server with the necessary security to run the I and I commands. If you are a Windows user, using ActiveState's Perl, you can use PPM (the Perl Package Manager) to install the MariaDB/MySQL and Term::ReadKey modules. =head2 Optional Color Support In additon, if you want a color B (recommended), install Term::ANSIColor from the CPAN: http://search.cpan.org/search?dist=ANSIColor Once you do, B will automatically use it. However, color is not yet working on Windows. Patches welcome. :-) =head2 Optional Hi-Res Timing If you want B to provide more accurate real-time queries-per-second statistics, install the Time::HiRes module from CPAN. B will automatically notice that you have it and use it rather than the standard timing mechanism. =head2 Platforms B is known to work on: * Linux (2.2.x, 2.4.x) * FreeBSD (2.2, 3.x, 4.x) * Mac OS X * BSDI 4.x * Solaris 2.x * Windows NT 4.x (ActivePerl) If you find that it works on another platform, please let me know. Given that it is all Perl code, I expect it to be rather portable to Unix and Unix-like systems. Heck, it I even work on Win32 systems. =head1 DESCRIPTION Help is always welcome in improving this software. Feel free to contact the author (see L<"AUTHOR"> below) with bug reports, fixes, suggestions, and comments. Additionally L<"BUGS"> will provide a list of things this software is not able to do yet. Having said that, here are the details on how it works and what you can do with it. =head2 The Basics B was inspired by the system monitoring tool B. I routinely use B on Linux, FreeBSD, and Solaris. You are likely to notice features from each of them here. B will connect to a MariaDB server and periodically run the I and I commands and attempt to summarize the information from them in a useful format. =head2 The Display The B display screen is really broken into two parts. The top 4 lines (header) contain summary information about your MariaDB server. For example, you might see something like: MariaDB 10.5.0 on localhost load (3.89 3.86 3.91) up 7+23:56:31 [16:33:01] Queries: 353.4M qps: 531 Slow: 4.5k Se/In/Up/De(%): 87/02/02/00 Sorts: 2390 qps now: 651 Slow qps: 0.0 Threads: 11 ( 1/ 13) 88/01/03/00 Handler: (R/W/U/D) 82138/ 5884/ 20/ 1 Tmp: R/W/U: 13623/29501/ 79 MyISAM Key Cache Efficiency: 99.9% Bps in/out: 157.4k/ 2.2M Now in/out: 554.8k/ 2.6M The first line identifies the hostname of the server (localhost) and the version of MariaDB it is running. The right hand side shows the uptime of the MariaDB server process in days+hours:minutes:seconds format (much like FreeBSD's top) as well as the current time. The second line displays the total number of queries the server has processed, the average number of queries per second, the number of slow queries, and the percentage of Select, Insert, Update, and Delete queries. The third real-time values. First is the number of queries per second, then the number of slow queries, followed by query precentages (like on the previous line). And the fourth line displays key buffer efficiency (how often keys are read from the buffer rather than disk) and the number of bytes that MariaDB has sent and received, both over all and in the last cycle. You can toggle the header by hitting B when running B. The second part of the display lists as many threads as can fit on screen. By default they are sorted according to their idle time (least idle first). The display looks like: Id User Host Dbase Time Cmd Query or State -- ---- ---- ----- ---- --- -------------- 61 jzawodn localhost music 0 Query show processlist As you can see, the thread id, username, host from which the user is connecting, database to which the user is connected, number of seconds of idle time, the command the thread is executing, and the query info are all displayed. Often times the query info is what you are really interested in, so it is good to run B in an xterm that is wider than the normal 80 columns if possible. The thread display color-codes the threads if you have installed color support. The current color scheme only works well in a window with a dark (like black) background. The colors are selected according to the C column of the display: Query - Yellow Sleep - White Connect - Green Slow - Bright Long - Magenta Those are purely arbitrary and will be customizable in a future release. If they annoy you just start B with the B<--nocolor> flag or adjust your config file appropriately. =head2 Arguments B handles long and short command-line arguments. Not all options have both long and short formats, however. The long arguments have two dashes `--'. Short arguments only have one '-'. =over =item B<-u> or B<--user> username Username to use when logging in to the MariaDB server. Default: ``B''. =item B<-p> or B<--pass> or B<--password> I Password to use when logging in to the MariaDB server. Default: none. WARNING: This is insecure as the password is visible for anyone. See B<--prompt> instead! =item B<-h> or B<--host> I[B<:>I] Hostname of the MariaDB server. The hostname may be followed by an option port number. Note that the port is specified separate from the host when using a config file. Default: ``B''. =item B<--port> or B<-P> I If you're running MariaDB on a non-standard port, use this to specify the port number. Default: B<3306>. =item B<-s> or B<--delay> I How long between display refreshes. Default: B<5> =item B<-d> or B<--db> or B<--database> I Use if you'd like B to connect to a specific database by default. Default: none. =item B<-b> or B<--batch> or B<--batchmode> In batch mode, mytop runs only once, does not clear the screen, and places no limit on the number of lines it will print. This is suitable for running periodically (perhaps from B) to capture the information into a file for later viewing. You might use batch mode in a CGI script to occasionally display your MariaDB server status on the web. Default: unset. =item B<-S> or B<--socket> I If you're running B on the same host as MariaDB/MySQL, you may wish to have it use the MariaDB/MySQL socket directly rather than a standard TCP/IP connection. If you do,just specify one. Note that specifying a socket will make B ignore any host and/or port that you might have specified. If the socket does not exist (or the file specified is not a socket), this option will be ignored and B will use the hostname and port number instead. Default: none. =item B<--header> or B<--noheader> Specify if you want the header to display or not. You can toggle this with the B key while B is running. Default: header. =item B<--color> or B<--nocolor> Specify if you want a color display. This has no effect if you don't have color support available. Default: If you have color support, B will try color unless you tell it not to. =item B<-i> or B<--idle> or B<--noi> or B<--noidle> Specify if you want idle (sleeping) threads to appear in the list. If sleeping threads are omitted, the default sorting order is reversed so that the longest running queries appear at the top of the list. Default: idle. =item B<--prompt> or B<--noprompt> Specify if you want to be prompted to type in your database password. This provides a little bit more security since it not only prevents the password from viewable in a process list, but also doesn't require the password to be stored in plain text in your C<~/.mytop> config file. You will B be prompted if a password has not been specified in your config file or through another command line option. Default: noprompt. =item B<--resolve> If you have skip-resolve set on MariaDB (to keep it from doing a reverse DNS lookup on each inbound connection), mytop can replace IP addresses with hostnames but toggling this option. Default: noresolve =item B<--long> or B<--nolong> For large numbers print all digits (e.g. 10.000) instead of using a more compact approximation (e.g. 10.0k). Default: nolong. =item B<-m> or B<--mode> I Specify initial mode B(queries/second), B(overview), B(command summary), B(InnoDB status) or B(). Default: B =item B<--sort> or B<--nosort> Reverse sort order from ascending to descending using Idle time. Default: nosort. =back Command-line arguments will always take precedence over config file options. That happens because the config file is read I the command-line arguments are applied. =head2 Config File Instead of always using bulky command-line parameters, you can also use a config files for the default value of your options. mytop will first read the [client] and [mytop] sections from your my.cnf files. After that it will read the (C<~/.mytop>) file from your home directory (if present). These are read I any of your command-line arguments are processed, so your command-line arguments will override directives in the config file. Here is a sample config file C<~/.mytop> which implements the defaults described above. user=root pass= host=localhost db=test delay=5 port=3306 slow=10 socket= batchmode=0 header=1 color=1 idle=1 long=120 Using a config file will help to ensure that your database password isn't visible to users on the command-line. Just make sure that the permissions on C<~/.mytop> are such that others cannot read it (unless you want them to, of course). You may have white space on either side of the C<=> in lines of the config file. =head2 Shortcut Keys The following keys perform various actions while B is running. Those which have not been implemented are listed as such. They are included to give the user idea of what is coming. =over =item B Display help. =item B Show "command counters" based on the Com_* values in SHOW STATUS. This is a new feature. Feedback welcome. =item B Turn display color on and off. Default is on. =item B Show only threads connected to a particular database. =item B Given a thread id, display the entire query that thread was (and still may be) running. =item B Disable all filtering (host, user, and db). =item B Only show queries from a particular host. =item B Toggle the header display. You can also specify either C or C in your config file to set the default behavior. =item B Toggle the display of idle (sleeping) threads. If sleeping threads are filtered, the default sorting order is reversed so that the longest running queries appear at the top of the list. =item B Switch to InnoDB Status mode. The output of "SHOW ENGINE INNODB STATUS" will be displayed every cycle. In a future version, this may actually summarize that data rather than producing raw output. =item B Kill a thread. =item B Toggle modes. Currently this switches from `top' mode to `qps' (Queries Per Second Mode). In this mode, mytop will write out one integer per second. The number written reflects the number of queries executed by the server in the previous one second interval. More modes may be added in the future. =item B Reverse the default sort order. =item B

Pause display. =item B Quit B =item B Reset the server's status counters via a I command. =item B Togle IP reverse lookup. Default is on. =item B Change the sleep time (number of seconds between display refreshes). =item B Set the number of seconds a query will need to run before it is considered old and will be highlighted. =item B Show only threads owned by a giver user. =back The B key has a command-line counterpart: B<-s>. The B key has two command-line counterparts: B<--header> and B<--noheader>. =head1 BUGS This is more of a BUGS + WishList. Some performance information is not available when talking to a version 3.22.x MySQL server. Additional information (about threads mostly) was added to the output of I in MySQL 3.23.x and B makes use of it. If the information is not available, you will simply see zeros where the real numbers should be. Simply running this program will increase your overall counters (such as the number of queries run). But you may or may not view that as a bug. B consumes too much CPU time when running (verified on older versions of Linux and FreeBSD). It's likely a problem related to Term::ReadKey. I haven't had time to investigate yet, so B now automatically lowers its priority when you run it. You may also think about running B on another workstation instead of your database server. However, C on Solaris does B have this problem. Newer versions of Linux and FreeBSD seem to have fixed this. You can't specify the maximum number of threads to list. If you have many threads and a tall xterm, B will always try to display as many as it can fit. The size of most of the columns in the display has a small maximum width. If you have fairly long database/user/host names the display may appear odd. I have no good idea as to how best to deal with that yet. Suggestions are welcome. It'd be nice if you could just add B configuration directives in your C file instead of having a separate config file. You should be able to specify the columns you'd like to see in the display and the order in which they appear. If you only have one username that connects to your database, it's probably not worth having the User column appear, for example. =head1 AUTHOR mytop was developed and is maintained by Jeremy D. Zawodny (Jeremy@Zawodny.com). If you wish to e-mail me regarding this software, B subscribe to the B mailing list. See the B homepage for details. =head1 DISCLAIMER While I use this software in my job at Yahoo!, I am solely responsible for it. Yahoo! does not necessarily support this software in any way. It is merely a personal idea which happened to be very useful in my job. =head1 SEE ALSO Please check the MariaDB manual if you're not sure where some of the output of B is coming from. =head1 COPYRIGHT Copyright (C) 2000-2010, Jeremy D. Zawodny. =head1 CREDITS Fix a bug. Add a feature. See your name here! Many thanks go to these fine folks: =over =item Jean Weisbuch (jean@phpnet.org) Added --fullqueries and --sort options, dynamic user and database columns width, reading of .my.cnf, state/progress column that can be disabled dynamically (when available) and various small fixes. =item Michael "Monty" Widenius Fixed a couple of minor bugs that gave warnings on startup. Added support for MariaDB (show MariaDB at top and % done). Cut long server version names to display width. Made 'State' length dynamic. =item Mark Grennan (mark@grennan.com) www.linuxfangoy.com Added updates for MySQL 5.x. Added 'S' (slow) highlighting. Added 'C' to turn on and off Color. Added 'l' command to change color for long running queries. Fixed a few documentation issues. Monitors Slave status. Added color to Queue hit ratio. Added number of rows sorted per second. Created release 1.7. =item Sami Ahlroos (sami@avis-net.de) Suggested the idle/noidle stuff. =item Jan Willamowius (jan@janhh.shnet.org) Minor bug report. Documentation fixes. =item Alex Osipov (alex@acky.net) Long command-line options, Unix socket support. =item Stephane Enten (tuf@grolier.fr) Suggested batch mode. =item Richard Ellerbrock (richarde@eskom.co.za) Bug reports and usability suggestions. =item William R. Mattil (wrm@newton.irngtx.tel.gte.com) Bug report about empty passwords not working. =item Benjamin Pflugmann (philemon@spin.de) Suggested -P command-line flag as well as other changes. =item Justin Mecham Suggested setting $0 to `mytop'. =item Thorsten Kunz Provided a fix for cases when we try remove the domain name from the display even if it is actually an IP address. =item Sasha Pachev Provided the idea of real-time queries per second in the main display. =item Paul DuBois Pointed out some option-handling bugs. =item Mike Wexler Suggested that we don't mangle (normalize) whitespace in query info by default. =item Mark Zweifel Make the --idle command-line argument negatable. =item Axel Schwenke Noticed the incorrect formula for query cache hit percentages in version 1.2. =item Steven Roussey Supplied a patch to help filter binary junk in queries so that terminals don't freak out. =item Jon R. Luini Supplied a patch that formed the basis for C<--prompt> support. Sean Leach submitted a similar patch. =item Yogish Baliga Supplied a patch that formed the basis for C<--resolve> support. =item Per Andreas Buer Supplied an excellent patch to tidy up the top display. This includes showing most values in short form, such as 10k rather than 10000. =back See the Changes file on the B distribution page for more details on what has changed. =head1 LICENSE B is licensed under the GNU General Public License version 2. For the full license information, please visit http://www.gnu.org/copyleft/gpl.html =cut __END__