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
65ed1386
Commit
65ed1386
authored
7 years ago
by
Steve Ryan
Browse files
Options
Downloads
Patches
Plain Diff
added Packages, Vms resmon modules
parent
3abbaa74
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Site/Packages.pm
+69
-0
69 additions, 0 deletions
lib/Site/Packages.pm
lib/Site/Vms.pm
+66
-0
66 additions, 0 deletions
lib/Site/Vms.pm
with
135 additions
and
0 deletions
lib/Site/Packages.pm
0 → 100644
+
69
−
0
View file @
65ed1386
package
Site::
Packages
;
use
strict
;
use
warnings
;
use
base
'
Resmon::Module
';
use
Resmon::
ExtComm
qw(run_command)
;
=pod
=head1 NAME
Site::Packages - Find updated packages
=head1 SYNOPSIS
Site:Packages {
check_pkgs : updatefile_path => /var/local/csdupdates
}
=head1 DESCRIPTION
This module queries csdupdates to find possible package updates
=head1 CONFIGURATION
=over
=item check_name
The check name is descriptive only in this check. It is not used for anything.
Some checks use the check_name as part of the configuration, such as
free space checks that specify the filesystem to use.
=back
=head1 METRICS
=over
=item total
Shows all available package updates
=item security
Shows available sercurity updates
=back
=cut
sub
handler
{
my
$self
=
shift
;
my
$config
=
$self
->
{'
config
'};
my
$pkgs_path
=
$config
->
{'
update_filepath
'}
||
'
/var/local/csdupdates
';
my
$output_total
=
run_command
("
grep -Po '(?<=^Total:)
\\
w*
\$
'
$pkgs_path
");
my
$output_security
=
run_command
("
grep -Po '(?<=^Security:)
\\
w*
\$
'
$pkgs_path
");
my
%metrics
=
(
"
total
"
=>
$output_total
,
"
security
"
=>
$output_security
,
);
return
\
%metrics
;
};
1
;
This diff is collapsed.
Click to expand it.
lib/Site/Vms.pm
0 → 100644
+
66
−
0
View file @
65ed1386
package
Site::
Vms
;
use
strict
;
use
warnings
;
use
base
'
Resmon::Module
';
use
Resmon::
ExtComm
qw(run_command)
;
=pod
=head1 NAME
Core::Vms - Check current KVM VM status
=head1 SYNOPSIS
Site::Vms {
check_vms : virsh_path => /usr/bin/virsh
}
=head1 DESCRIPTION
This module retrieves VM statistics.
=head1 CONFIGURATION
=over
=item check_name
Arbitrary name of the check.
=item virsh_path
Optional path to the virsh executable.
=back
=head1 METRICS
=over
=item active
=item inactive
=back
=cut
sub
handler
{
my
$self
=
shift
;
my
$config
=
$self
->
{'
config
'};
my
$virsh_path
=
$config
->
{'
virsh_path
'}
||
'
virsh
';
my
$output_active
=
run_command
("
$virsh_path
list --name
");
my
$output_inactive
=
run_command
("
$virsh_path
list --name --inactive
");
my
%metrics
=
(
"
active
"
=>
$output_active
,
"
inactive
"
=>
$output_inactive
,
);
return
\
%metrics
;
};
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