Hi Martin
I believe this to be a Solaris feature. And looks like it is also the case on others. See here http://www.coffer.com/mac_info/locate-unix.html
And yes, I think sudo is the simplest way of getting round it. However, if you have conscientious objections to using root and/or sudo, you could try messing about with the output of arp -a. A bit of creative scripting, and you should get something you could tack onto the output of ifconfig -a. YMMV.
Cheers Vernon
On Thu, Jul 22, 2010 at 12:10 AM, Ward, Martin <Martin.Ward at colt.net> wrote:
All,
I don't know if this quirk is peculiar to Solaris or is the same on other flavours of UNIX, but if you are not the root user and you run the ifconfig(1m) command it does not show the MAC address assigned to the interfaces. Here is what I see in Xymon's client data view for one host:
[ifconfig]
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.5.2.46 netmask ffffffe0 broadcast 10.5.2.63If I login as root and run the command I see:
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.5.2.46 netmask ffffffe0 broadcast 10.5.2.63 ether 0:3:ba:96:e6:4fI am currently writing a script to retrieve information from the stored client data and to populate a database with that info. In this manner when I install Xymon on a new server the configuration information is automatically updated in my server database. The question is: How can I get the MAC address? By default the Xymon client is installed and run under the hobbit user ID. Is there any way I can configure the hobbitclient-sunos.sh script to run as root? I guess I could run the ifconfig command using sudo and configure sudo so that it doesn't require a password, but is there any other/better/easier/more elegant ways of doing this?
|\/|artin
--
[image: Colt email signature FINAL]
Martin Ward
*Manager, Technical Services*
DDI:+44 (0) 20 7863 5218 / Fax: +44 (0)20 7863 9999 / www.colt.net
Colt Technology Services, Unit 12, Powergate Business Park, Volt Avenue, Park Royal, London, NW10 6PW, UK.
Help reduce your carbon footprint | Think before you print. Registered in England and Wales, registered number 02452736, VAT number GB 645 4205 50
[Colt Disclaimer] The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way. The contents of this message and its attachments are confidential and may also be subject to legal privilege. If you are not the named addressee and/or have received this message in error, please advise us by e-mailing abuse at colt.net and delete the message and any attachments without retaining any copies. Internet communications are not secure and Colt does not accept responsibility for this message, its contents nor responsibility for any viruses. No contracts can be created or varied on behalf of Colt Technology Services, its subsidiaries, group companies or affiliates ("Colt") and any other party by email communications unless expressly agreed in writing with such other party. Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900