passenger-status command

This module provides processing for the passenger-status command using the following parsers:

class insights.parsers.passenger_status.PassengerStatus(context, extra_bad_lines=None)[source]

Bases: CommandParser, dict

Parse the passenger-status command output.

Produces a simple dictionary of keys and values from the command output contents.

Sample command output:

Version : 4.0.18
Date    : 2018-10-23 15:42:04 +0800
Instance: 1265
----------- General information -----------
Max pool size : 12
Processes     : 2
Requests in top-level queue : 0

----------- Application groups -----------
/usr/share/foreman#default:
App root: /usr/share/foreman
Requests in queue: 192
* PID: 30131   Sessions: 1       Processed: 991     Uptime: 2h 9m 8s
CPU: 3%      Memory  : 562M    Last used: 1h 53m 51s
* PID: 32450   Sessions: 1       Processed: 966     Uptime: 2h 8m 15s
CPU: 4%      Memory  : 463M    Last used: 1h 48m 17
* PID: 4693    Sessions: 1       Processed: 939     Uptime: 2h 6m 32s
CPU: 3%      Memory  : 470M    Last used: 1h 50m 48

/etc/puppet/rack#default:
App root: /etc/puppet/rack
Requests in queue: 0
* PID: 21934   Sessions: 1       Processed: 380     Uptime: 1h 33m 34s
CPU: 1%      Memory  : 528M    Last used: 1h 29m 4
* PID: 26194   Sessions: 1       Processed: 544     Uptime: 1h 31m 34s
CPU: 2%      Memory  : 490M    Last used: 1h 23m 5
* PID: 32384   Sessions: 1       Processed: 36      Uptime: 1h 0m 29s
CPU: 0%      Memory  : 561M    Last used: 1h 0m 3s

Examples

>>> passenger_status["Version"]
'4.0.18'
>>> 'rack_default' in passenger_status
True
>>> len(passenger_status['foreman_default']['p_list'])
3
Raises:

SkipComponent -- When input content is empty or there is no useful data.

property data

A simple dictionary of keys and values from the command output contents

Type:

(dict)

parse_content(content)[source]

This method must be implemented by classes based on this class.