For use with mein sens0r graphing shit, this generates some stats for ein serbur [=[=[=[[=
|
1 month ago | |
---|---|---|
conf | 11 months ago | |
include | 1 year ago | |
sql | 1 year ago | |
src | 1 month ago | |
.editorconfig | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 1 year ago | |
Makefile | 1 year ago | |
README.md | 11 months ago |
I have a bunch of graphed sens0r data for keks, now I also wanted some shit for mein main server. [=[==[=[
Doesn't work on Wind0ngs, obviously. ;]];;];];];];];];];];]
Let's assume you're using Debian, then this should be enough:
apt-get install build-essential libbsd-dev libmysqlclient-dev lm-sensors smartmontools
Shit should b p self-explanatory:
First, set up an SQL database with its own user and shit. You'll prolly wanna enable SSL/TLS support if you're connecting to it over da interwebsz. The sql
dir in dis rep0 contains examples for the schemas, you may wanna adjust e.g. the amount of fans or CPU cores. Don't forget the triggers m9. =]]
Second, make sure the server can actually read sens0r data by running sensors-detect
and answering the questions. This should eventually make some shit available under /sys/class/hwmon
for reading the CPU temps and fan speeds. For drive temps we use smartctl
to get the value from SMART attributes 190 (Airflow_Temperature_Celsius
) or 194 (Temperature_Celsius
), preferring the latter. What we use for speedtests should be obvious y0.
For compilation, just copy conf/muhconf.c.example
to conf/muhconf.c
and edit that shit. Then run make
and check for errors. If there are none simply try to run all the binaries in the created bin
direct0ry. If all's gucci you can add a cronjob to run that shit continually. ;];];];];];]
drivetemps
should likely be run as rewt cuz it needs access to the special block device files, otherwise you'll pr0lly need to add a regular user to the disk
group and it'll be able to fuck up em disks =]It's very crude and naive but it works for me. [=[[=[=[==[=[
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAILTO=''
*/2 * * * * kill -9 $(ps aux | grep '[s]erbur_stats/bin/cputemps' | grep -v '/bin/sh' | awk '{ print $2 }') 2>/dev/null; /home/hecks/serbur_stats/bin/cputemps >/dev/null
*/2 * * * * kill -9 $(ps aux | grep '[s]erbur_stats/bin/drivetemps' | grep -v '/bin/sh' | awk '{ print $2 }') 2>/dev/null; /home/hecks/serbur_stats/bin/drivetemps >/dev/null
*/2 * * * * kill -9 $(ps aux | grep '[s]erbur_stats/bin/fans' | grep -v '/bin/sh' | awk '{ print $2 }') 2>/dev/null; /home/hecks/serbur_stats/bin/fans >/dev/null
14 * * * * kill -9 $(ps aux | grep '[s]erbur_stats/bin/speedtest' | grep -v '/bin/sh' | awk '{ print $2 }') 2>/dev/null; /home/hecks/serbur_stats/bin/speedtest >/dev/null
I'm using kill
to make sure any stalled previous instances are cleaned up. ;]