Díky vašim ohlasům a přáním přibyla na portál další funkcionalita. I nadále platí, abyste mi neváhali napsat, ať už s dotazem či námětem na vylepšení.
pano.roudnice.eu
Interaktivní porovnání historických fotografií Roudnice nad Labem s tím, jak to vypadá dnes.
PF 2016
Novinky na portále tmep.cz
Do aplikace tmep.cz postupně přibývá další funkcionalita a vylepšení. Díky všem za ohlasy! Rozhodně mi i nadále neváhejte napsat, ať už s dotazem či námětem na vylepšení.
Spuštění portálu tmep.cz
Počínaje dnešním dnem je v provozu portál tmep.cz, což je v podstatě hosting stejnojmenné aplikace pro vizualizaci naměřených teplot, který je zdarma. Narozdíl od klasické TMEPovské aplikace pro jedno čidlo, pro kterou musíte mít vlastní webhosting a doménu, si zde můžete jednoduše vytvořit účet a mít pod ním více čidel a ta zde také spravovat.… Continue reading Spuštění portálu tmep.cz
Adding missed measurements from TH2E LOG csv file into TMEP database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
<?php /* Simple way how to insert missing data into TMEP database from TH2E LOG Copy this script to root folder of TMEP application along with "data.csv" (from TH2E), then open it in browser (http://linktoapp.com/TH2Eimport.php) Repeat as needed :-) Content of data.csv should look like this: tmp; 31.70;06/13/2015 19:24:00 hum; 43.00;06/13/2015 19:24:00 */ // Connect to DB require "./config.php"; require "./scripts/db.php"; // Get data for import $data = file_get_contents("data.csv"); // Process data $toImport = Array(); $lines = explode("\n", $data); foreach($lines as $line) { $line = trim($line); $values = explode(";", $line); // Looks like we have something to process? if(count($values) == 3) { // Trim whitespaces $values[0] = trim($values[0]); $values[1] = trim($values[1]); $values[2] = trim($values[2]); // Check some simple conditions if(($values[0] == "tmp" OR $values[0] == "hum") AND is_numeric($values[1]) AND strtotime($values[2]) !== false) { $date = date("Y-m-d H:i:s", strtotime($values[2])); $toImport[$date][$values[0]] = round($values[1], 1); } } } // Go through gathered data foreach($toImport as $date => $values) { // We need at least temperature if(is_numeric($values["tmp"])) { $qExists = mysqli_query($GLOBALS["DBC"], "SELECT id FROM tme WHERE kdy >= CAST('".substr($date, 0, 17)."00' AS datetime) AND kdy <= CAST('".substr($date, 0, 17)."59' AS datetime)"); if(mysqli_num_rows($qExists) > 0) { echo "<span style='color: darkgreen;'>{$date} - already have</span><br>"; } else { echo "<span style='color: darkred;'>{$date} - missed, adding</span><br>"; // Add mysqli_query($GLOBALS["DBC"], "INSERT INTO tme(kdy, teplota, vlhkost) VALUES('{$date}', '{$values["tmp"]}', '{$values["hum"]}');"); echo mysqli_error($GLOBALS["DBC"]); } } } |
Setting VLAN ports with SNMP and PHP on D-Link DGS-1210-28
Should be similar on other switch types. Retrieve current settings about tagged/untagged VLAN Modify VLAN settings Write it back Save switch state Be sure not to cut yourself from switch management 🙂 You should have SNMP enabled and configured on switch (user with permission to read and write). We are using there two functions to… Continue reading Setting VLAN ports with SNMP and PHP on D-Link DGS-1210-28
API for NETFORMS ITPVADMIN
Dealing with NETFORMS API for their great ITPV service? Need to call their IPTVADMIN system from yours? Feel free to use this class to get you started quickly: https://github.com/MultiTricker/netforms-iptvadmin-api Result could look like this 🙂
Generating Smokeping probes and targets with PHP and MySQL
Well, the concept is so simple, that of course there is no limit in language and database. You should modify paths and other credentials in code. This is just basic example how you could achieve such thing. PHP file that will generete part of our smokeping config with Probes and Targets on server with database:… Continue reading Generating Smokeping probes and targets with PHP and MySQL
Monitoring BIND 9.6 with ZABBIX on Ubuntu
Basic concept is simple – BIND will generate XML file with statistics, PHP script output values we want into standalone files and we read those values with ZABBIX agent. We gonna need PHP to process XML statistics from BIND, install it with:
1 |
apt-get install php5-common php5-cli |
Turn on integrated BIND webserver with statistics in configuration file named.conf:
1 2 3 |
statistics-channels { inet * port 8053 allow { 127.0.0.1;}; }; |
And… Continue reading Monitoring BIND 9.6 with ZABBIX on Ubuntu