diff --git a/legacy/posts/2015-10-12.01/article.html b/docroot/posts/2015-10-12.01/article.pag similarity index 95% rename from legacy/posts/2015-10-12.01/article.html rename to docroot/posts/2015-10-12.01/article.pag index 9b93166..9ff5756 100644 --- a/legacy/posts/2015-10-12.01/article.html +++ b/docroot/posts/2015-10-12.01/article.pag @@ -1,23 +1,32 @@ -define(`TITLE', `Something completely different: SNMP to MySQL') -define(`DATE', `2015-10-12') -define(`CONTENT', ` + +
I'm helping to maintain a fleet of about 50 printers in a charity distributed over about 30 locations in the city. Now, we wanted to know how much the individual printers are used to get some numbers for an effort to reduce the number of printers. +
+So, what is more self-evident then using SNMP to query the total page counter on a daily base - or better on an hourly base since the printers are switched off at this or that time and those we at least get sometimes valid data. +
+Typical monitoring tools like Cacti or Zabbix are very good in drawing nice graphs but not so good in delivering absolute numbers. So I decided to write something on my own: query some devices for some SNMP data points and store the results in a database. Which devices and which data points and which combinations? Everything in the database too. +
+I looked for a SNMP library, first in Python, then in Java - since I'm quite familiar with these languages - but everything I found was rather complicated to use. Then I looked for something in C# and found ''SnmpSharpNet''. Still not that easy to use but easier then what I found in Python or Java. +
+For that reason I started coding the little tool in C#. And what I did is working very well now. Configuration and error-handling is not perfect yet, but it is working. Enough for today. +
+BTW: I switched developing the code between Microsoft Visual Studio 2013 (on Windows) and Xamarin Studio (on the Mac) and run the tool on Linux. Works without any problem. Very nice! - - +
- -[code language="csharp"] +
+
namespace Snmp2Mysql
{
@@ -67,9 +76,11 @@ namespace Snmp2Mysql
}
}
}
-[/code]
+
+
-[code language="SQL"]
++CREATE TABLE `device_t` ( `id` int(11) NOT NULL AUTO_INCREMENT, `address` varchar(45) NOT NULL, @@ -107,7 +118,8 @@ CREATE TABLE `collecteddata_t` ( PRIMARY KEY (`id`), KEY `devicedataitem_fk_idx` (`devicedataitem`), CONSTRAINT `devicedataitem_fk` FOREIGN KEY (`devicedataitem`) REFERENCES `devicedataitem_t` (`id`) -[/code] +
+And here are the sources: @@ -116,5 +128,3 @@ And here are the sources: I'm using GPL code from MySQL (the MySQL Connector for .NET), find it here http://dev.mysql.com/downloads/connector/net/ and the SNMP library from http://www.snmpsharpnet.com. Ah, evaluation of the data? Haven't thought about, maybe using some tricky SQL statement or an Excel pivot table. I'll come back about that. - -') \ No newline at end of file diff --git a/docroot/posts/2016-03-03.01/article.pag b/docroot/posts/2016-03-03.01/article.pag index 483c17d..9ea106e 100644 --- a/docroot/posts/2016-03-03.01/article.pag +++ b/docroot/posts/2016-03-03.01/article.pag @@ -1,19 +1,34 @@ -define(`TITLE', `Why always SPI CS on pin 10?') -define(`DATE', `2016-03-03') -define(`CONTENT', ` + +#title#
+ +Thank you, Ladyada, for this great display. +
+But why is TFT CS on pin 10? +
+ +Pin 10 is also the SPI CS for the Ethernet shield. Why not, for instance, pin 6: +
+ +Carefully lift pin 9 of the level shifter and connect it using a thin wire with pin 6 of the Arduino connector. +
+And voila, both the display and the ethernet shield is working: +
+