#!/usr/local/bin/perl # # # for all # local monitoring of dbcache # frequency: every 15min # # count memory use from db_stat output # Find out the pagesize a particular system uses by running # db_stat -M m in the database home. $pagesize = 4092; $statout = `/usr/local/bin/db_stat -h /db -m`; $statout =~ /\n(\d+)\s+Current total page count/; $memtotal = $pagesize * $1 / 1024 / 1024; if ($memtotal > 1900) { print "CRITICAL: Berkeley DB memory size larger than 1900MB\n"; exit(2); } print "Berkeley DB OK: Size $memtotal MB\n"; exit(0);