|
Packit |
57988d |
##########################################################################
|
|
Packit |
57988d |
# $Id$
|
|
Packit |
57988d |
##########################################################################
|
|
Packit |
57988d |
# Copyright (c) 2013 gulikoza
|
|
Packit |
57988d |
# Covered under the included MIT/X-Consortium License:
|
|
Packit |
57988d |
# http://www.opensource.org/licenses/mit-license.php
|
|
Packit |
57988d |
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit |
57988d |
# copy of this software and associated documentation files (the "Software"),
|
|
Packit |
57988d |
# to deal in the Software without restriction, including without limitation
|
|
Packit |
57988d |
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
Packit |
57988d |
# and/or sell copies of the Software, and to permit persons to whom the
|
|
Packit |
57988d |
# Software is furnished to do so, subject to the following conditions:
|
|
Packit |
57988d |
#
|
|
Packit |
57988d |
# The above copyright notice and this permission notice shall be included
|
|
Packit |
57988d |
# in all copies or substantial portions of the Software.
|
|
Packit |
57988d |
#
|
|
Packit |
57988d |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
Packit |
57988d |
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit |
57988d |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
Packit |
57988d |
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
Packit |
57988d |
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
Packit |
57988d |
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
Packit |
57988d |
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit |
57988d |
###########################################################################
|
|
Packit |
57988d |
#Main
|
|
Packit |
57988d |
|
|
Packit |
57988d |
#Output sensors stats
|
|
Packit |
57988d |
|
|
Packit |
57988d |
my $pathto_sensors = $ENV{'pathto_sensors'} || '/usr/bin/sensors';
|
|
Packit |
57988d |
my $get_kvm_status = $ENV{'get_kvm_status'} || 'grep -c "QEMU Virtual CPU" /proc/cpuinfo';
|
|
Packit |
57988d |
|
|
Packit |
57988d |
my $kvm = qx($get_kvm_status);
|
|
Packit |
57988d |
|
|
Packit |
57988d |
if ($kvm == 0 and (($ENV{PRINTING} eq 'y') or $Detail)) {
|
|
Packit |
57988d |
my $sensors = qx($pathto_sensors);
|
|
Packit |
57988d |
if ($sensors) {
|
|
Packit |
57988d |
print $sensors;
|
|
Packit |
57988d |
}
|
|
Packit |
57988d |
}
|
|
Packit |
57988d |
|
|
Packit |
57988d |
# vi: shiftwidth=3 tabstop=3 syntax=perl et
|