3 # requires textproc/p5-XML-LibXML
10 my $filename = 'vmstatm.xml';
15 if (not defined $offset) {
20 print scalar localtime() . "\n";
21 system("/usr/bin/vmstat -m --libxo xml >$filename");
22 my $doc = XML::LibXML->load_xml(location => $filename);
23 foreach my $id ( $doc->findnodes('//memory')) {
24 my $name=$id->findvalue('type');
25 my $used=$id->findvalue('memory-use');
26 if (exists $dict{$name}) {
27 my $v0=$dict{$name} + $offset;
31 @<<<<<<<<<<<<<<<<<<<<<< @######## => @########
32 $name,$dict{$name},$used
42 print "------------------------\n" ;