How to integrate Eset Antivirus with PMG

Just a small addition to https://forum.proxmox.com/threads/how-to-integrate-eset-antivirus-with-pmg.49788/#post-238553
I guess with newer versions you have to use "cls" Command LIne Scanner:
Code:
open(my $cmd, '-|', '/opt/eset/efs/sbin/cls/cls' , '--base-dir=/var/opt/eset/efs/lib' , '--clean-mode=standard' ,'--log-file=/var/log/cls-logs.log', $dname) ||
    die "$queue->{logid}: can't exec esets scan: $! : ERROR";

After installation, there is now also a WebGUI on https://<servername>:9443, initial password is written on console after installation...

Hmm and also the following has to be adjusted:
Code:
while (defined(my $line = <$cmd>)) {
                if ($line =~ m/^name=\"(.*)\".*result=\"(.*)\".*action=\"(.*)\".*info=\"(.*)\"$/) {
 
Last edited:
  • Like
Reactions: proxminent
Just a small addition to https://forum.proxmox.com/threads/how-to-integrate-eset-antivirus-with-pmg.49788/#post-238553
I guess with newer versions you have to use "cls" Command LIne Scanner:
Code:
open(my $cmd, '-|', '/opt/eset/efs/sbin/cls/cls' , '--base-dir=/var/opt/eset/efs/lib' , '--clean-mode=standard' ,'--log-file=/var/log/cls-logs.log', $dname) ||
    die "$queue->{logid}: can't exec esets scan: $! : ERROR";

After installation, there is now also a WebGUI on https://<servername>:9443, initial password is written on console after installation...

Hmm and also the following has to be adjusted:
Code:
while (defined(my $line = <$cmd>)) {
                if ($line =~ m/^name=\"(.*)\".*result=\"(.*)\".*action=\"(.*)\".*info=\"(.*)\"$/) {

Hi Fabiana !
Thanks ... asap a the next version :)
 
Für alle die es benötigen habe ich das Script für Eset mit PMG angepasst.

Getestet mit Eset-Version: odscan (efs) 10.2.41.0

/usr/local/bin/pmg-custom-check

Code:
#!/bin/sh

echo "called with $*" 1>&2

if [ "$#" -ne 2 ]; then
  echo "usage: $0 APIVERSION QUEUEFILENAME" 1>&2
  exit 1
fi

apiver="$1"
shift

if [ "$apiver" != "v1" ]; then
  echo "wrong APIVERSION: $apiver" 1>&2
  exit 2
fi

queue_file="$1"

echo "v1"

# Domain oder localhost wo der Eset i-cap Service läuft!
SERVER="i-cap.meinDomain.tld"

result="$(c-icap-client -i "$SERVER" -v -f "$queue_file" 2>&1 | grep -F 'X-Infection-Found')"
infected=$?

if [ "$infected" = "1" ]; then
    echo OK
else
    echo "VIRUS: $(echo $result | awk -F= '{ print $4 }' )"
fi
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!