Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision |
apps:clamav:general:remoteclamdscan [2007/05/10 19:52] – created crustymonkey | apps:clamav:general:remoteclamdscan [2007/05/11 18:03] (current) – crustymonkey |
---|
===== Intro ===== | ===== Intro ===== |
I recently encountered a need to set up a cluster of clamd servers running on linux. The details of why are irrelevant here. The crux of this need was the fact that you cannot use the ''clamdscan'' that is included with the clamav package to access a remote clamd server. I dug around on the net for a bit and found this Python script, [[http://xael.org/norman/python/pyclamd/pyclamd.py|pyclamd.py]], written by Alexandre Norman - <norman@xael.org>. I downloaded it and tried it out and it seemed to work pretty well. What I didn't like was the lack of an [[wp>Object-oriented|object-oriented]] design. I took that code and rewrote it in a class with a couple of helper functions for instantiation. I then wrote a consumer script to use that library to emulate the behavior and output of ''clamdscan'' to make it pretty much a drop in replacement for the ''clamdscan'' that comes with clamav. | I recently encountered a need to set up a cluster of clamd servers running on linux. The details of why are irrelevant here. The crux of this need was the fact that you cannot use the ''clamdscan'' that is included with the clamav package to access a remote clamd server. I dug around on the net for a bit and found this Python script, [[http://xael.org/norman/python/pyclamd/pyclamd.py|pyclamd.py]], written by Alexandre Norman - <norman@xael.org>. I downloaded it and tried it out and it seemed to work pretty well. What I didn't like was the lack of an [[wp>Object-oriented|object-oriented]] design. I took that code and rewrote it in a class with a couple of helper functions for instantiation. I then wrote a consumer script to use that library to emulate the behavior and output of ''clamdscan'' to make it pretty much a drop in replacement for the ''clamdscan'' that comes with clamav. |
| |
| |
===== Install ===== | ===== Install ===== |
PyClamd/__init__.py | PyClamd/__init__.py |
</code> | </code> |
You will then be able to run the script by typing ''clamdscan.py''. Try typing ''clamdscan.py --help'' to see the available command line options. | You will then be able to run the script by typing ''clamdscan.py''. Try typing ''clamdscan.py --help'' to see the available command line options. If you do this, you will notice that there are some other options beyond the normal ''clamdscan'' options, specifically options for specifying a host and port. |
| |
===== The Code ===== | ===== The Code ===== |
print "TotalTime: %f" % t.TotalTime | print "TotalTime: %f" % t.TotalTime |
</code> | </code> |
| |
| ~~DISCUSSION~~ |