Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resmon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrors
resmon
Commits
95ff614c
Commit
95ff614c
authored
13 years ago
by
Dave Hubbard
Browse files
Options
Downloads
Patches
Plain Diff
fixing identity
parent
880c6cef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Core/SmfDisabled.pm
+81
-0
81 additions, 0 deletions
lib/Core/SmfDisabled.pm
with
81 additions
and
0 deletions
lib/Core/SmfDisabled.pm
0 → 100644
+
81
−
0
View file @
95ff614c
package
Core::
SmfDisabled
;
use
strict
;
use
warnings
;
use
base
'
Resmon::Module
';
use
Resmon::
ExtComm
qw(run_command cache_command)
;
=pod
=head1 NAME
Core::SmfDisabled - Monitor services in disabled mode
=head1 SYNOPSIS
Core::SmfDisabled {
services: noop
}
Core::SmfDisabled {
services: svcs_path => /bin/svcs
}
=head1 DESCRIPTION
This module monitors Solaris SMF services and reports on any that are in
disabled mode.
=head1 CONFIGURATION
=over
=item check_name
The check name is descriptive only in this check. It is not used for anything.
=item svcs_path
Provide an alternate path to the svcs command. Optional.
=back
=head1 METRICS
=over
=item count
A count of how many services are in disabled mode. This should normally be
zero.
=item services
A list of the services in disabled mode. If no services are in disabled
mode, then this will be blank. The service names will be separated by
whitespace.
=back
=cut
sub
handler
{
my
$self
=
shift
;
my
$config
=
$self
->
{
config
};
# All configuration is in here
my
$svcs_path
=
$config
->
{
svcs_path
}
||
'
svcs
';
my
$output
=
run_command
("
$svcs_path
");
my
@disabled_services
=
map
((
split
(
/\s+/
,
$_
))[
2
],
grep
(
/^disabled/
,
split
(
/\n/
,
$output
)));
return
{
"
count
"
=>
[
scalar
(
@disabled_services
),
"
i
"],
"
services
"
=>
[
join
("
",
@disabled_services
),
"
s
"]
};
};
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment