Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zabbix-agent-config
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
tech
zabbix-agent-config
Commits
43b8c8b6
Commit
43b8c8b6
authored
Jan 31, 2014
by
Dennis Kanbier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added lld scripts
parent
06892ec1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
lld/README.md
lld/README.md
+11
-0
lld/queryDisks.pl
lld/queryDisks.pl
+51
-0
No files found.
lld/README.md
0 → 100644
View file @
43b8c8b6
Low-level discovery scripts
===========================
These scripts are intended to be used by the Zabbix Agent to enable low-level discovery of host items in Zabbix.
Scripts and usage
-----------------
queryDisks.pl -
[
Monitoring disk I/O using Zabbix
](
http://www.denniskanbier.nl/blog/monitoring/monitoring-disk-io-using-zabbix
)
Help
----
If you need further assistance using the script, feel free to drop me a message!
lld/queryDisks.pl
0 → 100755
View file @
43b8c8b6
#!/usr/bin/perl
################################################################################
# queryDisks.pl - Generate a list of disk devices and return in JSON format
################################################################################
#
# This script reads /proc/diskstats and returns a list of devices it finds
# in JSON format:
#
# {#DISK} = "<device_name>"
#
# It is intended to use with the Zabbix Agent to enable low-level discovery
# for disk devices in Zabbix.
#
################################################################################
use
strict
;
use
warnings
;
# Options
my
$_proc
=
"
/proc/diskstats
";
# Validate options
if
(
!
-
e
$_proc
)
{
die
"
File
$_proc
not found!
";
}
# Keep count
my
$_first
=
1
;
# Present the data in JSON format
print
"
{
\n
";
print
"
\t\"
data
\"
:[
\n\n
";
# Fetch the data and put it in an array
my
@_data
=
`
cat /proc/diskstats | awk '{ print
\
$3 }'
`;
chomp
@_data
;
# Read the array and print the wanted data
foreach
my
$_disk
(
@_data
)
{
# Print the data in JSON
print
"
\t
,
\n
"
if
not
$_first
;
$_first
=
0
;
print
"
\t
{
\n
";
print
"
\t\t\"
{#DISK}
\"
:
\"
$_disk
\"\n
";
print
"
\n\t
}
\n
";
}
print
"
\n\t
]
\n
";
print
"
}
\n
";
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment