Issues with the lm_sensors service
Orion Poplawski <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
I have some issues with the zz-lm_sensors service:
- On Fedora, nc is blocked by SELinux:
--------------------- lm_sensors output Begin ------------------------
Ncat: Permission denied.
type=AVC msg=audit(1388681104.665:133): avc: denied { name_connect } for
pid=2394 comm="nc" dest=7634
scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023
tcontext=system_u:object_r:hddtemp_port_t:s0 tclass=tcp_socket
Even when run from the console I get:
--------------------- lm_sensors output Begin ------------------------
Ncat: Connection refused.
This I think is better:
my $query_hddtemp = $ENV{'query_hddtemp'} || '/usr/bin/nc 127.0.0.1 7634
2>/dev/null';
Although I am a little leery of adding network connections to logwatch.
Also, how common is hddtemp?
- It always generates output. I run logwatch in a mode where I only want
output if there are problems. So, similar to the zz-disk_space it should only
output if already printing or $Detail is not 0.
- I *think* SELinux may be blocking access to /proc/cpuinfo as well so that it
cannot determine if a machine is virtual.
Patch which I'll commit shortly:
Index: scripts/services/zz-lm_sensors
===================================================================
--- scripts/services/zz-lm_sensors (revision 176)
+++ scripts/services/zz-lm_sensors (working copy)
@@ -27,7 +27,7 @@
#Output sensors stats
my $pathto_sensors = $ENV{'pathto_sensors'} || '/usr/bin/sensors';
-my $query_hddtemp = $ENV{'query_hddtemp'} || '/usr/bin/nc 127.0.0.1 7634';
+my $query_hddtemp = $ENV{'query_hddtemp'} || '/usr/bin/nc 127.0.0.1 7634
2>/dev/null';
my $get_kvm_status = $ENV{'get_kvm_status'} || 'cat /proc/cpuinfo | grep -c
"QEMU Virtual CPU"';
my $sensors = qx($pathto_sensors);
@@ -34,7 +34,7 @@
my $hdd = qx($query_hddtemp);
my $kvm = qx($get_kvm_status);
-if ($kvm == 0) {
+if ($kvm == 0 and (($ENV{PRINTING} eq 'y') or $Detail)) {
if ($sensors) {
print $sensors;
}
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA, Boulder/CoRA Office FAX: 303-415-9702
3380 Mitchell Lane [email protected]
Boulder, CO 80301 http://www.nwra.com
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk