diff options
Diffstat (limited to 'nagios-check-libs')
-rwxr-xr-x | nagios-check-libs | 12 |
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); }; |