cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent:How to get the node name

shivakumar_1
Frequent Advisor

Urgent:How to get the node name

Hi all,

I have some custom code written in some node of a module.In that code i am displaying an error Msg.By using the active module i can get the current module where the code is present, but i also want the Current node i which the code is present. Can anyone Plz help me in this regard.I tried using ActiveDialogName ,but its not working.

Thanks in Advance,
Shiva.
4 REPLIES
Steven E. Protter
Exalted Contributor

Re: Urgent:How to get the node name

Shalom,

NODENAME is an environment variable.

echo $NODENAME

Normally it is set in /etc/profile

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
shivakumar_1
Frequent Advisor

Re: Urgent:How to get the node name

Hey Steve,

Thanks for your response. Can you eleborate a bit on that.Can i directly use the echo$Nodename in my Msgbox code.

Regards,
Shiva
skt_skt
Honored Contributor

Re: Urgent:How to get the node name

u may also define like
NODENAME=`hostname`
Suraj K Sankari
Honored Contributor

Re: Urgent:How to get the node name

Hi,

Two way to do the same
1. Using variable that is
nodename=`hostname`
echo $nodename
Or
printf "NODENAME : "$nodename for formatted output
2. Using directly
echo â my nodename is : `hostname` is having os `uname â s`â

Suraj