This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo -i | |
$ crontab -e | |
# add the following using your editor | |
* * * * * python /PATH/TO/SCRIPT/bin/read_disk_temps.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import collections | |
from datetime import datetime | |
import json | |
from pySMART import Device | |
from traceback import print_exc | |
try: | |
import redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo smartctl --all /dev/sda -s on | |
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.16.0-60-generic] (local build) | |
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org | |
=== START OF INFORMATION SECTION === | |
Model Family: Western Digital AV SATA | |
Device Model: WDC WD2500AVJS-63B6A0 | |
Serial Number: WD-WCAT10290663 | |
LU WWN Device Id: 5 0014ee 1563ee704 | |
Firmware Version: 01.03A01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install smartmontools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import collections | |
from datetime import datetime | |
import json | |
# https://pypi.python.org/pypi/PySensors/ | |
# tl;dr: "sudo pip install pysensors" | |
import sensors | |
# you can install these modules with pip if needed | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 2.7.6 (default, Jun 22 2015, 17:58:13) | |
[GCC 4.8.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import sensors | |
>>> sensors.init() | |
>>> try: | |
... for chip in sensors.iter_detected_chips(): | |
... print '%s at %s' % (chip, chip.adapter_name) | |
... for feature in chip: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Takes output from "sensors" command and writes it to | |
a file by default. Can also connect to Redis and Influxdb | |
""" | |
#!/usr/bin/python | |
import subprocess | |
import json | |
from datetime import datetime | |
from traceback import print_exc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sweep | |
// by BARRAGAN <http://barraganstudio.com> | |
// This example code is in the public domain. | |
#include <Servo.h> | |
Servo myservo; // create servo object to control a servo | |
// a maximum of eight servo objects can be created | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import serial | |
import json | |
def main(device, load_json=False): | |
device_path = "/dev/{0}".format(device) | |
print "Opening {}".format(device_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Server Density Plugin | |
Minecraft player monitor | |
https://github.com/serverdensity/sd-agent-plugins/ | |
Version: 1.0.0 | |
""" | |
import json |