2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/rabbitmq/rabbitmq_list_queues

37 lines
770 B
Text
Raw Normal View History

2011-01-17 11:22:20 +01:00
#!/usr/bin/tclsh
proc clean_fieldname arg {
return [regsub -all {[^A-Za-z]} $arg "_"]
}
proc main {argc argv} {
set queues [exec /usr/sbin/rabbitmqctl list_queues -q]
if {$argc > 0} {
switch [lindex $argv 0] {
"config" {
puts "graph_title Number of messages in RabbitMQ queues"
puts "graph_vlabel messages"
puts "graph_category RabbitMQ"
foreach {q m} $queues {
set clean [clean_fieldname $q]
puts "$clean.label $q"
puts "$clean.draw LINE3"
2011-02-01 07:54:10 +01:00
puts "$clean.warning 300000"
puts "$clean.critical 700000"
2011-01-17 11:22:20 +01:00
}
}
"autoconf" {
puts "yes"
}
}
} else {
foreach {q m} $queues {
set clean [clean_fieldname $q]
puts "$clean.value $m"
}
}
}
main $argc $argv