--- /dev/null
+#!/usr/local/bin/perl
+#
+# requires textproc/p5-XML-LibXML
+#
+use warnings;
+
+use XML::LibXML;
+
+my $filename = 'vmstat.xml';
+
+
+my %dict;
+my $offset = 10;
+
+while (1) {
+ print scalar localtime() . "\n";
+ system("/usr/bin/vmstat -z --libxo xml >$filename");
+ $doc = XML::LibXML->load_xml(location => $filename);
+ foreach my $id ( $doc->findnodes('//zone')) {
+ my $name=$id->findvalue('name');
+ my $used=$id->findvalue('used');
+
+ if ($name eq "vm pgcache") {
+ next;
+ }
+
+ if (exists $dict{$name}) {
+ my $v0=$dict{$name} + $offset;
+
+ if ($v0 < int($used)) {
+ print "$name: $v0 => $used \n";
+ $dict{$name}=int(${used});
+ }
+ } else {
+ $dict{$name}=int(${used});
+ }
+ }
+ print "------------------------\n" ;
+
+ sleep(5);
+}
+