logwatch patches - lm_sensors

"gulikoza" <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
An idea to include lm_sensors output into logwatch report. This has mixed
results as lm_sensors will not always pick everything.
But works fine if at least coretemp is supported :-) Ignores QEMU virtual
machines, maybe virt-what support could be added...

The second output is hddtemp support. But maybe an idea for the future is to
parse smartctl output for hdd temperatre...

Regards,
gulikoza

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

_______________________________________________
Logwatch-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/logwatch-devel
logwatch-lm_sensors.patch (application/octet-stream, 1.6 KB)
diff --git a/conf/services/zz-lm_sensors.conf b/conf/services/zz-lm_sensors.conf
new file mode 100644
--- /dev/null
+++ b/conf/services/zz-lm_sensors.conf
@@ -0,0 +1,25 @@
+###########################################################################
+# $Id$
+###########################################################################
+
+# You can put comments anywhere you want to.  They are effective for the
+# rest of the line.
+
+# this is in the format of <name> = <value>.  Whitespace at the beginning
+# and end of the lines is removed.  Whitespace before and after the = sign
+# is removed.  Everything is case *insensitive*.
+
+# Yes = True  = On  = 1
+# No  = False = Off = 0
+
+Title = "lm_sensors output"
+
+# Which logfile group...
+LogFile = NONE
+
+########################################################
+# Please send all comments, suggestions, bug reports,
+#    etc, to [email protected]
+########################################################
+
+# vi: shiftwidth=3 tabstop=3 et
diff --git a/scripts/services/zz-lm_sensors b/scripts/services/zz-lm_sensors
new file mode 100644
--- /dev/null
+++ b/scripts/services/zz-lm_sensors
@@ -0,0 +1,17 @@
+##########################################################################
+# $Id$
+##########################################################################
+#Main
+
+#Output sensors stats
+my $sensors = `/usr/bin/sensors`;
+my $hdd = `/usr/bin/nc 127.0.0.1 7634`;
+my $kvm = `cat /proc/cpuinfo | grep -c "QEMU Virtual CPU"`;
+
+if (($sensors or $hdd) and ($kvm == 0)) {
+   print $sensors;
+   print $hdd;
+   print "\n"
+}
+
+# vi: shiftwidth=3 tabstop=3 syntax=perl et
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.