Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nagios-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Lysator
nagios-plugins
Commits
793811da
Commit
793811da
authored
18 years ago
by
Peter Eriksson
Browse files
Options
Downloads
Patches
Plain Diff
Nagios module to check Sun Solaris 10 SMF subsystem
parent
d02a96a7
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
check_svcs
+63
-0
63 additions, 0 deletions
check_svcs
with
63 additions
and
0 deletions
check_svcs
0 → 100755
+
63
−
0
View file @
793811da
#!/bin/ksh
PATH
=
/usr/bin
export
PATH
VERBOSE
=
0
SERVER
=
""
SVCS
=
"/usr/bin/svcs"
RSH
=
ssh
RC
=
0
SL
=
""
TMP
=
"/tmp/check_svcs.
$$
"
trap
"/bin/rm -f
${
TMP
}
"
0 1 2 15
while
test
-n
"
$1
"
;
do
case
"
$1
"
in
-v
)
VERBOSE
=
1
;;
-H
)
SERVER
=
"
$2
"
shift
;;
*
)
echo
"
$0
: Invalid option:
$1
"
exit
1
;;
esac
shift
done
if
[
"
$SERVER
"
=
""
-o
"
$SERVER
"
=
"localhost"
-o
"
$SERVER
"
=
"
`
/bin/uname
-n
`
"
]
;
then
CMD
=
"
${
SVCS
}
-x"
else
CMD
=
"
$RSH
-n
${
SERVER
}
${
SVCS
}
-x"
fi
${
CMD
}
2>/dev/null
>
${
TMP
}
RC
=
$?
if
[
$RC
!=
0
]
;
then
echo
"UNKNOWN -
${
CMD
}
failed with code
$RC
"
exit
-1
fi
RC
=
0
nawk
'($1 ~ /svc:*/) { print $1 }'
<
$TMP
|
while
read
svc
;
do
RC
=
1
SL
=
"
${
SL
}
${
svc
}
"
done
case
"
$RC
"
in
0
)
echo
"OK - All services running"
exit
0
;;
1
)
echo
"WARNING - Services not running:
${
SL
}
"
exit
1
;;
esac
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