Can't get check for Amavis to work

Hi,

I downloaded and installed the check for Amavis from here:
https://exchange.checkmk.com/p/amavis-1

I installed it and from what I can tell that worked as it should:
OMD[Home]:~$ mkp list amavis
/omd/sites/Home/local/share/check_mk/checks/amavis
/omd/sites/Home/local/share/check_mk/agents/bakery/amavis
/omd/sites/Home/local/share/check_mk/agents/plugins/amavis
/omd/sites/Home/local/share/check_mk/web/plugins/metrics/amavis.py
/omd/sites/Home/local/share/check_mk/web/plugins/wato/agent_bakery_amavis.py
/omd/sites/Home/local/share/check_mk/web/plugins/wato/check_parameters_amavis.py
/omd/sites/Home/local/share/check_mk/web/plugins/perfometer/amavis.py

Then I copied the amavis plugin to the server running amavis. And when I manually connect from the command line I can see that it does generate output:
OMD[Home]:~$ ssh check_mk@nami /usr/bin/check_mk_agent

<<>>
[ps]
[agent]
entropy STR gDYT7-sZQzmTANy6jJcotyG0
sysContact STR
sysDescr STR amavisd-new-2.11.1 (20181009)
sysLocation STR
sysName STR mail.wevers.tv
sysObjectID OID 1.3.6.1.4.1.15312.2
sysUpTime TimeTicks 1446298167 (167 days, 9:29:41.67)
ContentBadHdrMsgs 1 0/h 0.7 % (InMsgs)
ContentBadHdrMsgsInbound 1 0/h 0.7 % (InMsgsInbound)
ContentCleanMsgs 91 0/h 62.3 % (InMsgs)
ContentCleanMsgsInbound 83 0/h 60.1 % (InMsgsInbound)

However, the service does not appear for this client. So obviously I’m missing something. Question is, what am I missing?

Any help will be greatly appreciated.

Hello,

if this is really copy/pasted then there is something wrong with the “header”.

Look at the plugin again.

if [ -x /usr/sbin/amavisd-agent ]; then
  echo '<<<amavis>>>'    <----
  echo '[ps]'
  /bin/ps ax | /bin/grep '[a]mavisd'
  echo '[agent]'
  waitmax 5 /usr/sbin/amavisd-agent -c 1 | grep -v ^$
fi

It should output

<<<amavis>>>

not

<<>>

br

Hi,

Thanks, I double checked. I guess some strange formatting occurred in the forum markup. I double checked and the <<<amavis>>> tag is really there:
<<<amavis>>>
[ps]
[agent]
entropy STR gDYT7-sZQzmTANy6jJcotyG0
sysContact STR
sysDescr STR amavisd-new-2.11.1 (20181009)
sysLocation STR
sysName STR mail.wevers.tv
sysObjectID OID 1.3.6.1.4.1.15312.2
sysUpTime TimeTicks 1528346397 (176 days, 21:24:23.97)

Hello,

ok had a a look at the plugin again and tried it with an test install here.
I can replicate the behavior if amavis isn’t running.

So from what i understand it only picks up the check if there is something in the [ps] section.
Running amavis

<<<amavis>>>
[ps]  
21829 ?        Ss     0:00 /usr/sbin/amavisd-new (master)
21831 ?        S      0:00 /usr/sbin/amavisd-new (virgin child)
21832 ?        S      0:00 /usr/sbin/amavisd-new (virgin child)
[agent]
sysContact      STR
sysDescr        STR amavisd-new-2.11.0 (20160426)
<snip>

vs stopped amavis

<<<amavis>>>
[ps]   <--- empty
[agent]
sysContact      STR
sysDescr        STR amavisd-new-2.11.0 (20160426)
<snip>

So is it in fact running? Can you get an output like the one above from an ps command?
In the plugin it would be /bin/ps ax | /bin/grep '[a]mavisd'

br

Ah, thank you. You’re 100% correct. It wasn’t running. It should have been though. I guess the service got somehow disabled. I feel so stupid now.

But thanks again. It’s working as it should now.

You’re welcome :slight_smile: Sometimes it’s the easy things that are hard to find :wink:

Plain copy&paste here in the forum tries to interpret the inner <...> as HTML tags unless you format them as Preformatted text (using the </> icon above the text input area or the keyboard shortcut Ctrl-Shift-C).

1 Like

Ah nice to know. Thanks :slight_smile: