Plugins » Phusion Passenger Monitor

by Highgroove Studios

Tracks Phusion Passenger’s VM size, process count, and the amount of private memory it has squirreled away. You can also elect to be emailed if any of these statistics crosses a line you indicate. As an added bonus, this plugin also tracks the same statistics for the Apache instance managing Passenger.

The passenger-memory-stats program recommends that you run it would super user privileges to gain more information. This plugin is usable without the extra access rights, but you will need to add them if you want the full details.

It’s important to note though that it is not safe for you to transmit your super user password to us. You will need to address this access issue on your server.

Our recommended procedure to handle this is:

  1. Edit the sudoers file on your server to allow the user that runs the scout client listed in your crontab to be able to run passenger-memory-stats without a password
  2. Login into Scout and edit your plugin settings to add sudo in front of the command name

If you receive the following error:Error: sudo: sorry, you must have a tty to run sudo Comment out the ‘Defaults requiretty’ line in the /etc/sudoers file.

10 Comments Comment

I was having trouble with this plugin until I realized it was an issue with passenger and my OS.

For those on CentOS/RHEL change line 107 in /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.2/bin/passenger-memory-stats from:

apache_processes = list_processes(:exe => PlatformInfo::HTTPD)

to

apache_processes = list_processes(:exe => ‘httpd.worker’)

I found this info here

I had to make a small change to this process on CentOS 4 x64_64 – instead of ‘httpd.workier’, I had to use just ‘httpd’ to get it to work

I’m keen to see the information from passenger-status, i.e:

 ----------- General information ----------- 
 max      = 24
 count    = 20 
 active   = 15
 inactive = 5
 Using global queue: yes
 Waiting on global queue: 0

Specifically the Waiting on global queue. Is this something that this plugin could get or. should I write a new one?

Thanks,
Matt

This plugin isn’t working with the latest passenger-memory-stats due to the ANSI color control characters. Setting the following in passenger-memory-stats is a quick fix….

  RESET   = ""
  BOLD    = ""
  WHITE   = ""
  YELLOW  = ""
  BLUE_BG = ""

I try to keep everything separated so a gem or ruby update doesn’t kill our production servers. This caused me a problem with the Phusion plugin, I got this error every time I tried to update the stats:

Error: /usr/bin/passenger-memory-stats:9:in `require': no such file to load -- rubygems (LoadError) from /usr/bin/passenger-memory-stats:9

The solution was to make Passenger respect which version of Ruby I’m using by changing the shebang at the start of /usr/bin/passenger-memory-stats to read:

#!/usr/bin/env ruby

I’ve updated this to work with the latest version of passenger (2.2.2). Basically, it strips the colorization and adds ngix stats. you can find the updated code here:

http://github.com/dougbarth/scout-plugins/raw/master/passenger_memory_stats/passenger_memory_stats.rb

I couldn’t seem to fork the highgroove repo so i can’t do a pull request for the chage

dave

I’ve merged Dave’s changes into the plugin.

Weird error when running this plugin:

Error: sh: nameThe: command not found

i also have got this error when running this plugin:

Error: sh: nameThe: command not found

i am running ubuntu 8.4 and phusion passenger 2.2.2, any help would be much appreciated

Should be fixed. Sorry for the issues!

Leave a Comment
You must be logged in to your Scout account to leave a comment. Don't have a Scout Account?
Installs: 164
Tested On: linux
Source: View Source
All plugins listed in the directory are open source.
Powered By Rails Machine