summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2007-10-14 10:18:12 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2007-10-14 10:18:12 +0000
commitab49c20a3826ab058d0fdd6cf39a9628eb6e3e80 (patch)
tree1b1d6f0715d62298be74ff3f36cf25f6453f92a8
parent086ec207dc96bf0c29b3f0f9b8ccc4985569dc02 (diff)
new vserver changes stuff
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@302 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xnagios-check-libs12
1 files changed, 10 insertions, 2 deletions
diff --git a/nagios-check-libs b/nagios-check-libs
index 27fccfa..0a16b79 100755
--- a/nagios-check-libs
+++ b/nagios-check-libs
@@ -61,10 +61,18 @@ sub getUsers() {
return join('; ', (map { $_.': '.getProcs($_) } (sort {$a cmp $b} keys %processes)));
};
sub inVserver() {
- open(F, "< /proc/self/status") or return 0;
+ my ($f, $key);
+ if (-e "/proc/self/vinfo" ) {
+ $f = "/proc/self/vinfo";
+ $key = "XID";
+ } else {
+ $f = "/proc/self/status";
+ $key = "s_context";
+ };
+ open(F, "< $f") or return 0;
while (<F>) {
my ($k, $v) = split(/: */, $_, 2);
- if ($k eq 's_context') {
+ if ($k eq $key) {
close F;
return ($v > 0);
};