Created
March 23, 2016 23:06
-
-
Save haarcuba/25a989a297259cab0941 to your computer and use it in GitHub Desktop.
Collectd null write plugin - a write outlet that does nothing (prevents collectd from complaining that is has no write channels)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LoadPlugin python> | |
Globals true | |
</LoadPlugin> | |
<Plugin python> | |
ModulePath "/path/to/write_null" # write_null is a folder with an __init__.py inside | |
LogTraces true | |
Import "write_null" | |
<Module write_null> | |
</Module> | |
</Plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collectd | |
import time | |
def write(vl, data=None): | |
pass | |
def config(*args, **kwargs): | |
thefile=open('/tmp/proofItWorks','w') | |
thefile.write( '{0} Im alive!\n'.format( time.asctime() ) ) | |
thefile.close() | |
collectd.register_write(write); | |
collectd.register_config(config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment