Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
IML Open Source
icinga-checks
Commits
bd99efcb
Commit
bd99efcb
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
allow multiple hosts per line in snmp.cfg
parent
8bbb8220
No related branches found
No related tags found
1 merge request
!71
allow multiple hosts per line in snmp.cfg
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
check_snmp_data
+1
-1
1 addition, 1 deletion
check_snmp_data
check_snmp_includes
+7
-3
7 additions, 3 deletions
check_snmp_includes
check_snmp_synology
+1
-1
1 addition, 1 deletion
check_snmp_synology
inc_pluginfunctions
+2
-2
2 additions, 2 deletions
inc_pluginfunctions
with
11 additions
and
7 deletions
check_snmp_data
+
1
−
1
View file @
bd99efcb
...
@@ -186,7 +186,7 @@ $_methods
...
@@ -186,7 +186,7 @@ $_methods
CONFIG FILE:
CONFIG FILE:
The config file can be multiline and has the syntax
The config file can be multiline and has the syntax
[SNMPTARGET]:[auth parameters]
[SNMPTARGET
[,target2]
]:[auth parameters]
The auth parameters set the version and all needed values to connect.
The auth parameters set the version and all needed values to connect.
Snmp v2 uses a community string.
Snmp v2 uses a community string.
Snmp v3 is highly recommended (you should disable Snmp v2) and needs
Snmp v3 is highly recommended (you should disable Snmp v2) and needs
...
...
This diff is collapsed.
Click to expand it.
check_snmp_includes
+
7
−
3
View file @
bd99efcb
...
@@ -35,10 +35,14 @@ read_config(){
...
@@ -35,10 +35,14 @@ read_config(){
SNMPAUTH
=
"-v
$SNMPVERSION
-c
$SNMPCOMMUNITY
"
SNMPAUTH
=
"-v
$SNMPVERSION
-c
$SNMPCOMMUNITY
"
if
[
-r
"
$SNMPCONFIG
"
]
;
then
if
[
-r
"
$SNMPCONFIG
"
]
;
then
if
grep
"^
${
SNMPTARGET
}
:"
"
$SNMPCONFIG
"
>
/dev/null
;
then
SNMPAUTH
=
"
$(
grep
-v
"^#"
"
$SNMPCONFIG
"
|
grep
"^,*
${
SNMPTARGET
}
[,:]"
|
cut
-f
2-
-d
':'
)
"
SNMPAUTH
=
"
$(
grep
"^
${
SNMPTARGET
}
:"
"
$SNMPCONFIG
"
|
cut
-f
2-
-d
':'
)
"
if
[
-z
"
$SNMPAUTH
"
]
;
then
else
SNMPAUTH
=
"
$(
grep
"^DEFAULT:"
"
$SNMPCONFIG
"
|
cut
-f
2-
-d
':'
)
"
SNMPAUTH
=
"
$(
grep
"^DEFAULT:"
"
$SNMPCONFIG
"
|
cut
-f
2-
-d
':'
)
"
if
[
-z
"
$SNMPAUTH
"
]
;
then
ph.setStatus
"unknown"
echo
"ERROR: No authentication data were found for [
${
SNMPTARGET
}
] in config file [
$SNMPCONFIG
]."
ph.exit
fi
fi
fi
else
else
ph.setStatus
"unknown"
ph.setStatus
"unknown"
...
...
This diff is collapsed.
Click to expand it.
check_snmp_synology
+
1
−
1
View file @
bd99efcb
...
@@ -96,7 +96,7 @@ OPTIONS:
...
@@ -96,7 +96,7 @@ OPTIONS:
CONFIG FILE:
CONFIG FILE:
The config file can be multiline and has the syntax
The config file can be multiline and has the syntax
[SNMPTARGET]:[auth parameters]
[SNMPTARGET
[,target2]
]:[auth parameters]
The auth parameters set the version and all needed values to connect.
The auth parameters set the version and all needed values to connect.
Snmp v2 uses a community string.
Snmp v2 uses a community string.
Snmp v3 is highly recommended (you should disable Snmp v2) and needs
Snmp v3 is highly recommended (you should disable Snmp v2) and needs
...
...
This diff is collapsed.
Click to expand it.
inc_pluginfunctions
+
2
−
2
View file @
bd99efcb
...
@@ -325,8 +325,8 @@ function ph.getFileAge(){
...
@@ -325,8 +325,8 @@ function ph.getFileAge(){
function
ph._getStorefile
(){
function
ph._getStorefile
(){
local
varName
=
$1
local
varName
=
$1
local
mydir
=
"/tmp/icinga_counter_
$
(
whoami
)
"
local
mydir
=
"/tmp/icinga_counter_
$
{
USER
}
"
test
-n
"
$dir_data
"
&&
mydir
=
"
${
dir_data
}
/_counter_
$
(
whoami
)
"
test
-n
"
$dir_data
"
&&
mydir
=
"
${
dir_data
}
/_counter_
$
{
USER
}
"
local
_basename
local
_basename
_basename
=
$(
basename
$0
)
_basename
=
$(
basename
$0
)
...
...
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