munin-plugins-rails
munin-plugins-rails copied to clipboard
Match version 4 or 5 in passenger-status output.
This minor change allows the use of munin-plugins-rails with Passenger version 5. The output of passenger-status in v5 is otherwise compatible with the v4 regex matching.
Before change:
$ munin-run munin_passenger_queue
requests.value
$ munin-run munin_passenger_status
max.value
running.value
active.value
sessions.value 0
After change:
$ munin-run munin_passenger_queue
requests.value 0
$ munin-run munin_passenger_status
max.value 6
running.value 6
active.value 0
sessions.value 0
I used a character class for matching, but I'm wondering if this shouldn't be refactored to a capture group and a case block for better modularity. I may submit a separate pull request with an altered implementation.