Using a shell command as plugin

Hello everyone,

I have configured nagios so far with 300 Hosts an several Services. So far, only small problems, and most of them could be fixed with a little help from this forum.

But now I have some serious question: I want Nagios to list the MAC address. That for I want to use the shell command: arp -a $HOSTADDRESS$ |awk ‘{print $4}’. This returns something like 00:aa:bb:cc:dd:ee.

I have no idea of writing own plugins, so I tried to use this as command_line. Sorrily it just returns (no output!). I have no idea what to do, I thought Nagios would just take the returned data and post it in the web-interface, maybe critical, but with the content. What do I have to do? :shock:

Ah, yes, I suppose it would be a bit more complicated than just returning the data to the web interface. I don’t know anything about writing your own plugins, but the docs should be able to point you in the right direction:
nagios.sourceforge.net/docs/2_0/ … html#howto

You could use check_snmp and query oid .1.3.6.1.2.1.2.2.1.6
This shows the ethernet address as you would like to see.

btw, i dont want discourage you from learning how to write plugins. But if all you want to accomplish is getting a mac addy out of some host, then setup snmpd on that box and use a plugin that is already written for you.