Created
January 19, 2009 19:39
-
-
Save whatcould/49130 to your computer and use it in GitHub Desktop.
munin plugin to track memory on solaris zone (joyent accelerator)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def output_config | |
puts <<-END | |
graph_category System | |
graph_title accelerator memory | |
graph_vlabel M | |
rss.label rss | |
swap.label swap | |
END | |
exit 0 | |
end | |
def output_values | |
prstat = `prstat -Z 1 1` | |
unless $?.success? | |
$stderr.puts "failed executing prstat" | |
exit 1 | |
end | |
prstat =~ /(ZONEID[^\n]*)\n(.*)/ | |
values = $2.split(' ') | |
puts "rss.value #{values[3].to_i}" | |
puts "swap.value #{values[2].to_i}" | |
end | |
if ARGV[0] == "config" | |
output_config | |
else | |
output_values | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment