NAME
Check::supervisorctl - Check the status of supervisorctl to see if it is okay.
VERSION
Version 0.1.0
SYNOPSIS
use Check::supervisorctl;
my $check_supervisorctl = Check::supervisorctl->new();
my $results = $check_supervisorctl->run;
print join( "\n", @{ $results->{results} } ) . "\n";
exit( $results->{exit} );
SUBROUTINES/METHODS
new
Initiates the object.
- status_mapping :: A hash of status mapping values.
default :: {
stopped => 2,
starting => 0,
running => 0,
backoff => 2,
stopping => 2,
exited => 2,
fatal => 2,
unknown => 2,
}
- not_running_val :: Value for if it a config is not running.
default :: 2
- config_missing_val :: Value for if it a config is missing for a running item.
default :: 2
- config_dir_missing_val :: Value for if it the config dir is not present.
default :: 3
- config_dir_nonreadable_val :: Value for if it the config dir is not readable.
default :: 3
- status_error_val :: Value for if supervisorctl status could not be run or
returned a line that is not a item and status, such as when it can not
talk to supervisord.
default :: 3
- config_check :: Boolean for if it should check the configs or not.
default :: 0
- ignore :: A array of running items to ignore.
default :: []
- config_ignore :: A array of configs to ignore.
default :: []
- config_dir :: Config dir path.
default :: /usr/local/etc/supervisor/conf.d
default Linux :: /etc/supervisor/conf.d
parse_mappings
Parses a list of status=value strings, as taken by -s for check_supervisorctl, into a hash of options for "new". Whitespace is removed.
The names may be any of the statuses for status_mapping, or not_running, config_missing, config_dir_missing, config_dir_nonreadable, or status_error for the matching *_val options.
Dies if one is not in the form of name=value or the name is not known. The values are checked by "new".
my %mapping_opts = Check::supervisorctl->parse_mappings( 'stopped=1', 'config_missing=1' );
my $checker = Check::supervisorctl->new( config_check => 1, %mapping_opts );
run
This runs it.
my $results=$check_supervisorctl->run;
use Data::Dumper;
print Dumper($results);
exit($results->{exit});
It optionally takes the output of 'supervisorctl status', for when it has already been ran by something else. If not given, 'supervisorctl status' is ran.
- status_output :: The output of 'supervisorctl status'.
my $results=$check_supervisorctl->run( status_output => $output );
The returned data is as below.
- .configs[] :: A array of configs found.
- .config_not_running[] :: A array of configs present but not running.
- .config_missing[] :: A array of running items was found, but no matchingly named config was found.
- .config_check :: If it was told to check the configs or not for matching names.
- .config_dir :: The config dir to check.
- .config_ignored[] :: Array of configs ignored.
- .config_ignore :: Configs asked to be ignored.
- .exit :: Nagios style exit value.
- .status.$name :: Status of each item.
- .total :: Number of items found in the status output, not counting ignored ones.
- .ignored[] :: A array of ignored items.
- .ignore :: A array of items asked to be ignored.
- .config_dir_missing :: If the config dir is missing.
- .config_dir_readable :: If the config dir is readable.
- .status_list.$status :: A hash of the various statuses with keys being arrays of items for that status.
- .status_errors[] :: Lines from 'supervisorctl status' that were not a item and status,
such as when it can not talk to supervisord.
- .results[] :: A descriptive a array of the results of the check.
AUTHOR
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
BUGS
Please report any bugs or feature requests to bug-check-supervisorctl at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Check-supervisorctl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Check::supervisorctl
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Check-supervisorctl
Github issue tracker (report bugs here)
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2025 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007