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
00f63f10
Commit
00f63f10
authored
9 years ago
by
Marcus Lauer (local)
Browse files
Options
Downloads
Patches
Plain Diff
Added ROFS.pm, which some systems might use.
parent
4a62add7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Site/ROFS.pm
+72
-0
72 additions, 0 deletions
lib/Site/ROFS.pm
with
72 additions
and
0 deletions
lib/Site/ROFS.pm
0 → 100644
+
72
−
0
View file @
00f63f10
package
Site::
ROFS
;
use
strict
;
use
warnings
;
use
base
'
Resmon::Module
';
use
Resmon::
ExtComm
qw(run_command)
;
=pod
=head1 NAME
Site::ROFS - Find the number of read-only filesystems
=head1 SYNOPSIS
Site:ROFS {
rofs: noop
}
=head1 DESCRIPTION
This module queries /proc/mounts to find the number of filesystems mounted
read-only.
=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 check_name
The name of the current check. You wouldn't normally return this, but it is
here to show how to access the check name, and for testing purposes.
=item count
Shows the number of filesystems which appear to be mounted read-only.
=back
=cut
sub
handler
{
my
$self
=
shift
;
my
$config
=
$self
->
{
config
};
# All configuration is in here
my
$check_name
=
$self
->
{
check_name
};
# The check name is in here
# Count the number of filesystems which appear to be mounted read-only.
my
$count
=
run_command
("
awk '
\$
4~/(^|,)ro(
\$
|,)/' /proc/mounts | wc -l
");
chomp
$count
;
return
{
"
check_name
"
=>
[
$self
->
{
check_name
},
"
s
"],
"
count
"
=>
[
$count
,
"
i
"],
"
command_result
"
=>
[
$count
,
"
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