1 2Changes from v0.5.3 to v0.6.0 3============================= 4 5* Wed Apr 5 22:15:18 2017 +0100 - Radu - Eosif Mihailescu <radu.mihailescu@linux360.ro> 6 7 Fix packaging of examples - the proper destination is 8 %{_defaultdocdir}/%{name}-%{version} ... - ... but why bother when %doc 9 can magically take care of it? 10 11 (Git commit ab4657b276f804552399681634f5e024555b76c9) 12 13* Sun Mar 12 15:51:38 2017 +0100 - Pieter Hollants <pieter@hollants.com> 14 15 Correct RFC number that describes the AgentX protocol 16 17 Fixes #29. 18 19 (Git commit 101cc3d88d48d77b8b5260cc7479a3a238628431) 20 21* Tue Nov 1 20:37:40 2016 +0100 - Pieter Hollants <pieter@hollants.com> 22 23 netsnmpagent: Update module docstring 24 25 Hooray, we're not under heavy development anymore! 26 27 (Git commit f543df2195867662dc72e61989e25798fcad1765) 28 29* Tue Nov 1 20:35:59 2016 +0100 - Pieter Hollants <pieter@hollants.com> 30 31 Update README and setup.py.in to indicate Python 3 compatibility 32 33 (Git commit 3c662434549de36cffbdaff0f6de97a7a52ad0e3) 34 35* Tue Nov 1 14:54:28 2016 +0100 - Pieter Hollants <pieter@hollants.com> 36 37 netsnmpagent: Code formatting 38 39 (Git commit 639619802d880b90d22b0492a93a51dd8bcb2f64) 40 41* Tue Nov 1 14:54:11 2016 +0100 - Pieter Hollants <pieter@hollants.com> 42 43 netsnmpagent: Correct some comments 44 45 (Git commit 9e22370ba002b134543d24c4d28b007e8d828c9b) 46 47* Tue Nov 1 14:50:41 2016 +0100 - Pieter Hollants <pieter@hollants.com> 48 49 netsnmpagent: Remove superfluous double assignment of self._cvar.value 50 51 We already assigned it a few lines above and also didn't modify it 52 inbetween. 53 54 (Git commit cb9af33107b21db6f75514e9ba13a7b0991a2a35) 55 56* Tue Nov 1 14:06:10 2016 +0100 - Pieter Hollants <pieter@hollants.com> 57 58 netsnmpagent: Convert between byte and unicode strings if necessary 59 60 This change addresses the major issue that prevented python-netsnmpagent 61 from running under Python 3 so far. 62 63 Under Python 2.x, a string that gets declared is of the "str" type, which 64 is implemented as a byte string. Unicode strings have to be explicitly 65 declared: 66 67 >>> a = "Metallica" 68 >>> type(a) 69 <type 'str'> 70 >>> isinstance(a, bytes) 71 True 72 >>> b = u"Motörhead" 73 >>> type(b) 74 <type 'unicode'> 75 76 We were prettily using "str" strings everywhere, which, being byte 77 strings, perfectly aligned with the C-style strings exposed through the 78 ctypes module. 79 80 Now under Python 3.x, however, a string that gets declared is an instance 81 of a class that is still called "str" but is implemented as a collection 82 of Unicode code points. There is no »u"Foo"« notation anymore, instead 83 byte strings have to be explicitly declared with a "b" prefix: 84 85 >>> a = "Motörhead" 86 >>> type(a) 87 <class 'str'> 88 >>> isinstance(a, bytes) 89 False 90 >>> b = b"Metallica" 91 >>> type(b) 92 <class 'bytes'> 93 94 Following the paradigma of enforcing a stricter distinction between 95 Unicode and byte strings in code, the ctypes module in Python 3.x removed 96 automatic conversions. Thus we now need to explicitly encode Unicode 97 strings to byte strings before passing them to net-snmp. Likewise we need 98 to decode received strings before returning them to Python code. In both 99 cases we use the encoding retrieved from locale.getpreferredencoding(). 100 101 Note that this changed behavior affects running under Python 3.x ONLY, in 102 an attempt to provide the "natural" behavior expected under the Python 103 version used. Under Python 2.x, the interface to your Python code remains 104 UNCHANGED, expecting and returning "str" byte strings. 105 106 This also means that if your agent code is running under Python 2.x and 107 you want to pass or receive Unicode strings to python-netsnmpagent and 108 net-snmp, you will have to keep encoding/decoding them yourself. 109 110 (Git commit 003fcb2724cfbaf22b876ab604b1914303a7e10d) 111 112* Tue Nov 1 15:27:55 2016 +0100 - Pieter Hollants <pieter@hollants.com> 113 114 netsnmpagent: Use long() under Python 2.x and int() otherwise 115 116 Python 3.x does not need the "long" type anymore because "int" numbers 117 have no limit anymore. 118 119 (Git commit 79b3a35c7f06f250fd447b2bd8b1a5465b135870) 120 121* Tue Nov 1 15:17:14 2016 +0100 - Pieter Hollants <pieter@hollants.com> 122 123 netsnmpagent: Always return numbers through int(), ignoring sys.maxint 124 125 Actually I'm not sure what I tried to achieve with the sys.maxint check 126 as we can safely rely on int() under Python 2.x to automatically return a 127 "long" typed number if "int" doesn't suffice. Under Python 3.x "int" 128 doesn't have a limit anymore, anyway. 129 130 (Git commit 919c47dc53048204b11b22597954bafc3f5f2065) 131 132* Tue Nov 1 19:34:30 2016 +0100 - Pieter Hollants <pieter@hollants.com> 133 134 netsnmptestenv: Decode snmpcmd output to Unicode if necessary 135 136 Python 3 strings are Unicode strings, not byte strings. 137 138 (Git commit f6b988ac08a4afba112eec0c84368ec8c5d9b540) 139 140* Tue Nov 1 20:16:25 2016 +0100 - Pieter Hollants <pieter@hollants.com> 141 142 netsnmptestenv: Hardcode temporary directory name 143 144 As the tests are now no longer run through the nosetests wrapper script, 145 sys.argv[0] doesn't contain reasonable data anymore. 146 147 (Git commit 80f9a698504f346f77a80be3e303b550e90d27f4) 148 149* Tue Nov 1 19:28:33 2016 +0100 - Pieter Hollants <pieter@hollants.com> 150 151 Makefile: Run tests with both Python 2 and 3 152 153 This makes "make tests" run all tests with both Python 2 and Python 3, 154 thereby allowing to identify code that behaves differently under either 155 Python version. 156 157 Because (at least on my system) there are no "nosetests2" and 158 "nosetests3" links but "python2" and "python3" links do exist, we now run 159 the tests via 'python2 -c "import nose; nose.main()' statements 160 (likewise for python3). 161 162 (Git commit a9cd9bdc71d667d491a5829a7f25f4399933db02) 163 164* Tue Nov 1 20:14:36 2016 +0100 - Pieter Hollants <pieter@hollants.com> 165 166 netsnmptestenv: Call shutdown() via atexit instead of __del__() 167 168 Lesson learned: don't do cleanup stuff in __del__() or you'll get 169 exceptions printed on stdout and possibly incomplete cleanup when running 170 under Python 3. 171 172 (Git commit 93cd55a97f0db3b407454e1cd90143decd744fc6) 173 174* Tue Nov 1 15:34:24 2016 +0100 - Pieter Hollants <pieter@hollants.com> 175 176 test_02_netsnmpagent_init: Drop unused imports 177 178 (Git commit 8ffc1c76ad4cb6be00fe8575bc89ebd9bd71411f) 179 180* Tue Nov 1 20:19:10 2016 +0100 - Pieter Hollants <pieter@hollants.com> 181 182 netsnmptestenv: Add/revise some comments 183 184 (Git commit dd7fd8046d2b3d0c33f64c32d0464b4873dfbdd9) 185 186* Mon Oct 31 19:16:27 2016 +0100 - Pieter Hollants <pieter@hollants.com> 187 188 Code formatting fixes 189 190 (Git commit 9975c3a539a9cf6b278cd8904ad0efb3346c7e4e) 191 192* Thu Oct 27 21:11:11 2016 +0200 - Pieter Hollants <pieter@hollants.com> 193 194 Python 3 support: Use items() when iteritems() is not available 195 196 (Git commit a6f837e06f2d68cbc1cf74fc075d2fe1403ab140) 197 198* Thu Oct 27 21:06:46 2016 +0200 - Pieter Hollants <pieter@hollants.com> 199 200 Python 3 support: Use print(foo) instead of print foo 201 202 (Git commit a670331c7e126cf4d39ef6a73b61cd92686f2b41) 203 204* Mon Aug 29 23:06:24 2016 +0200 - Pieter Hollants <pieter@hollants.com> 205 206 Update README to give credit where credit is due 207 208 (Git commit 5122583d4d0f7a1a90a9127f76550b5f37ec2f56) 209 210* Mon Aug 29 23:01:07 2016 +0200 - Pieter Hollants <pieter@hollants.com> 211 212 Trivial description fixes in SIMPLE-MIB.txt 213 214 (Git commit d26c73a028af9e3df8e3c74653e6f280d3988a01) 215 216* Fri Aug 19 08:53:19 2016 +0200 - Tobias Deiminger <tobias.deiminger@gmail.com> 217 218 Fixes for using IpAddress objects as table indices 219 220 This incorporates a number of fixes for using IpAddress objects as table 221 indices: 1. Add missing attributes to IpAddress class' __init__() method 222 2. Due to an unfixed Net-SNMP issue related to byte order (see 223 https://sourceforge.net/p/net-snmp/bugs/2136/), we have to pass 224 IpAddress values in host byte order when used as table indices and 225 in network byte order otherwise. 3. Improve string representation of 226 IpAddress in Table.value(). 227 228 Note: In IpAddress.cref() we don't store a reference to _cidx in "self". 229 This is only safe if _cidx is consumed by a Net-SNMP function that copies 230 the value (eg. snmp_varlist_add_variable). If it were used by Net-SNMP as 231 raw pointer, Pythons reference counting could delete the object while 232 Net-SNMP still wants to access it. 233 234 These changes have been tested on x86_64 (little endian) and mips64 (big 235 endian) architecture. 236 237 (Git commit 519b0e8f3b500c10e5ec57dd3eadaebf09329146) 238 239* Sat May 28 11:45:51 2016 +0200 - Pieter Hollants <pieter@hollants.com> 240 241 Bump copyright year 242 243 (Git commit 9a5b4e6f94874d3797fba5c21a1401684e0bc1fa) 244 245* Sat May 28 11:35:53 2016 +0200 - Pieter Hollants <pieter@hollants.com> 246 247 Relicense under the Lesser GNU Public License (LGPL), version 3. 248 249 I've decided to relicense python-netsnmpagent under the LGPL instead of 250 the GPL to facilitate integration with LGPL-licensed as well as 251 proprietary software. Ie. using python-netsnmpagent in your proprietary 252 subagent does not mean that you have to license your subagent under 253 python-netsnmpagent's license as well. 254 255 (Git commit d19b91131353c19cf408f2208bdf5384941a47d6) 256 257* Wed May 27 14:00:30 2015 +0300 - Anton Todorov <a.todorov@storpool.com> 258 259 netsnmpagent: Fix Table's value() cutting off ASN_COUNTER64 table values 260 261 When returning a table row's data, we accessed ASN_COUNTER64 values via a 262 32-bit pointer, effectively cutting off the other 32 bits. Using the 263 "data" union's "counter64" pointer fixes this. 264 265 (Git commit 1fb1abb33a5eccc172b0279b099172a5230e4118) 266 267* Fri Apr 17 10:47:54 2015 +0200 - Pieter Hollants <pieter@hollants.com> 268 269 Update README with extended credits 270 271 (Git commit 9f7ad1cb2563c4d91948265cf85015bd67c1dea3) 272 273* Wed Apr 15 15:19:54 2015 +0300 - Anton Todorov <a.todorov@storpool.com> 274 275 Fix format string in threading_agent example's logging 276 277 Python 2.6 requires positional argument specifiers, omitting them only 278 works on Python 2.7 and later. 279 280 Cf. https://docs.python.org/2/library/string.html#formatstrings 281 282 (Git commit d547d9fc162c64db35b46ef75593534002cf5c6a) 283 284* Wed Apr 15 15:25:55 2015 +0300 - Anton Todorov <a.todorov@storpool.com> 285 286 examples/run_* scripts: Trap additional signals for cleanup 287 288 In some cases the tempdirs were left because we seem to have missed some 289 signals. 290 291 (Git commit 6bc2e8753f38e872ab8815bc4186b314869993eb) 292 293* Sun Mar 22 13:49:46 2015 +0100 - Pieter Hollants <pieter@hollants.com> 294 295 netsnmpagent: Drop special string handling in Table's init()/setRowCell() 296 297 Because of issues with strings inside tables, we used to implement some 298 special handling for (what we thought were) the trailing zero byte in C 299 strings in Table's init() and setRowCell() methods, passing size+1 to 300 netsnmp_set_row_column(). 301 302 However, while this seemed to work on older net-snmp versions, with newer 303 net-snmp versions we suddently had different issues, with irregular dot 304 chars appearing at the end of strings. 305 306 Turns out, we had a bug, but fixed it at the wrong place: right here, 307 passing size (not size+1) appears to be correct. a8181ddb fixes the real 308 culprit in Table's value() method. 309 310 (Git commit 74fac74547eb9a344852c06fc7ca6c78476a4cbd) 311 312* Sun Mar 22 13:35:58 2015 +0100 - Pieter Hollants <pieter@hollants.com> 313 314 netsnmpagent: Make Table's value() method regard string lengths 315 316 When creating the dictionary returned by the Table class's value() 317 method, we so far assumed that the strings referenced through the "data" 318 field in netsnmp_table_data_set_storage structures would be zero 319 byte-terminated, as all C strings. However, this does not seem to be the 320 case, as eg. netsnmp_set_row_column() uses memcpy(), not strcpy(), ie. 321 when setting a string it is NOT zero byte-terminated. We thus need to 322 regard "data_len" when returning data to the Python world. 323 324 Strangely, this does not seem to be necessary with the simple scalar 325 types such as OctetString and DisplayString which are basically 326 ctypes.c_char_p objects as well... 327 328 (Git commit a8181ddbd1c2ba633b0e6bd651b32612ae42b117) 329 330* Wed Nov 12 18:05:00 2014 +0100 - Pieter Hollants <pieter@hollants.com> 331 332 Add test cases for OctetString scalar type 333 334 (Git commit e01291200f16460f08af994866113e548db234cf) 335 336* Wed Nov 12 18:00:59 2014 +0100 - Pieter Hollants <pieter@hollants.com> 337 338 netsnmptestenv: Handle strings without datatype and remove double quotes 339 340 Sometimes, snmpget might return data without an explicit datatype. We'll 341 handle it as strings, then, and remove any heading and trailing double 342 quotes. 343 344 (Git commit 8b8681e7f3c2c24bd3233b360c2454dc458a493c) 345 346* Wed Nov 12 13:38:22 2014 +0100 - Pieter Hollants <pieter@hollants.com> 347 348 Add test cases for TimeTicks scalar type 349 350 (Git commit dd1be2cb264957cc45bceb568bd820f5244be38d) 351 352* Wed Nov 12 13:36:12 2014 +0100 - Pieter Hollants <pieter@hollants.com> 353 354 netsnmptestenv: Fix splitting in snmpget() for output with multiple ":" 355 chars 356 357 (Git commit ceb3c12327eedccfe2896182def2725dd5e4dc95) 358 359* Wed Nov 12 13:28:37 2014 +0100 - Pieter Hollants <pieter@hollants.com> 360 361 Smaller fixes for Counter32/Counter64 integration tests 362 363 "Oops". 364 365 (Git commit eb48301e194dd3f03000cd8e5e9a75c457275d6b) 366 367* Wed Nov 12 11:20:53 2014 +0100 - Pieter Hollants <pieter@hollants.com> 368 369 Add test cases for Counter32 and Counter64 scalar types 370 371 (Git commit 68a7a7263f565e533d9caa6a2bc0bd539b78ce55) 372 373* Wed Nov 12 11:09:09 2014 +0100 - Pieter Hollants <pieter@hollants.com> 374 375 Smaller fixes for Unsigned32 integration tests 376 377 (Git commit 13924941b9932401be2434a3937a6d174292a44a) 378 379* Tue Nov 11 20:47:38 2014 +0100 - Pieter Hollants <pieter@hollants.com> 380 381 Add test cases for Integer32 variable type and rework those for 382 Unsigned32 383 384 (Git commit 52c9e82f493da197e1d31e343eb419347595b480) 385 386* Tue Nov 11 15:51:53 2014 +0100 - Pieter Hollants <pieter@hollants.com> 387 388 Just some small fixes to unify source code style 389 390 (Git commit fb5265611ef6ce94890678a9c432d719aa1fafb2) 391 392* Tue Nov 11 15:05:47 2014 +0100 - Pieter Hollants <pieter@hollants.com> 393 394 Construct packager email from user- and hostname if not set through git 395 config 396 397 The included RPM .spec file always needs a packager name or email 398 address, otherwise rpmbuild will complain. In properly configured git 399 repos, the email address configured with "git config user.email" would 400 have been used so far, but it should be possible to issue a "make rpms" 401 without this requirement. 402 403 Thus we now fall back to constructing a most probably bogus email address 404 by combining the username and the hostname. This will allow to build RPMs 405 for personal purposes, however, for redistribution purposes one should 406 always explicitly configure a proper email address through "git config" 407 beforehand. 408 409 (Git commit 2bef55cd908e8cf05bac02e65cb705294607f39d) 410 411* Thu Jul 31 16:10:34 2014 +0200 - Jacobo de Vera <devel@jacobodevera.com> 412 413 Rename as suggested in review 414 415 (Git commit bdbb299c428d1f936433cbff9086490dc37f39b6) 416 417* Mon Jul 21 14:25:40 2014 +0200 - Jacobo de Vera <devel@jacobodevera.com> 418 419 Make the use of MIB files completely optional 420 421 (Git commit b2baaa3b3097546603c8b082395d3c27cceb4467) 422 423* Sat May 17 00:28:57 2014 +0200 - Pieter Hollants <pieter@hollants.com> 424 425 Update README 426 427 (Git commit 9f9de13efffe9be0b1b9ea24a91046a96e383b40) 428 429* Sat May 17 00:27:48 2014 +0200 - Pieter Hollants <pieter@hollants.com> 430 431 Add "tests" target to Makefile and README explaining why to use it 432 433 net-snmp's broken shutdown semantics force use to wrap nosetests so that 434 it spawns a new Python process for each test case file. 435 436 (Git commit 5dd4001379e676d0772ca6f7bfe37458b1fadc15) 437 438* Sat May 17 00:27:06 2014 +0200 - Pieter Hollants <pieter@hollants.com> 439 440 Rename test case files to guarantee a meaningful execution order 441 442 (Git commit 4126fbba217b76babc9b41dba3038dcda5600ac7) 443 444* Fri May 16 23:41:43 2014 +0200 - Pieter Hollants <pieter@hollants.com> 445 446 Adapt test_netsnmptestenv.py to the snmpget() changes from 63414520 447 448 (Git commit bc4fff3aa72d19ef097c5d6ae740eb5f6fa92faa) 449 450* Fri May 16 23:28:16 2014 +0200 - Pieter Hollants <pieter@hollants.com> 451 452 Do not call net-snmp's shutdown_agent() anymore 453 454 Unfortunately, the situation is even worse than described in 9c6c5560 so 455 that we'll have to revert that change. Calling shutdown_agent() will 456 cause trouble if SNMP objects have been registered (double free()s). 457 458 (Git commit ea4796fadff7f7d3c2f3481e112423bdb0f0681e) 459 460* Fri May 16 23:07:07 2014 +0200 - Pieter Hollants <pieter@hollants.com> 461 462 Add first test cases for netsnmpagent SNMP objects (Unsigned32) 463 464 This first set of test cases tests 465 - SNMPGET on a read/write Unsigned32 object without initval returns 0 466 - SNMPSET of that object to 42 raises no exception 467 - SNMPGET on that object then returns 42 468 - SNMPGET on a Unsigned32 object with initval 0 returns 0 469 - SNMPGET on a Unsigned32 object with initval -1 returns 4294967295 470 - SNMPGET on a Unsigned32 object with initval 4294967295 returns 471 4294967295 472 - SNMPGET on a read-only Unsigned32 object without initval returns 0 473 - SNMPSET on that object raises a NotWritableError exception 474 475 (Git commit d8de7ee1f5ee38c0b8c602efa8bd0ae5d890e83b) 476 477* Fri May 16 22:24:59 2014 +0200 - Pieter Hollants <pieter@hollants.com> 478 479 netsnmptestenv: Add snmpset() method to set values 480 481 (Git commit f5323fe486cf907281084f5adacf9f205595a5f6) 482 483* Fri May 16 21:36:21 2014 +0200 - Pieter Hollants <pieter@hollants.com> 484 485 netsnmptestenv: Make snmpget() extract and return data and datatype 486 487 Calling functions will have no interest in extracting the data 488 themselves. 489 490 (Git commit 63414520f6278ff59d477cd35e312173828d6769) 491 492* Fri May 16 15:54:52 2014 +0200 - Pieter Hollants <pieter@hollants.com> 493 494 Update TEST-MIB.txt to offer OIDs for more diverse testing 495 496 (Git commit b3b2572ed91f7369cfa67f63fa34526a8f2af7e4) 497 498* Fri May 16 15:50:36 2014 +0200 - Pieter Hollants <pieter@hollants.com> 499 500 Re-import os and time once more in netsnmptestenv's shutdown() method 501 502 Especially "os" may have been __del__'d when shutdown() gets called a 503 second time by netsnmptestenv's own __del__() method. 504 505 (Git commit 10f1c011f13aedca2db48ba1f2807fe56fa66092) 506 507* Fri May 16 15:19:40 2014 +0200 - Pieter Hollants <pieter@hollants.com> 508 509 Use __file__ instead of sys.argv[0] to find path to TEST-MIB 510 511 If run through the "nosetests" script, sys.argv will be 512 /usr/bin/nosetests, not the path of test_netsnmpagent_init.py. We have to 513 use __file__ instead. 514 515 (Git commit 377dc15e5d2efbc7103e1dc0cb5a0ff7bc4a6dc2) 516 517* Fri May 16 15:10:53 2014 +0200 - Pieter Hollants <pieter@hollants.com> 518 519 Rename test_netsnmpagent.py to test_netsnmpagent_init.py 520 521 We can only test the init behavior of the netsnmpagent module in this 522 file as, among other things, we explicitly test that calling 523 agent.start() without registering any SNMP objects does not make them 524 available. So we can't at the same time register and test SNMP objects -- 525 calling shutdown() and instantiating a new netsnmpAgent instance wouldn't 526 work for the reasons laid down in 9c6c5560. 527 528 (Git commit f352558d5f57bc34abef297ec3f359fdac528c52) 529 530* Fri May 16 00:45:27 2014 +0200 - Pieter Hollants <pieter@hollants.com> 531 532 Add first test cases for netsnmpagent module itself 533 534 These test cases so far yet deal with rather low level issues of the 535 module only, such as the expected behavior after instance creation, 536 whether a connection to a master snmpd agent inside a net-snmp test 537 environment set up with the netsnmptestenv module could be successfully 538 established etc. 539 540 More important tests such as the behavior of the different types of SNMP 541 objects are yet to follow. For this reason, the included new TEST-MIB.txt 542 so far gets used only indirectly (to test when it becomes available to 543 the test environment's snmpd). 544 545 (Git commit 12a7097def7ddc3963a683b0dc0b873c19265ca3) 546 547* Thu May 15 20:47:30 2014 +0200 - Pieter Hollants <pieter@hollants.com> 548 549 Add test cases for snmpcmd() exceptions to test_netsnmptestenv.py 550 551 These test cases cover the changes done in 706ecb06. 552 553 (Git commit 931b27f2cdf3489ba94dd3f59e94b8c1d364e632) 554 555* Thu May 15 20:42:51 2014 +0200 - Pieter Hollants <pieter@hollants.com> 556 557 netsnmptestenv: Fix snmpcmd() error detection/exceptions 558 559 For one thing, we used re.match() to search for matches at the end of the 560 output, thus exceptions were never raid. Second, we only caught the case 561 where a MIB (and thus the OID) was basically known, but not available 562 (ie. because there was no subagent connected serving it) and reported it 563 with the wrong exception name. Third, we didn't catch the case when an 564 unknown OID was specified (eg. an unknown MIB or a known MIB but an 565 invalid OID within that MIB). 566 567 (Git commit 73f63d0b6d1168853525059b1ff650601f110734) 568 569* Thu May 15 19:29:38 2014 +0200 - Pieter Hollants <pieter@hollants.com> 570 571 Reorder imports in test_netsnmptestenv to be more logical 572 573 (Git commit 706ecb06e56b39758696bb11c1f338c32732b511) 574 575* Thu May 15 16:36:12 2014 +0200 - Pieter Hollants <pieter@hollants.com> 576 577 Use slightly more intelligent process killing in netsnmptestenv module 578 579 Instead of hammering the process to be killed with signals continously, 580 sleep small amounts of time and check procfs. This is obviously 581 Linux-specific, but so far I have not heard of anyone trying to use 582 python-netsnmpagent with net-snmp on different platforms. 583 584 (Git commit d638fe963a2372cfc4b9abcf2b72619a91079248) 585 586* Thu May 15 15:32:35 2014 +0200 - Pieter Hollants <pieter@hollants.com> 587 588 Add more tests for complete and clean shutdown() in 589 test_netsnmptestenv.py 590 591 Tests that 592 - check that the snmpd has really exited by killing it's remembered PID 593 - check that the tmpdir used by the testenv has been removed 594 595 (Git commit a97ef42a87633ad65c509b6006ef2e20176b74ca) 596 597* Thu May 15 15:28:38 2014 +0200 - Pieter Hollants <pieter@hollants.com> 598 599 Test that snmpget really fails again after netsnmptestenv shutdown 600 601 (Git commit 194d87f50a733e871ce9fd17a91ff141f3cd4558) 602 603* Thu May 15 15:26:06 2014 +0200 - Pieter Hollants <pieter@hollants.com> 604 605 Make use of nicer/more effective nose tools in test_netsnmptestenv.py 606 607 (Git commit a5aff2547ed35f4f062f685c208cbb8585b40526) 608 609* Thu May 15 15:15:05 2014 +0200 - Pieter Hollants <pieter@hollants.com> 610 611 Use @timed decorator to test the time test_netsnmptestenv functions use 612 613 (Git commit eecf982a941339416b6481829a40a16712342c90) 614 615* Thu May 15 15:12:37 2014 +0200 - Pieter Hollants <pieter@hollants.com> 616 617 Have test_netsnmptestenv.py also test shutdown(), not just call it 618 619 (Git commit a4ccbb60f93604122131e1652cbef0af33e5398a) 620 621* Thu May 15 15:09:49 2014 +0200 - Pieter Hollants <pieter@hollants.com> 622 623 Add docstrings to test cases in test_netsnmptestenv.py 624 625 (Git commit 8e73e9dc40f6306931d5cd7ffea3ed4bb7f53d5d) 626 627* Wed May 14 14:42:42 2014 +0200 - Pieter Hollants <pieter@hollants.com> 628 629 Use nose as testing framework 630 631 The advantages over unittest are quite well-known (eg. not having to 632 create test classes, test discovery etc.), so I won't elaborate in much 633 detail here. 634 635 (Git commit 66dad7b2493237e754547797619a801fe5a5ac1a) 636 637* Wed May 14 13:28:41 2014 +0200 - Pieter Hollants <pieter@hollants.com> 638 639 netsnmptestenv: Have snmpcmd() raise exceptions in timeout/"no such OID" 640 cases 641 642 The SNMP commands executed might hit a timeout (no running snmpd, wrong 643 community string etc.) or a "no such OID" condition (no subagent 644 running). These cases must be detectable by tests without having to check 645 the output. 646 647 (Git commit a0d17da836b6a5c84c187857fc5bd53bd81318e4) 648 649* Wed May 14 13:52:42 2014 +0200 - Pieter Hollants <pieter@hollants.com> 650 651 netsnmptestenv: Move shutdown()'s process killing into own function 652 653 Sooner or later our net-snmp test environment will consist of more than 654 snmpd (eg. snmptrapd), so it makes sense to generalize the process 655 killing. 656 657 (Git commit cb426775a957cfb1eaffb1fec684707909e82cf3) 658 659* Wed May 14 13:45:37 2014 +0200 - Pieter Hollants <pieter@hollants.com> 660 661 netsnmptestenv: Rename __del__ to shutdown 662 663 As done for netsnmpagent in e7d9144c and for the same reasons. 664 665 (Git commit 2b94e8c9359942eeff404f3b10a99ac92ca5290d) 666 667* Wed May 14 13:26:55 2014 +0200 - Pieter Hollants <pieter@hollants.com> 668 669 netsnmptestenv: Always strip() SNMP command's output immediately 670 671 (Git commit 38c3945dfeea2fd4545f77277a8d63ad6149ac11) 672 673* Wed May 14 13:19:41 2014 +0200 - Pieter Hollants <pieter@hollants.com> 674 675 netsnmptestenv: Explicitly remember used TCP ports in instance variables 676 677 This way test_netsnmptestenv.py can inspect in a future-safe manner 678 whether the net-snmp daemons are still running and occupy the TCP ports 679 or have exited properly. Currently the ports are still hard-coded but 680 might become dynamic in a future commit. 681 682 (Git commit 129778cc3b7fa165ce0f63f7487569822570b72e) 683 684* Fri May 2 01:22:20 2014 +0200 - Pieter Hollants <pieter@hollants.com> 685 686 netsnmpagent: Call net-snmp's shutdown_agent() in shutdown() method 687 688 Properly written agents should call shutdown_agent() in addition to 689 snmp_shutdown() as we did a init_agent() before the init_snmp() call. 690 691 Note: with ALL net-snmp versions up to and including the current 5.7.3 692 beta this will still NOT allow for proper cleanup in such a way that you 693 could 694 "del" the netsnmpAgent instance, create a new one and have that one 695 connect to the master agent successfully. Even with 5.7.x's code cleanups 696 and the subsequent removal of "#ifdef SHUTDOWN_AGENT_CLEANLY" in snmpd.c, 697 it still seems to be necessary to exit the process (or thread) and have 698 the OS do additional cleanup work if a substantially different 699 netsnmpAgent instance (eg. with a different MasterSocket) is to be 700 created. Unfortunately this also affects test cases where one wants to 701 run each test in a defined, clean and reproducible environment. 702 703 (Git commit 9c6c556005838f67232a0f70a6a299968713e31a) 704 705* Fri May 2 01:19:11 2014 +0200 - Pieter Hollants <pieter@hollants.com> 706 707 netsnmpagent: Rename __del__ to shutdown() 708 709 I ran into the common "In Python __del__ is no destructor" trap. The 710 cleanup code called there was possibly never executed at all. Rename the 711 method to 712 "shutdown" to give agents a chance to explicitly call it at their own 713 shutdown. 714 715 (Git commit e7d9144c87199fb5f245020c8c99b3a886fb8901) 716 717* Thu May 1 13:07:51 2014 +0200 - Pieter Hollants <pieter@hollants.com> 718 719 netsnmpapi: define netsnmp_init_mib() instead of unused init_mib() 720 721 In netsnmpapi we defined init_mib() but in netsnmpagent we called 722 netsnmp_init_mib() which was undefined in netsnmpapi. That didn't cause 723 trouble because a.) ctypes implicitly treated it as being "void 724 netsnmp_init_mib(void)" and b.) by coincidence that matched the function 725 signature. 726 727 The confusion stemmed from a function rename in the net-snmp project, see 728 https://www.mail-archive.com/net-snmp-coders%40lists.sourceforge.net/msg08417.html 729 730 (Git commit fa383b70495dac6977c83cc9857f5aa41c8ecc59) 731 732* Wed Apr 30 22:56:19 2014 +0200 - Pieter Hollants <pieter@hollants.com> 733 734 Add netsnmptestenv Python module 735 736 python-netsnmpagent needs test cases, integration tests with net-snmp to 737 be precise. These tests will need the same temporary net-snmp test 738 environments as the example agents, so it makes sense to unify such code 739 into a new Python module "netsnmptestenv". 740 741 Initially this module will be used by netsnmpagent tests, later on we'll 742 modify the example agents so that they can use it, too, obsoleting the 743 need for shell script wrappers. For this reason and because the example 744 agents end up in /usr/share/doc/packages/python-netsnmpagent/examples/ in 745 binary distributions, netsnmptestenv will be installed into the system 746 along with the two existing Python modules netsnmpapi and netsnmpagent. 747 748 For now, only one test environment can be created at the same time 749 because we hardcode the TCP ports used by net-snmp. We'll replace this 750 with random port assignment/port in-use detection code later. 751 752 And of course the new module gets test cases itself, too :-) 753 754 (Git commit 3a6a90f99aa3cca2a912a6fab6dfde59c8fc3acd) 755 756 757Changes from v0.5.2 to v0.5.3 758============================= 759 760* Mon Aug 29 23:06:24 2016 +0200 - Pieter Hollants <pieter@hollants.com> 761 762 Update README to give credit where credit is due 763 764 (Git commit de4d76adbc5e54f0ae4536e0a661eb466251484d) 765 766* Mon Aug 29 23:01:07 2016 +0200 - Pieter Hollants <pieter@hollants.com> 767 768 Trivial description fixes in SIMPLE-MIB.txt 769 770 (Git commit d2797ef699590b4601f584db3168c23e046b2b4e) 771 772* Fri Aug 19 08:53:19 2016 +0200 - Tobias Deiminger <tobias.deiminger@gmail.com> 773 774 Fixes for using IpAddress objects as table indices 775 776 This incorporates a number of fixes for using IpAddress objects as table 777 indices: 1. Add missing attributes to IpAddress class' __init__() method 778 2. Due to an unfixed Net-SNMP issue related to byte order (see 779 https://sourceforge.net/p/net-snmp/bugs/2136/), we have to pass 780 IpAddress values in host byte order when used as table indices and 781 in network byte order otherwise. 3. Improve string representation of 782 IpAddress in Table.value(). 783 784 Note: In IpAddress.cref() we don't store a reference to _cidx in "self". 785 This is only safe if _cidx is consumed by a Net-SNMP function that copies 786 the value (eg. snmp_varlist_add_variable). If it were used by Net-SNMP as 787 raw pointer, Pythons reference counting could delete the object while 788 Net-SNMP still wants to access it. 789 790 These changes have been tested on x86_64 (little endian) and mips64 (big 791 endian) architecture. 792 793 (Git commit d0941efe26cccd3adf48c337ada9b7eb1a78802b) 794 795 796Changes from v0.5.1 to v0.5.2 797============================= 798 799* Sat May 28 11:45:51 2016 +0200 - Pieter Hollants <pieter@hollants.com> 800 801 Bump copyright year 802 803 (Git commit d6edbe4db74c886bc6e69af7452982d143c9f186) 804 805* Sat May 28 11:35:53 2016 +0200 - Pieter Hollants <pieter@hollants.com> 806 807 Relicense under the Lesser GNU Public License (LGPL), version 3. 808 809 I've decided to relicense python-netsnmpagent under the LGPL instead of 810 the GPL to facilitate integration with LGPL-licensed as well as 811 proprietary software. Ie. using python-netsnmpagent in your proprietary 812 subagent does not mean that you have to license your subagent under 813 python-netsnmpagent's license as well. 814 815 (Git commit f815239c4d76d82d7c620ace1398240f49ad6f83) 816 817 818Changes from v0.5.0 to v0.5.1 819============================= 820 821* Wed May 27 14:00:30 2015 +0300 - Anton Todorov <a.todorov@storpool.com> 822 823 netsnmpagent: Fix Table's value() cutting off ASN_COUNTER64 table values 824 825 When returning a table row's data, we accessed ASN_COUNTER64 values via a 826 32-bit pointer, effectively cutting off the other 32 bits. Using the 827 "data" union's "counter64" pointer fixes this. 828 829 (Git commit 3863552a9b9b4d6ef3b1fe79d3659a42a4311b5f) 830 831* Fri Apr 17 10:47:54 2015 +0200 - Pieter Hollants <pieter@hollants.com> 832 833 Update README with extended credits 834 835 (Git commit 21fd9866f6b4ffedda5234e3d3fedfe46694a907) 836 837* Wed Apr 15 15:19:54 2015 +0300 - Anton Todorov <a.todorov@storpool.com> 838 839 Fix format string in threading_agent example's logging 840 841 Python 2.6 requires positional argument specifiers, omitting them only 842 works on Python 2.7 and later. 843 844 Cf. https://docs.python.org/2/library/string.html#formatstrings 845 846 (Git commit 5e3b6a01b149af160025c932ab91d39f6bb664e6) 847 848* Wed Apr 15 15:25:55 2015 +0300 - Anton Todorov <a.todorov@storpool.com> 849 850 examples/run_* scripts: Trap additional signals for cleanup 851 852 In some cases the tempdirs were left because we seem to have missed some 853 signals. 854 855 (Git commit 41efac1224b073e3dfbe892da943febbce8cd0ca) 856 857* Sun Mar 22 13:49:46 2015 +0100 - Pieter Hollants <pieter@hollants.com> 858 859 netsnmpagent: Drop special string handling in Table's init()/setRowCell() 860 861 Because of issues with strings inside tables, we used to implement some 862 special handling for (what we thought were) the trailing zero byte in C 863 strings in Table's init() and setRowCell() methods, passing size+1 to 864 netsnmp_set_row_column(). 865 866 However, while this seemed to work on older net-snmp versions, with newer 867 net-snmp versions we suddently had different issues, with irregular dot 868 chars appearing at the end of strings. 869 870 Turns out, we had a bug, but fixed it at the wrong place: right here, 871 passing size (not size+1) appears to be correct. a8181ddb fixes the real 872 culprit in Table's value() method. 873 874 (Git commit 84de336dbd3f27814c698659d8bc4c0106d2ce97) 875 876* Sun Mar 22 13:35:58 2015 +0100 - Pieter Hollants <pieter@hollants.com> 877 878 netsnmpagent: Make Table's value() method regard string lengths 879 880 When creating the dictionary returned by the Table class's value() 881 method, we so far assumed that the strings referenced through the "data" 882 field in netsnmp_table_data_set_storage structures would be zero 883 byte-terminated, as all C strings. However, this does not seem to be the 884 case, as eg. netsnmp_set_row_column() uses memcpy(), not strcpy(), ie. 885 when setting a string it is NOT zero byte-terminated. We thus need to 886 regard "data_len" when returning data to the Python world. 887 888 Strangely, this does not seem to be necessary with the simple scalar 889 types such as OctetString and DisplayString which are basically 890 ctypes.c_char_p objects as well... 891 892 (Git commit b70d6cd3cc9ecee55cdb4bed0a246d6782fa7c42) 893 894* Tue Nov 11 15:51:53 2014 +0100 - Pieter Hollants <pieter@hollants.com> 895 896 Just some small fixes to unify source code style 897 898 (Git commit 24e9b89cb5148f52ba032c5b5b13e1de05aecb15) 899 900* Thu Jul 31 16:10:34 2014 +0200 - Jacobo de Vera <devel@jacobodevera.com> 901 902 Rename as suggested in review 903 904 (Git commit ccc443fb68fd927ca235c5021716ec4aed158fc3) 905 906* Mon Jul 21 14:25:40 2014 +0200 - Jacobo de Vera <devel@jacobodevera.com> 907 908 Make the use of MIB files completely optional 909 910 (Git commit a760a4325512771da65f1c6030e9a17ee9ac1d84) 911 912* Mon Jun 1 22:31:45 2015 +0200 - Pieter Hollants <pieter@hollants.com> 913 914 Update README 915 916 (Git commit d3dfa854e79cbe7ae2c7c05a21c2aa9eed5e3877) 917 918* Fri May 16 23:28:16 2014 +0200 - Pieter Hollants <pieter@hollants.com> 919 920 Do not call net-snmp's shutdown_agent() anymore 921 922 Unfortunately, the situation is even worse than described in 9c6c5560 so 923 that we'll have to revert that change. Calling shutdown_agent() will 924 cause trouble if SNMP objects have been registered (double free()s). 925 926 (Git commit 9618ab334f56dbc1fd5d523862bb8355a2a72d8a) 927 928* Fri May 2 01:22:20 2014 +0200 - Pieter Hollants <pieter@hollants.com> 929 930 netsnmpagent: Call net-snmp's shutdown_agent() in shutdown() method 931 932 Properly written agents should call shutdown_agent() in addition to 933 snmp_shutdown() as we did a init_agent() before the init_snmp() call. 934 935 Note: with ALL net-snmp versions up to and including the current 5.7.3 936 beta this will still NOT allow for proper cleanup in such a way that you 937 could 938 "del" the netsnmpAgent instance, create a new one and have that one 939 connect to the master agent successfully. Even with 5.7.x's code cleanups 940 and the subsequent removal of "#ifdef SHUTDOWN_AGENT_CLEANLY" in snmpd.c, 941 it still seems to be necessary to exit the process (or thread) and have 942 the OS do additional cleanup work if a substantially different 943 netsnmpAgent instance (eg. with a different MasterSocket) is to be 944 created. Unfortunately this also affects test cases where one wants to 945 run each test in a defined, clean and reproducible environment. 946 947 (Git commit b579a0212f619d76b2e6d2ddbfa06db58f6db27a) 948 949* Fri May 2 01:19:11 2014 +0200 - Pieter Hollants <pieter@hollants.com> 950 951 netsnmpagent: Rename __del__ to shutdown() 952 953 I ran into the common "In Python __del__ is no destructor" trap. The 954 cleanup code called there was possibly never executed at all. Rename the 955 method to 956 "shutdown" to give agents a chance to explicitly call it at their own 957 shutdown. 958 959 (Git commit 7bfac319adc259394c117974a8b539fcc2c80170) 960 961* Thu May 1 13:07:51 2014 +0200 - Pieter Hollants <pieter@hollants.com> 962 963 netsnmpapi: define netsnmp_init_mib() instead of unused init_mib() 964 965 In netsnmpapi we defined init_mib() but in netsnmpagent we called 966 netsnmp_init_mib() which was undefined in netsnmpapi. That didn't cause 967 trouble because a.) ctypes implicitly treated it as being "void 968 netsnmp_init_mib(void)" and b.) by coincidence that matched the function 969 signature. 970 971 The confusion stemmed from a function rename in the net-snmp project, see 972 https://www.mail-archive.com/net-snmp-coders%40lists.sourceforge.net/msg08417.html 973 974 (Git commit 301a0e8a4b9f319dcf4ed63c9c90ee6064db64ba) 975 976* Sat Apr 19 11:24:05 2014 +0200 - Pieter Hollants <pieter@hollants.com> 977 978 Cosmetics 979 980 (Git commit 5845f8adc9b21d3497156b71e26ae120364c8a9f) 981 982* Fri Apr 18 14:20:24 2014 +0200 - Pieter Hollants <pieter@hollants.com> 983 984 Revert c77f52aaa and c20a48f89 (do not define __version__ ourselves) 985 986 c77f52aaa aimed at making a __version__ attribute available inside the 987 netsnmpagent module by using pkg_resources to retrieve our version 988 number. c20a48f89 consequently added a RPM spec file dependency on 989 python-setuptools. 990 991 This was clearly wrong, not only because it made running the examples 992 from within a git clone or a source distribution impossible until "make 993 install" got executed. It is just not the netsnmpagent module's job to 994 have any knowledge about its (externally assigned) version number. 995 Instead of using pkg_resources ourselves, production quality agents that 996 use our module can 997 (and should) use pkg_resources if they require a specific 998 python-netsnmpagent version. After all, they need a installed copy of 999 python-netsnmpagent anyway, so pkg_resources DOES know its version. This 1000 could look like this: 1001 1002 [...] 1003 1004 Finally, the example agents in the source distribution are always 1005 designed for the corrosponding version of the module, so no need to 1006 express explicit version requirements here that are implicit. 1007 1008 (Git commit 5715e77f2f8e792a0732b1934e9eebefc2e8ee6a) 1009 1010* Fri Apr 18 00:10:36 2014 +0200 - Pieter Hollants <pieter@hollants.com> 1011 1012 Fix indenting style in setup.py.in 1013 1014 Yes, one could discuss Tabs and Space usage and Tab size and the meaning 1015 of life and all, but for the time being the code style should at least be 1016 consistent. 1017 1018 (Git commit fd42a511844afb0b7c1cb47276b4be547c824508) 1019 1020* Sat Feb 22 14:32:22 2014 +0100 - Pieter Hollants <pieter@hollants.com> 1021 1022 Add slides from the FOSDEM 2014 lightning talk on python-netsnmpagent 1023 1024 (Git commit 7574563d5d86361032522299fef492277a6023d4) 1025 1026* Sun Feb 2 10:24:30 2014 +0100 - Daniele Sluijters <github@daenney.net> 1027 1028 setup: Add classifiers, link to Github repo. 1029 1030 (Git commit 0d6452e4fd57f5ad0e7caa3760117f9da121c1c5) 1031 1032 1033Changes from v0.4.6 to v0.5.0 1034============================= 1035 1036* Mon Oct 28 15:14:22 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1037 1038 Add RPM spec file dependency on python-setuptools 1039 1040 At least in SLES 11 SP2, the pkg_resources module is only available if 1041 the python-setuptools RPM has been installed. In newer openSUSE versions, 1042 installation python-distribute will satisfy this dependency as well. 1043 1044 (Git commit c20a48f8978fa4cfee9b0a3e0acc9e9ce8a4c705) 1045 1046* Mon Oct 28 14:33:01 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1047 1048 Fix Makefile's "install" target 1049 1050 (Git commit a8dad4a36c8358ccff92a38641bc5a5f8bd6db17) 1051 1052* Sun Oct 27 18:01:43 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1053 1054 Export module's version as obtained from setuptools to enable version 1055 checks 1056 1057 Seeing that python-netsnmpagent keeps gaining features in newer versions, 1058 I thought that it makes sense to make its version number available for 1059 version checks in agent code. Especially since some changes such as those 1060 to logging behavior in 61e9c4aa can not really be tested for. 1061 1062 (Git commit c77f52aaa00fa41352406f9410e61813eefc0183) 1063 1064* Sun Oct 27 17:44:06 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1065 1066 Distinguish connect failure between first attempt and reconnecting 1067 1068 On the one hand, it does not make sense to BOTH raise a 1069 netsnmpAgentException for connection failure that will undoubtedly be 1070 printed to stderr or logged in some kind of way by agents AND pass on 1071 net-snmp's "Warning" log message to be printed/logged as well. 1072 1073 On the other hand, we can not unconditionally intercept and surpress the 1074 "Warning" log message as there is not only the scenario of connection 1075 failure at startup but also when we got disconnected by the AgentX 1076 master. In the latter case we would get and print/log an "Info" log 1077 message that we were disconnected and net-snmp will retry in, say, 15 1078 seconds and another "Info" when we'd be connected again, but see no log 1079 message for ongoing connection failure. 1080 1081 Thus, this change reworks the netsnmpAgentStatus cases to move away from 1082 a generic DISCONNECTED status to two distinguished FIRSTCONNECT and 1083 RECONNECTING cases: the connection failure log message will be surpressed 1084 and an exception be raised in the FIRSTCONNECT state only. 1085 1086 And while we're at it, ECONNECT was inspired by <errno.h>, of course, but 1087 as I can't imagine other EWHATEVER conditions, I felt CONNECTFAILED to be 1088 a more self-explainatory name. 1089 1090 (Git commit 61e9c4aa81e583d8d21a1d6dbb71c70ac8da0f46) 1091 1092* Sun Oct 27 13:59:18 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1093 1094 Explicitly document the possible "msgprio" strings 1095 1096 As client code might opt to not just print/log the priority but apply 1097 filtering to it. 1098 1099 (Git commit b9ec11a51a7f89e5cde301a11514f55c2ed894d5) 1100 1101* Sun Oct 27 13:56:59 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1102 1103 Write out priority levels LOG_EMERG as "Emergency" and LOG_CRIT as 1104 "Critical" 1105 1106 Since we most probably write these to stderr or a logfile, they should be 1107 verbose and unambiguous enough for the user. 1108 1109 (Git commit 1fdcf5637cbab1c2ea548b9377edc7c548cdc24d) 1110 1111* Sun Oct 27 12:48:58 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1112 1113 Add support for custom log handlers 1114 1115 Change b68a9775 implemented detection of connection establishment and 1116 failure by accessing the log messages net-snmp generates. Log messages 1117 were still printed to stderr. 1118 1119 This change allows agents using python-netsnmpagent to define their own 1120 custom log handler function by setting the new "LogHandler" property when 1121 creating the "netsnmpAgent" object. The function will then be called 1122 whenever the net-snmp code generates a log message with two parameters: 1123 1. a string describing the message's priority 2. the text of the message 1124 itself 1125 1126 If "LogHandler" is None, error message will continue to be printed to 1127 stderr, as can be seen in simple_agent.py. Whereas threading_agent.py, 1128 being a step towards a more real-life agent, has been updated to use a 1129 custom "LogHandler" to integrate net-snmp messages in its output more 1130 nicely. 1131 1132 In your own agents, you will instead most likely define a custom log 1133 handler to write the messages to your agent's logfile. 1134 1135 (Git commit f14b919664b7418ed56e0cd3fdf86531501c7c64) 1136 1137* Fri Oct 25 18:31:58 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1138 1139 Support detecting connection establishment/failure 1140 1141 So far we just relied on net-snmp resp. its init_snmp() function to 1142 establish the AgentX connection to the master snmpd instance and neither 1143 knew nor cared about whether a connection could be established at all. A 1144 mistake in the 1145 "MasterSocket" option would only cause a warning on stderr, emitted by 1146 net-snmp itself, only. Likewise, indication of a successful connection 1147 was through log messages on stderr only, too. 1148 1149 This change introduces support for explicit detection of connection 1150 establishment and failure. To this end, the netsnmpAgent class' internal 1151 "_started" flag was replaced with a "_status" property that can take on 1152 the values defined in the new "netsnmpAgentStatus" enumeration. Your code 1153 should however NOT access this property -- just make sure to catch the 1154 new netsnmpAgentExceptions (implemented in the example agents in 1155 cd4ee23b). 1156 1157 The change is quite large due to the fact that net-snmp itself in neither 1158 the 5.4.x nor 5.7.x versions actually returns status information: 1159 init_snmp() is defined as "void", lending due to the fact that it will 1160 actually trigger a sequence of function calls including callback 1161 functions that return "void" themselves. Unfortunately there is also no 1162 dedicated callback mechanism for client code such as python-netsnmpagent 1163 that gets called on connection status changes. So we had to invent it on 1164 our own, using two callback functions as more or less ugly workarounds: a 1165 custom log handler and, for net-snmp 5.4.x support, another callback 1166 function that abuses a callback hook originally intended for different 1167 purposes. See the sources for details, they are well commented. 1168 1169 In this version, our custom log handler writes all log messages it 1170 receives to stderr, resembling previous behavior with the difference that 1171 we also log a message's priority level as defined by net-snmp, eg. 1172 "[Info] Foo.". 1173 1174 (Git commit b68a977562d3afa05d38044fd12e5e12390c8c64) 1175 1176* Thu Oct 24 18:05:54 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1177 1178 Add support for catching netsnmpAgentException in example agents 1179 1180 Up to now netsnmpAgent objects were created and their start() methods 1181 called without any error handling. But an upcoming change will introduce 1182 a new netsnmpAgentException that will be raised for error conditions, so 1183 the example agents need to know about them. 1184 1185 (Git commit 436d754db8afbc4e728e5903b155cdefa38ddb6e) 1186 1187* Thu Oct 24 15:17:01 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1188 1189 Explicitly advertise simple_agent.py's support for state dumping with 1190 SIGHUP 1191 1192 Sending simple_agent.py a SIGHUP signal causes its current variable state 1193 to be dumped again. This is worth a more explicit advertising at agent 1194 startup. 1195 1196 (Git commit 26f971fe48a50b629a5cad57a6f0a8f47811e20d) 1197 1198* Fri Oct 25 19:23:05 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1199 1200 Fix netsnmpagent.py's docstring (forgot a word) 1201 1202 (Git commit 5cdd84c153449781d17d92e6c38d41cec2a8550f) 1203 1204 1205Changes from v0.4.5 to v0.4.6 1206============================= 1207 1208* Thu Oct 17 22:02:12 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1209 1210 Advertise support for alternative AgentX transports more explicitly 1211 1212 We did already support alternative transports for the AgentX 1213 communication between subagents and master snmpd instances, that is, not 1214 just UNIX domain sockets but eg. also TCP ports. These are specified 1215 through transport specifications that follow the format described in the 1216 "LISTENING ADDRESSES" section in the snmpd(8) manpage. 1217 1218 This change modifies wording that would suggest we supported alternative 1219 UNIX domain socket paths only. It also adds a new script to run 1220 simple_agent.py against a snmpd instance over a TCP port, surprisingly 1221 named 1222 "run_simple_agent_over_tcpsocket.sh". 1223 1224 (Git commit 1cc011ee12ba78dab6eeec25890e15767c55ea07) 1225 1226* Thu Oct 17 21:43:50 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1227 1228 Move documentation on examples into own README in the examples directory 1229 1230 To put the information closer to where you would be looking for it. 1231 1232 (Git commit 3da5411e9cf7e9233d4ca0443dc1c529c94c0d7e) 1233 1234* Tue Oct 8 17:55:31 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1235 1236 Update README with new credits 1237 1238 (Git commit 3a0bd17d0934dd6620f30f177a286d821bfd51fc) 1239 1240* Tue Oct 8 17:53:52 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1241 1242 Update README with net-snmp compatibility remarks 1243 1244 (Git commit 9b4f81efc05c23f11f7689fcb7e71c39a9fcb4a9) 1245 1246* Tue Oct 8 17:42:05 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1247 1248 Use WATCHER_MAX_SIZE instead of WATCHER_SIZE_STRLEN for 5.4.x 1249 compatibility 1250 1251 We used to rely on net-snmp >= 5.5 behavior by setting a 1252 WATCHER_SIZE_STRLEN flag that didn't exist in net-snmp 5.4.x yet. For 1253 backwards compatibility we now use WATCHER_MAX_SIZE and update the used 1254 netsnmp_watcher_info structure's 1255 "data_size" field ourselves. 1256 1257 Reported by Max "mk23" Kalika <max.kalika+projects@gmail.com>. 1258 1259 (Git commit b15066fb9cd481c24ece736a68b2e22c2e483a67) 1260 1261* Tue Oct 8 17:27:35 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1262 1263 Fix comment added in 60d51c93 1264 1265 (Git commit 06fa1ded69269d5cc5798ec7f4057aacfa6c58b4) 1266 1267* Tue Oct 8 17:24:22 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1268 1269 Deref watcher before trying to its max_size property 1270 1271 The netsnmp_watcher_info structure returned by 1272 netsnmp_create_watcher_info is a pointer, so it must be de-referenced 1273 with ctypes' "contents" attribute before any of its properties can be 1274 set. 1275 1276 Reported by Max "mk23" Kalika <max.kalika+projects@gmail.com>. 1277 1278 (Git commit f2078fdabb022aeac48fd676433a0e381047c004) 1279 1280* Tue Oct 8 16:30:17 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1281 1282 Add missing netsnmp_watcher_info fields definition to netsnmpapi 1283 1284 Basically we do not need fields definitions for net-snmp structures that 1285 we never modify ourselves. However in this case we actually tried setting 1286 netsnmp_watcher_info's "max_size" field which resulted in a no-op. 1287 1288 Reported by Max "mk23" Kalika <max.kalika+projects@gmail.com>. 1289 1290 (Git commit 464d058c24008623fe7e6b4c0d9043fe19ac8151) 1291 1292* Tue Oct 8 16:21:52 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1293 1294 Explicitly comment why we set watcher_info struct's max_size manually 1295 1296 (Git commit 60d51c9324e1aae8964cb7d46cb1136e0e772d22) 1297 1298* Fri Jul 19 18:20:24 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1299 1300 Adapt the Makefile's srcdist and rpms targets to the new examples dir 1301 1302 (Git commit e96fd75fe905d2c922da4dacdf110082f50ba4bb) 1303 1304* Thu Jul 18 17:16:02 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1305 1306 Undo part of fa6e2d9723 (much longer string in simple_agent.py) 1307 1308 That line was intended for debugging only. 1309 1310 (Git commit e194a756b6ca368d0984b2bbea8e420dccb91f14) 1311 1312* Thu Jul 18 17:13:16 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1313 1314 Use local copy of netsnmpagent module for example agents 1315 1316 So you don't have to "make install" first. 1317 1318 (Git commit fa6e2d9723de724bf619713ad41097b79616d41b) 1319 1320* Wed Jul 17 23:41:31 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1321 1322 Fix more overseen references to "example" in run_simple_agent.sh 1323 1324 (Git commit 29f77605c12e839a755c122445789bc1f0706823) 1325 1326* Fri Jul 12 00:05:19 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1327 1328 simple_agent.py: Remove the caret that shouldn't be 1329 1330 Narf... 1331 1332 (Git commit 0e4aa6163a4555e846a0dc6b2a0221782a98d59f) 1333 1334* Fri Jul 12 00:01:55 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1335 1336 Fix overseen references to "example" that should be "simple" 1337 1338 Thanks to mjs7231 for reporting. 1339 1340 (Git commit 3cb813f430a6d3ba4b3f3508f8f7801957b777de) 1341 1342* Sun Jul 7 22:38:48 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1343 1344 Small update to the README 1345 1346 - Phrase missing API stability less dramatically 1347 - Add TODO of SNMP notifications/traps 1348 1349 (Git commit ca1f9ce7994a8db6a66efbd4729e8c814d6177f2) 1350 1351* Sun Jul 7 22:36:51 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1352 1353 New example threading_agent.py demonstrating asynchronous data updates 1354 1355 The default simple_agent.py always blocked until certain events occured, 1356 eg. SNMP requests had to be processed, and only updated its SNMP objects 1357 inbetween. Also SNMP requests couldn't be handled while data was in the 1358 process of being updated. Thus here's a more real life-usable example 1359 that outsources data updating into a separate thread. It does however not 1360 address possible locking issues. 1361 1362 (Git commit c8d08523d707a62d85205b5a0f0260340d38d9ea) 1363 1364* Sun Jul 7 20:03:43 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1365 1366 Non-functional improvements to the simple agent 1367 1368 simple_agent.py's heading comment block: 1369 - Add note on running the run_simple_agent.sh script 1370 - Add note on using sudo when starting the agent directly 1371 - Encourage user to use own <rosecret> instead of "public" 1372 1373 simple_agent.py's counters code: 1374 - Prettify sort order of code blocks 1375 - Explain initialization value 1376 - Document that increment() is a counter object's method more explicitly 1377 1378 run_simple_agent.sh: 1379 - Mention snmpget as well 1380 1381 (Git commit dff681469369bb61145d0a814e6921d507eec33c) 1382 1383* Sun Jul 7 14:59:13 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1384 1385 Rename example agent to simple agent 1386 1387 We're going to have other example agents in the examples/ subdirectory as 1388 well, therefore the name "example agent" would be ambiguous. The MIB and 1389 its contents have been renamed, too. 1390 1391 (Git commit 4fadc259ded94736bfd8dd665577fa5877d00faf) 1392 1393* Sun Jul 7 14:49:05 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1394 1395 Move example agent into new subdir examples/ 1396 1397 (Git commit 53f47da9ae4fe1a7b462e57ddb7b6e36abd72931) 1398 1399 1400Changes from v0.4.4 to v0.4.5 1401============================= 1402 1403* Mon Apr 29 15:05:26 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1404 1405 Makefile/RPM spec file: Cosmetics and smaller cleanups 1406 1407 (Git commit b3e7d35531f2f5c983798e15f237a18b59a5233b) 1408 1409* Mon Apr 29 12:57:57 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1410 1411 Use $@ instead of explicit filename references in ChangeLog Makefile 1412 target 1413 1414 (Git commit 01abbd6e525a8f05fd7bdc2881be8be750c6ef42) 1415 1416 1417Changes from v0.4.3 to v0.4.4 1418============================= 1419 1420* Sun Apr 28 00:51:19 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1421 1422 Use more accurate variable name $PKGREMAIL when building RPM spec file's 1423 %changelog section 1424 1425 The one who uses the .spec file is not necessarily the $AUTHOR of 1426 python-netsnmpagent. 1427 1428 (Git commit 1fc4d6c743dd5827592c594882d264a754753681) 1429 1430* Sun Apr 28 00:49:42 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1431 1432 Use C locale to generate dates for RPM spec file's %changelog section 1433 1434 RPM might otherwise complain about an "invalid date format" when building 1435 the package.. 1436 1437 (Git commit 3e2623d78cd326b1ec87a3d768e871c245b9a8e7) 1438 1439* Sat Apr 27 19:16:50 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1440 1441 Automatically generate %changelog section for RPM spec file 1442 1443 The spec file uses a different changelog style than the ChangeLog file, 1444 which would be too verbose for this purpose. Usually package maintainers 1445 note changes to the spec file itself here as well and often give a more 1446 high-level summary of changes of the software being packaged. Our 1447 automatically generated changelog will not be of the same quality as we 1448 only indicate the timestamps a version was tagged and an "Update to 1449 version x.y.z"-style message. But until now we didn't use the ChangeLog 1450 section at all. And package maintainers can still replace it with a more 1451 detailed, manually maintained version. 1452 1453 (Git commit e4a21d8fe50e1a86c558101a5f5e1e55015c58e8) 1454 1455* Sat Apr 27 16:37:25 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1456 1457 Collect RPMs built in dist/ and clean up RPM build dirs 1458 1459 (Git commit d184c128c339846fe2188f36fc94b338745b31d1) 1460 1461* Sat Apr 27 16:34:41 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1462 1463 Generate RPM spec file along with source distribution archive 1464 1465 Utility of the spec file is increased if it has python-netsnmpagent's 1466 version number already specified -- the old way of requiring a RPM 1467 "--define" only worked when the Git repo was available. Now one can take 1468 the generated dist/python-netsnmpagent.spec along with the source archive 1469 and simply copy it some build host and build. 1470 1471 (Git commit 5a8f0e5afa12e1bb67df45531dd51b47ab33935c) 1472 1473 1474Changes from v0.4.2 to v0.4.3 1475============================= 1476 1477* Wed Apr 24 11:57:29 2013 +0200 - Pieter Hollants <pieter@hollants.com> 1478 1479 Clear counter variable also when a Table object is cleared 1480 1481 (Git commit b4e19f42fa587e135c74785a39090df7a7c7bf83) 1482 1483 1484Changes from v0.4.1 to v0.4.2 1485============================= 1486 1487* Tue Mar 26 19:16:13 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1488 1489 Fix specfile so it builds on SLES11 and SLES11SP1, too 1490 1491 (Git commit 8e186e646b6fb8cfe53882b930f3a3a5b028f138) 1492 1493 1494Changes from v0.4 to v0.4.1 1495=========================== 1496 1497* Tue Mar 26 15:55:24 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1498 1499 Fixes to the spec file so it builds for openSUSE, SLES11 and RHEL6 1500 1501 (Git commit b1b1cfe4b746b32142c36fd159b2bbabe0454d18) 1502 1503 1504Changes from v0.3 to v0.4 1505========================= 1506 1507* Sat Mar 23 14:30:04 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1508 1509 Add missing prototypes for init_mib() and 1510 netsnmp_table_dataset_remove_and_delete_row() 1511 1512 (Git commit 5c4618526f4def25479503853a67c77d72dfc8ae) 1513 1514* Sat Mar 23 14:16:47 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1515 1516 Add prototype for netsnmp_table_dataset_remove_and_delete_row 1517 1518 (Git commit 8ec11c314dde071ad073dd8ae08c5b67883b2298) 1519 1520* Sat Mar 23 14:15:23 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1521 1522 Abstract netsnmp_table_dataset_remove_and_delete_row from actual library 1523 as well 1524 1525 Another function that used to be in libnetsnmphelpers in net-snmp <5.6 1526 and now is part of libnetsnmpagent. 1527 1528 (Git commit c068cace7f3aba096705cdc923ca99442bfb1e4e) 1529 1530* Tue Mar 5 23:30:31 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1531 1532 Update README to reflect commit activity 1533 1534 This is more and more getting fun :-) 1535 1536 (Git commit a6777f189618f413c991d456fb27fe4ba8fbdbb1) 1537 1538* Tue Mar 5 23:29:38 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1539 1540 Formatting for consistent code style 1541 1542 (Git commit 92385a159bc7249c0c508fc068292b088c652541) 1543 1544* Tue Mar 5 22:03:37 2013 +0000 - Steven Hiscocks <steven@hiscocks.me.uk> 1545 1546 Add increment method to asntypes COUNTER and COUNTER64 1547 1548 (Git commit 7d3d7058c01d09086b8ecc85f443cd709f1b1ec3) 1549 1550* Wed Feb 27 00:50:56 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1551 1552 Fix ChangeLog generation for the case when we're on a tag 1553 1554 The mechanism erroneously tried to generate a changelog "between vX.Y and 1555 vX.Y" when we're on that very tag. 1556 1557 (Git commit da08641c0ccfe1b43038f3bd840bbc3b2d5253f5) 1558 1559* Wed Feb 27 00:46:13 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1560 1561 Include documentation and example files in built RPM 1562 1563 Seeing that the module will be installed on many plattforms in form of an 1564 RPM, it is wise to have the documentation files and also the example 1565 agent and its files included. 1566 1567 (Git commit ccf0a05b60ae7a4efa7468e1a3ae7fd2b7cb00ed) 1568 1569* Tue Mar 5 18:21:15 2013 +0000 - Steven Hiscocks <steven@hiscocks.me.uk> 1570 1571 Add optional argument to check_and_process as to whether to block 1572 1573 (Git commit eb2d9b8822a4aed6bf10be55b510429049c94122) 1574 1575 1576Changes from v0.2 to v0.3 1577========================= 1578 1579* Wed Feb 27 00:50:56 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1580 1581 Fix ChangeLog generation for the case when we're on a tag 1582 1583 The mechanism erroneously tried to generate a changelog "between vX.Y and 1584 vX.Y" when we're on that very tag. 1585 1586 (Git commit 78ebb0940c6de00a008e2e2321e9bcf362a90514) 1587 1588* Wed Feb 27 00:46:13 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1589 1590 Include documentation and example files in built RPM 1591 1592 Seeing that the module will be installed on many plattforms in form of an 1593 RPM, it is wise to have the documentation files and also the example 1594 agent and its files included. 1595 1596 (Git commit c3c9456cd330c99f6bcc6d69c7e1ad0c433fd4a1) 1597 1598* Tue Feb 26 11:51:08 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1599 1600 Automatically generate ChangeLog from git commits 1601 1602 We now have a ChangeLog automatically generated from the Git history, so 1603 users who do not follow the proceedings in the Git repository itself can 1604 see what has changed between each version. The ChangeLog is built 1605 whenever a source distribution archive is generated. It can also be 1606 explicitly built by using "make ChangeLog". 1607 1608 (Git commit c54fc95c4f7ba3f26c776871d418df54abe704d7) 1609 1610* Tue Feb 26 11:33:39 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1611 1612 Add MANIFEST.in file so source distributions include necessary files 1613 1614 distutils by default expects LICENSE.txt, not LICENSE. It also needs to 1615 be explicitly told about our example agent and associated files. 1616 1617 (Git commit b394bdeaf55c2ad5903c3fbd90409cd2017780bf) 1618 1619* Mon Feb 25 20:30:20 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1620 1621 Replace hardcoded version number with latest Git tag 1622 1623 With this change, the version number is no longer hard-coded inside 1624 setup.py. Instead, the version number is derived from the latest git tag 1625 using "git describe". The Makefile (which is now more than a pure 1626 convenience Makefile) will generate setup.py from setup.py.in 1627 (which has been renamed accordingly), so that a source distribution 1628 (.tar.gz) will have the correct version number inside. 1629 1630 As a special rule, whenever the Git checkout is not at a tag, "git 1631 describe" will generate a string similar to "0.2-21-g0e10fca", indicating 1632 that there have been 21 commits since the last tag "0.2" and the latest 1633 commit is g0e10fca. We translate this to "0.2_next21_g0e10fca" so a.) RPM 1634 does not complain about the dashes (it doesn't allow them in its 1635 "Version" field) and b.) the "next" indicates that this is a forthcoming 1636 version. 1637 1638 (Git commit 7e920bb4e372f29cc3e0167224689e15bed14104) 1639 1640* Mon Feb 25 18:52:22 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1641 1642 API change: swap "oidstr" and "initval" arguments for scalar variables 1643 1644 The function signature for create_vartype_class() has changed and as such 1645 the constructor method signature for all classes using the @VarTypeClass 1646 decorator, that is, all classes representing SNMP scalar variables, eg. 1647 Integer32(), Unsigned32() etc. "initval" now comes first so that in 1648 scenarios where we just a SNMP variable without the intent of registering 1649 it we can simply write 1650 1651 agent.Integer32(20) 1652 1653 instead of 1654 1655 agent.Integer32(initval=20) 1656 1657 which, of course, implies "oidstr" == None. The former construct is of 1658 much more use when being interpreted as "initval" instead of "oidstr" as 1659 in 1660 1661 agent.Integer32("EXAMPLE-MIB::exampleInteger32") 1662 1663 which continues requiring an "oidstr=" prefix to work. 1664 1665 This means that if you have already written agents using 1666 python-netsnmpagent and you did not follow the style in example_agent.py 1667 with explicit "initval=" and "oidstr=" qualifiers, you WILL have to adapt 1668 your code. 1669 1670 (Git commit 0e10fca0ce6c34cd6730d3fc73158fe40386e14d) 1671 1672* Mon Feb 25 18:51:50 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1673 1674 Fix typo in README (SNMP contents, eh?...) 1675 1676 (Git commit 77dce9d7c43fe2ad68fcdd44917f0e2af73ce56f) 1677 1678* Fri Feb 22 19:58:43 2013 +0000 - Steven Hiscocks <steven@hiscocks.me.uk> 1679 1680 Fix counter64 incorrectly setting low and high in c structure 1681 1682 (Git commit 809193cb1d4549f9849164aa7126972894b99e76) 1683 1684* Fri Feb 22 18:18:48 2013 +0000 - Steven Hiscocks <steven@hiscocks.me.uk> 1685 1686 Handle wrap of 32bit and 64bit counters 1687 1688 (Git commit 9a2c4430e8011bdd6f2662bef90d63909c6d8003) 1689 1690* Fri Feb 22 14:06:47 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1691 1692 Distinguish libraries when errors in library loading occur 1693 1694 (Git commit 5c61efa9ef337641bfd26dc98e8600a8afba74d4) 1695 1696* Fri Feb 22 13:54:16 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1697 1698 Update README with credits 1699 1700 (Git commit 7b5fd128712073343a5c69025c6972dde53f1e02) 1701 1702* Fri Feb 22 13:52:43 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1703 1704 Fix example agent's working with SNMP contexts 1705 1706 (Git commit 1d9b0bbc92f02d99c86b2106c5a00598250ba73e) 1707 1708* Fri Feb 22 13:12:04 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1709 1710 Abstract certain functions from actual library for compatibility with 1711 net-snmp <5.6 1712 1713 From net-snmp 5.5 to 5.6, all code from libnetsnmphelpers.so got 1714 integrated into libnetsnmpagent.so. While this doesn't break C programs 1715 since ld-linux.so will take care of dynamically resolving referenced 1716 symbols, with ctypes all prototype definitions and functions calls always 1717 depend on a particular libX handle. 1718 1719 Therefore we now test using netsnmp_create_watcher_info whether that 1720 function is available in libnetsnmpagent and fall back to 1721 libnetsnmphelpers otherwise. The remaining code now uses libnsX to 1722 abstract from the actual library used. 1723 1724 (Git commit 7f8ec59e26cd2ada809410b053d29a59f0efb3e3) 1725 1726* Fri Feb 22 13:05:03 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1727 1728 Make comment about net-snmp 5.4.x workaround more verbose 1729 1730 (Git commit d9388eeae15119ff4c5bd3e87578e4ff83b682e3) 1731 1732* Fri Feb 22 12:15:51 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1733 1734 Work around unresolved dependencies bug in net-snmp 5.4.x libraries 1735 1736 (Git commit 792977b5657e200a13794257bd12622b8d127021) 1737 1738* Thu Feb 21 23:43:24 2013 +0000 - Steven Hiscocks <steven@hiscocks.me.uk> 1739 1740 Added context argument to getRegistered and getContexts method 1741 1742 (Git commit 830835b82bb7b976d8e57a28b2e0cbb1157aa2ff) 1743 1744* Fri Feb 15 13:37:45 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1745 1746 Throw out SuSE-specific python macros from RPM specfile 1747 1748 First of all, this module is noarch by definition. Second, SuSE macros 1749 won't be available on RHEL et al. 1750 1751 (Git commit 9c0409d27624decaa309c998e56787f45ae29b51) 1752 1753* Fri Feb 15 13:20:50 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1754 1755 Create BUILD directory during RPM build (required for SLES11SP2) 1756 1757 (Git commit 6e66f11ff16e44ae686803980f00bf9121a60f78) 1758 1759* Thu Feb 14 10:42:48 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1760 1761 Initialize variable so we can detect missing snmpd correctly 1762 1763 (Git commit 53960d8547fdb648c86e5948a2a4db27d2470394) 1764 1765* Sun Feb 10 12:00:37 2013 +0000 - Steven Hiscocks <steven@hiscocks.me.uk> 1766 1767 Added ability to set context name for SNMP variables 1768 1769 (Git commit ef457b1ea98cdf1a09bfaf705d7f7b5c6f7a6ffd) 1770 1771* Mon Jan 21 14:41:16 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1772 1773 Rename "PersistentDir" option to "PersistenceDir" and streamline options 1774 in example agent 1775 1776 (Git commit fe0d6b44964b8973f0dc0dc6f6b723d5630b3557) 1777 1778* Mon Jan 21 13:33:29 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1779 1780 Bump year in copyright notices 1781 1782 (Git commit f3d99ec7b4c36f145cfcc28cbf3bc5d163462f64) 1783 1784* Mon Jan 21 12:14:28 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1785 1786 Fix Makefile targets and RPM building 1787 1788 (Git commit 8b25ca9ced0997626a6eb25851c209e4e0f479b7) 1789 1790 1791Changes from v0.1.1 to v0.2 1792=========================== 1793 1794* Mon Jan 21 12:13:06 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1795 1796 Increase version number to 0.2 1797 1798 (Git commit 1ba10cab7be6389d65c208df7a5c52c0bebb4f51) 1799 1800* Mon Jan 21 12:12:32 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1801 1802 Add local .spec file and Makefile target for RPM building 1803 1804 (Git commit 116f4b4a9f184764bf3fea0dfc8cc4b9c2b6d668) 1805 1806* Mon Jan 21 11:02:06 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1807 1808 Synchronize Makefile style with my other projects 1809 1810 (Git commit 446a70cfa71457b463d70e834241600f58e9965c) 1811 1812* Mon Jan 21 10:55:49 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1813 1814 Fix cleanup of *.pyc files 1815 1816 (Git commit fc66e3ef6ba1b0374c81d9060cfa8a8bd47cee4d) 1817 1818* Mon Jan 21 10:30:10 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1819 1820 Remove duplicate error handling statements 1821 1822 set -e = set -o errexit 1823 1824 (Git commit cde7b4908fca46ade88eed199d0d9f05c06d7a4d) 1825 1826* Mon Jan 21 10:29:39 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1827 1828 Synchronize heading comment block style with my other projects 1829 1830 (Git commit 32045ecd31ef39accdebaa46d0b620b82fe61e1e) 1831 1832* Fri Jan 18 18:49:36 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1833 1834 Add missing .0 index for scalar variables 1835 1836 Scalar variables must be registered with register_watched_scalar(), which 1837 automatically adds the ".0" suffix required by the SNMP standards. 1838 1839 (Git commit 0dedf78627ccd9fd6f32361dd1fc82150e5b6a20) 1840 1841* Wed Jan 16 14:13:50 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1842 1843 Add a function to clear the table (ie. remove all table rows) 1844 1845 (Git commit fc2ba0976ec85bc92cd29c71abd348976270d7d8) 1846 1847* Mon Jan 14 14:39:25 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1848 1849 Support auto-update of row counter variable for tables 1850 1851 A SNMP variable of an integer type can be created and passed in to the 1852 Table() constructor in the "counterobj" property. netsnmpagent will then 1853 auto-increase this variable's value whenever a new row is added with 1854 addRow(). Naturally the variable should be exposed read-only. 1855 1856 (Git commit f607142140200a0acb16bb442332e8d3013fd74c) 1857 1858* Mon Jan 14 14:38:27 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1859 1860 Make the return value of integer variables types ordinary integers unless 1861 absolutely necessary 1862 1863 (Git commit 8489ea8998b653af3f6df3367f4aa59ca9c38ddb) 1864 1865* Mon Jan 14 14:13:43 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1866 1867 Rename poll() to check_and_process() for consistency with net-snmp API 1868 1869 The name "poll" wasn't really intuitive, anyway. 1870 1871 (Git commit f2558fee86bd1711893f93f429bb6ea642d21dfb) 1872 1873* Fri Jan 11 14:54:57 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1874 1875 Update README 1876 1877 (Git commit a2ae83446fb90d2d50080ac2d6f9b1a30bf41940) 1878 1879* Fri Jan 11 14:50:53 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1880 1881 Make Makefile clean up *.pyc files as well 1882 1883 (Git commit 7f9763d3cc835c56005a204f3a6c3ac4946a2a04) 1884 1885* Fri Jan 11 14:49:36 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1886 1887 Correct dist target in convenience Makefile 1888 1889 (Git commit 49524931c09337b0d8bc279d20e480d46e4421a9) 1890 1891* Fri Jan 11 13:44:03 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1892 1893 Add dist directory generated by distutils to .gitignore 1894 1895 (Git commit 1e6610b72a81fc291cb7e9e52d69e660cb919ac7) 1896 1897* Fri Jan 11 13:43:41 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1898 1899 Add MANIFEST generated by distutils to .gitignore 1900 1901 (Git commit 8e21655794de6f466b3d7152ae70903a12d4ad04) 1902 1903 1904Initial version 0.1.1 1905===================== 1906 1907* Fri Jan 11 13:36:35 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1908 1909 Bump version number to 0.1.1 1910 1911 (Git commit 34158a2751b42764559930a03e6e4a1328f03709) 1912 1913* Fri Jan 11 13:35:43 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1914 1915 Modify License specification to conform with openSUSE guidelines 1916 1917 (Git commit 87f978986c9e466cae82e9bb6c4e2231c27888f0) 1918 1919* Fri Jan 11 13:34:30 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1920 1921 Remove the she-bang from netsnmpagent.py and netsnmpapi.py 1922 1923 These are Python modules not supposed to be called directly. 1924 1925 (Git commit 2a482be4b5f2b4b58867660f20f98e13086ac020) 1926 1927* Fri Jan 11 13:26:10 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1928 1929 Clean up dist directory as well 1930 1931 (Git commit b0ea63d4658eeca4a69051e5cae63678e2af6024) 1932 1933* Fri Jan 11 11:22:02 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1934 1935 Add convenience Makefile 1936 1937 (Git commit d0ac759c8f1bee0dbf5044023d1b1fd526e59189) 1938 1939* Fri Jan 11 11:21:16 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1940 1941 Remove python- prefix from package name 1942 1943 (Git commit 8f4fb7377abf39669245506d3b0020e7bfffdee8) 1944 1945* Thu Jan 10 17:19:10 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1946 1947 Update README 1948 1949 (Git commit 37be34d9cf4cd95ae08c084c9b0c91dd8aa9b202) 1950 1951* Thu Jan 10 17:08:42 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1952 1953 Add distutils-style setup.py script 1954 1955 (Git commit b8f015747f6bcd9413bd1094e9dd88628825e011) 1956 1957* Thu Jan 10 16:50:39 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1958 1959 Add own class for IpAddress to offer more natural Python interface 1960 1961 IP addresses are stored as unsigned integers, but the Python interface 1962 should use strings so that IP addresses can be given in their natural 1963 form, ie. 127.0.0.1. 1964 1965 (Git commit 86cc5a3bed54991eafa171becf30175c1efb451f) 1966 1967* Thu Jan 10 15:42:54 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1968 1969 Make Table value() method return integer-style values for integers, not 1970 strings 1971 1972 (Git commit 0419cb46d68ab0358babb5af2fbcfed87947fe7c) 1973 1974* Thu Jan 10 15:36:27 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1975 1976 Let pprint module do the variable dumping in example agent 1977 1978 (Git commit 6af9e9677e243e7601fba0a6e3ac0c40607e83d9) 1979 1980* Thu Jan 10 15:23:54 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1981 1982 Improve Table value() output 1983 1984 Row indices were returned incorrectly. Also make the returned object a 1985 dictionary containing dictionaries that match the value() output for 1986 Integer32 etc. 1987 1988 (Git commit db79e071de38623ef4acb01e96fdf7293ed526cd) 1989 1990* Thu Jan 10 15:22:24 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1991 1992 Of course one should use existing data types first... 1993 1994 (Git commit c0fab40bb4c934fada5821c9952e9113274f70d2) 1995 1996* Thu Jan 10 15:21:03 2013 +0100 - Pieter Hollants <pieter@hollants.com> 1997 1998 Add a second example table to demonstrate different index types 1999 2000 (Git commit 628cb7b9a5d4dce83e9938806b28947a2dc62380) 2001 2002* Thu Jan 10 15:09:08 2013 +0100 - Pieter Hollants <pieter@hollants.com> 2003 2004 Cosmetics in example agent's DumpRegistered() output 2005 2006 (Git commit 305d0240414f8e3b8dac35b9132a8ce5e5cc68e5) 2007 2008* Mon Jan 7 11:51:38 2013 +0100 - Pieter Hollants <pieter@hollants.com> 2009 2010 Make run_example_agent.sh find snmpd within /usr/local as well 2011 2012 (Git commit a5cbdc7bde9a5f323cb28c4678efd78cced77ce1) 2013 2014* Fri Jan 4 14:54:35 2013 +0100 - Pieter Hollants <pieter@hollants.com> 2015 2016 Cosmetics 2017 2018 (Git commit b5eb7c4bdca5957f1e863953730541a2060a79ed) 2019 2020* Fri Jan 4 14:49:39 2013 +0100 - Pieter Hollants <pieter@hollants.com> 2021 2022 Add first implementation of value() method for tables 2023 2024 (Git commit 2e204946984db2b3ad65b662229d82e4e84b955e) 2025 2026* Fri Jan 4 14:47:09 2013 +0100 - Pieter Hollants <pieter@hollants.com> 2027 2028 Add more error handling for netsnmp_ds_set_* calls 2029 2030 (Git commit 7e6f8eddfb8b71f2d60690136df0b52a709e7a62) 2031 2032* Thu Jan 3 16:18:31 2013 +0100 - Pieter Hollants <pieter@hollants.com> 2033 2034 Add support for Counter64 data type 2035 2036 This one requires actually some help since inheriting from 2037 ctypes.Structure alone does not work. net-snmp uses a C structure of two 2038 long variables internally to store the Counter64 value, so we need to 2039 provide wrapper functions for that. 2040 2041 (Git commit a49b3a6a60e54aa632fca390a3d3afe16534adfd) 2042 2043* Wed Dec 26 15:08:18 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2044 2045 Update README 2046 2047 (Git commit cca2b90091e1bbf533c7a6cb34d6dbeacef24e74) 2048 2049* Wed Dec 26 14:58:45 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2050 2051 Fix typos in README 2052 2053 (Git commit f515bafa980673a3353308c2dc69402bcbf49157) 2054 2055* Wed Dec 26 14:46:25 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2056 2057 First implementation of table support 2058 2059 Among the existing scalar variables, netsnmpagent now supports SNMP 2060 tables. Table objects are defined in terms of the types of the row 2061 indexes, the number of columns, their types and their default row values 2062 and whether they are extendable or not (ie. whether new rows can be added 2063 through snmpset). After creation (and registration), rows can be added 2064 and individual cell contents set. 2065 2066 This implementation does not support the value() method for tables yet. 2067 2068 (Git commit e3c2b42e344544145b2e1335d12327247bf03544) 2069 2070* Wed Dec 26 14:40:47 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2071 2072 Use a string index type for the exampleTable 2073 2074 In preparation for the upcoming table support, the index type for 2075 exampleTable (exampleTableIndex) was changed to a string type since it'll 2076 make for a more advanced example than an integer type. 2077 2078 (Git commit f696b7fe11e60345130b5e53068c3206691f8c01) 2079 2080* Wed Dec 26 00:07:04 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2081 2082 Move net-snmp API stuff into own file and define C function prototypes 2083 2084 Everything ctypes and libnetsnmpagent-related has been moved into the new 2085 file netsnmpapi.py that gets imported by netsnmpagent.py. All netsnmp 2086 functions called are now also defined in terms of argument and result 2087 types, similar to C prototypes. To achieve this, the libnetsnmpagent 2088 handle is now defined globally instead of being part of the netsnmpAgent 2089 class. 2090 2091 (Git commit f9114e0cc22665afd37abf224ab9f10861e5c03e) 2092 2093* Sun Dec 23 22:34:06 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2094 2095 Add DISPLAY-HINT for exampleOctetString so UTF-8 encoded strings can be 2096 set properly 2097 2098 (Git commit 44713eb7aba8a80a5747d73775bd427e64a3bd61) 2099 2100* Sun Dec 23 22:27:21 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2101 2102 Correct max_size calculation for scalar SNMP objects 2103 2104 (Git commit 77b9fb048e2ed477b654475247f952acdef6b439) 2105 2106* Sun Dec 23 22:24:03 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2107 2108 Cosmetical optimization of SNMP object's cref() method 2109 2110 (Git commit a25799afe631c2689e775e7c167263a69a7b6a2f) 2111 2112* Sun Dec 23 22:20:59 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2113 2114 Reunify SNMP object creation and registration again 2115 2116 It turned out to be unnecessarily complex to maintain consistency with 2117 the seperation of SNMP object creation and registration as introduced in 2118 0f7a4cdbf4677ebae52e0abee2acacd148c50491. Yet, that change is not 2119 literally undone: 2120 - Registration of an SNMP object must now be specified at object creation 2121 time by passing an "oidstr", if desired. If left off, the return object 2122 will remain unbound to the MIB and can be used mostly for object property 2123 inspection. As a consequence, register() was removed again. The new 2124 "writable" parameter to the object's creation method replaces 2125 register()'s "allow_set". 2126 - Previously, objects were created and if register() was called on them, 2127 it called a defined callback method. Now, the object's creation method 2128 calls the renamed _prepareRegistration() method instead and incorporates 2129 _registerWatcher() functionality. 2130 - The variable type's props array no longer needs a "register_func" 2131 member. 2132 2133 (Git commit cb0bb0d44eb4be5c6f9e98920f269020bae2e145) 2134 2135* Sun Dec 23 21:48:05 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2136 2137 Improve comment for DisplayString method 2138 2139 (Git commit 5a85195fa56046f50d1114ba2ef5ab5e537b6fb7) 2140 2141* Sun Dec 23 21:39:38 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2142 2143 example_agent.py cosmetics: move agent.start() call before handler 2144 definition 2145 2146 (Git commit 5270e9653eaa5fcc002429b4402aa1fbe197d1c5) 2147 2148* Sun Dec 23 21:28:14 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2149 2150 Add Python shebangs for netsnmpagent.py and example_agent.py 2151 2152 (Git commit 7172cd2edc3aa38be50c5f4c4fe689ae1d4d8031) 2153 2154* Thu Dec 20 12:22:32 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2155 2156 Fix wrong table column number in EXAMPLE-MIB.txt 2157 2158 (Git commit f12e5c9ff298493ffab58a27f9702485a4b6e4e1) 2159 2160* Tue Dec 18 14:50:00 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2161 2162 Generalize for SNMP tables, separate SNMP object creation and 2163 registration 2164 2165 This change generalizes netsnmpagent in that we now deal with "SNMP 2166 objects" instead of just SNMP variables. This is in preparation of the 2167 upcoming support of SNMP tables. 2168 2169 Because of the semantics associated with how we will wrap tables, SNMP 2170 object creation and registration under a certain OID are now separate 2171 tasks. SNMP objects now must be explicitly registered (see 2172 example_agent.py). 2173 2174 Further details of the changes: 2175 - Because registering a certain SNMP object is object-dependent, the 2176 VarTypeClass() decorator now expects a new member "register_func" that 2177 specifies the callback function that will be called by the new generic 2178 register() method. 2179 - register() incorporates the former oidstr2oid() method 2180 - The VarTypeClass() decorator's variable registration code went into 2181 register() and the new callback function _registerWatcher() as well. 2182 - Variable type class instances now possess most of the atttributes from 2183 their props[] array such as "asntype" and "flags" 2184 - _data_size and _max_size were not always set correctly 2185 - Variable type class instances now possess a new cref() method which 2186 always returns the correct pointer to the enclosed _cvar, depending on 2187 the variable type 2188 2189 (Git commit 0f7a4cdbf4677ebae52e0abee2acacd148c50491) 2190 2191* Wed Nov 28 13:30:04 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2192 2193 Add run_example_agent.sh script to make running example_agent.py easier 2194 2195 example_agent.py has now learned two command line options: 2196 -m/--master-socket allows specifying the Unix domain socket that 2197 python-netsnmpagent will use to connect to the master snmpd agent and 2198 speak AgentX. -p/--persistent-dir is passed on the net-snmp library and 2199 sets the directory the library will use to store persistance information. 2200 2201 Both parameters are used by the new run_example_agent.sh script to be 2202 able to setup a net-snmp instance running under the current user and 2203 independent from a eventually running system-level snmpd service. They 2204 will also be used by upcoming automatic tests. 2205 2206 run_example_agent takes care of 2207 - creating a temporary directory 2208 - creating a minimal snmpd configuration that especially places all 2209 system file/directory references into the temporary directory instead 2210 - running snmpd with additional necessary parameters 2211 - giving the user guidance as to the right net-snmp CLI utility commands 2212 - running example_agent.py with suitable parameters 2213 - cleanup of the temporary dir upon exit 2214 2215 (Git commit c54e1a67f32fcc086aa0ee4ab8b567bab2391db3) 2216 2217* Wed Nov 28 12:55:57 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2218 2219 Rename example.py to example_agent.py 2220 2221 (Git commit 6db1ac747835f512aaa1783b1a5a7350429a99c9) 2222 2223* Wed Nov 28 11:58:25 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2224 2225 Add support to modify persistance directory 2226 2227 (Git commit 92388737919b9eb2b6bdc170c41e1c13c06fc21b) 2228 2229* Wed Nov 28 00:45:06 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2230 2231 Minor cosmetics 2232 2233 (Git commit ee5245d45ff319e30b8f2b8ed4c63463e1b14b62) 2234 2235* Wed Nov 28 00:41:37 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2236 2237 Fix and expand EXAMPLE-MIB 2238 2239 - Rename IPAddress to IpAddress 2240 - Replace exampleString with exampleOctetString and exampleDisplayString 2241 - Add missing IMPORTs for Counter32, TimeTicks and IpAddress to IpAddress 2242 - Add exampleCounter, exampleTimeTicks, exampleIpAddress, 2243 exampleOctetString and 2244 exampleDisplayString to exampleMIBScalarsGroup conformance group 2245 2246 EXAMPLE-MIB.txt should always be validated with smilint. 2247 2248 (Git commit 3798704e9b4633ebf4a398251e89881b3986dffd) 2249 2250* Wed Nov 28 00:29:12 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2251 2252 Use single C variable reference and mutable string buffer 2253 2254 String handling was broken. We must use ctypes.create_string_buffer with 2255 a defined MAX_STR_SIZE instead of ctypes.c_char_p because the latter 2256 creates a buffer which a.) Python considered immutable while "snmpset" 2257 would happily write into it and b.) had an implicit maximum size 2258 depending on the initial creation string, causing possible memory 2259 corruption when "snmpset" would be used with a larger string. 2260 2261 It also didn't make much sense to re-create a new ctypes.* instance upon 2262 each SNMP variable update from within the Python agent, because the 2263 integer types were mutable before and strings have become so. 2264 2265 We fill out netsnmp_watcher_info's "max_size" properly now. Required for 2266 string types. 2267 2268 Also discarded the special handling for strings, special handling now 2269 depends on props["flags"] only. 2270 2271 Reordered things in define_and_register() and accordingly renamed it to 2272 register_and_define(). 2273 2274 Added more verbose comments about the process of SNMP variable 2275 registration. 2276 2277 (Git commit 65ba9c1223f347eaa5d347c334aa646e61102326) 2278 2279* Wed Nov 28 00:00:38 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2280 2281 Make example.py dump vars when SIGHUP is received 2282 2283 Also give exampleString a friendlier default value. 2284 2285 (Git commit 98d567461f4ae3f4479bbbabfd4b3e02431ae05a) 2286 2287* Tue Nov 27 12:45:11 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2288 2289 Implement special handling for c_char_p variable types more explicitly 2290 2291 We need a special case distinction for c_char_p (char *) variables during 2292 variable creation anyway (doesn't use ctypes.byref()), so no need for 2293 props["flags"], which was different for c_char_p only. 2294 2295 Also fix watcher info's max_size as 0 as it is only used if the 2296 WATCHER_MAX_SIZE flag is set which we don't use. 2297 2298 (Git commit 9b4297f4c87b3c16b1e8beaa4aa9010b96985316) 2299 2300* Mon Nov 26 14:30:54 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2301 2302 Fix check that vars can't be added after agent start 2303 2304 (Git commit ade8000db69ed9520676af6fa6f886ec76ed4f61) 2305 2306* Mon Nov 26 14:29:38 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2307 2308 Cosmetics to make line lengths <= 80 chars 2309 2310 (Git commit 14f8afa4e82c9adb2f52eaf240385453b8606993) 2311 2312* Mon Nov 26 14:20:31 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2313 2314 Cosmetics 2315 2316 (Git commit f328fbe1459bf9d8609bc4bdb84a5a580de794c6) 2317 2318* Mon Nov 26 14:18:52 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2319 2320 Streamline SNMP variable class definition 2321 2322 Before, there was a netsnmpVariable class and Integer32, Unsigned32, 2323 DisplayString32 etc. classes deriving from it (and an intermediate class 2324 netsnmpIntegerVariable). The variables carried the SNMP registration 2325 intelligence. In addition, netsnmpAgent had an addVar() method and proxy 2326 methods named liked the classes, taking care of creating variable 2327 instance and adding them to an agent's internal variable registry. 2328 2329 Now, netsnmpAgent features a VarTypeClass decorator method that gets 2330 applied to methods Integer32, Unsigned32, DisplayString32 etc. which do 2331 nothing but return a dictionary with variable type properties. The 2332 decorator transforms these functions so that they a.) define the suitable 2333 class b.) create an instance and c.) register that instance with 2334 net-snmp. The classes themselves are now nothing but wrappers for the 2335 ctypes variables. So the registration intelligence (and oidstr2oid()) is 2336 back in netsnmpAgent itself again.- 2337 2338 (Git commit b2e4c4d50c53e070e6635e2051873f1e2104516d) 2339 2340* Mon Nov 26 13:50:36 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2341 2342 Let example.py print the registered vars for debugging and ease of use 2343 2344 (Git commit 3aa9ac50fd3255fbf5695a1aaab61fd1b818c300) 2345 2346* Sun Nov 25 23:49:19 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2347 2348 Major rewrite of SNMP variable handling and exposed API 2349 2350 Before, the code using the module (eg. example.py) had to own 2351 ctypes-style variables and deal with conversions etc. netsnmpAgent just 2352 provided a registration function. 2353 2354 Now, netsnmpAgent offers methods that return classes inheriting from a 2355 base class, netsnmpVariable, one class for each variable type. Class 2356 creation requires specification of the OID to register for and indication 2357 whether the variable should be writable using SNMP requests. Each class 2358 obtained this way offers value() and update() methods, called by the 2359 client at its decretion. See example.py how much shorter and nicer this 2360 looks. 2361 2362 The interface is not quite polished yet, currently netsnmpVariable and 2363 deriving classes share the same namespace as netsnmpAgent and require an 2364 "agentlib" argument to get access to netsnmpAgent's libnetsnmpagent 2365 handle. This is currently provided by an addVar method for which there 2366 are in turn wrapper functions named after each variable type. This could 2367 need some improvement, probably using a factory method and/or decorators. 2368 2369 In other news: 2370 - Moved net-snmp constants to the module level to avoid accessibility 2371 problems from within the new netsnmpVariable class and inheriting 2372 classes. 2373 - Removed debug-style print statement that spit out the name of each 2374 loaded MIB upon agent startup 2375 - Simplified library loading code since it looks like libnetsnmpagent 2376 alone will suffice. 2377 2378 (Git commit e4fc68bfdf93998fd622d96d326443ef87a124d6) 2379 2380* Sat Nov 24 02:05:54 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2381 2382 Add support for IPAddress variables 2383 2384 (Git commit 4ffe76d0e967332994ea1da1d5b0c6ee6237bae3) 2385 2386* Sat Nov 24 00:56:22 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2387 2388 Add support for TimeTicks variables 2389 2390 (Git commit fbe5e01239396c7924816bf831e8e78dabc826e2) 2391 2392* Fri Nov 23 23:42:53 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2393 2394 Cosmectic fix for correct size of Unsigned32 variables 2395 2396 (Git commit 1e6973be62966a0cb4ae6703d9a612d40d863e47) 2397 2398* Fri Nov 23 23:32:46 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2399 2400 Add support for Counter32 variables 2401 2402 (Git commit 7563a6c16491efc86484426218b355ef9236fcf0) 2403 2404* Fri Nov 23 17:51:54 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2405 2406 Added TODOs 2407 2408 (Git commit e1c7400bbfe951523f15139e6c4c3f85e0942410) 2409 2410* Fri Nov 23 17:41:00 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2411 2412 Add LICENSE 2413 2414 (Git commit 2eb7fb848c1cede41018a340b656feadcd131fbf) 2415 2416* Fri Nov 23 17:40:15 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2417 2418 Add a first version of a README 2419 2420 (Git commit 609ee8edc197914ff0fb1b7d6b955f273ac080db) 2421 2422* Fri Nov 23 16:28:32 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2423 2424 Added .gitignore to ignore *.pyc files 2425 2426 (Git commit 62574958cf3ff02497bfb07bd9e10a17709947fb) 2427 2428* Fri Nov 23 16:10:31 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2429 2430 Cosmetics 2431 2432 (Git commit c06ba86f1df7d515b0567559e5ff6483cb302a3b) 2433 2434* Fri Nov 23 16:10:31 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2435 2436 Add read-only variables support 2437 2438 (Git commit f2def554a8cb54b0ea593da42ffec4daddb97a25) 2439 2440* Thu Nov 22 22:58:24 2012 +0100 - Pieter Hollants <pieter@hollants.com> 2441 2442 Initial commit 2443 2444 (Git commit ff76a9d3fb6148ed4a6d588358840984eee14e24) 2445 2446