mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 18:07:20 +00:00
Initial version
This commit is contained in:
parent
e9c3bcc2aa
commit
b56333712a
1 changed files with 34 additions and 0 deletions
34
plugins/other/rabbitmq_list_queues
Executable file
34
plugins/other/rabbitmq_list_queues
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/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"
|
||||
}
|
||||
}
|
||||
"autoconf" {
|
||||
puts "yes"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach {q m} $queues {
|
||||
set clean [clean_fieldname $q]
|
||||
puts "$clean.value $m"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main $argc $argv
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue