HOSTNAMEUTILS(1)

πŸ’– HOSTNAMEUTILS(1) β€” the Grid Engine hostname besties πŸ’–

okay so this is the manual page for the hostname utils from Grid Engine User Commands, and bestie, these little cuties are literally the ones that figure out who your host actually is. no cap. let's get into it πŸ¦‹


✨ NAME ✨

gethostname, gethostbyname, gethostbyaddr, getservbyname β€” get local host information πŸ‘‘


🌸 SYNTAX 🌸

like, here's the exact shape of each one, copy-paste coded:

$SGE_ROOT/utilbin/$ARCH/gethostname [-help|-name|-aname|-all]

$SGE_ROOT/utilbin/$ARCH/gethostbyname [-help|-name|-aname|-all] name

$SGE_ROOT/utilbin/$ARCH/gethostbyaddr [-help|-name|-aname|-all] ip

$SGE_ROOT/utilbin/$ARCH/getservbyname [-help|-number] service

πŸ’… DESCRIPTION πŸ’…

so gethostname and gethostbyname are the ones you call to get the local resolved host name. gethostbyaddr is giving reverse-lookup energy β€” you hand it a specified IP address (in dotted decimal notation) and it tells you the hostname. and getservbyname? that one's for grabbing the configured port number of a service (e.g. from /etc/services). obsessed.

ngl, the hostname utils are primarily used by the Grid Engine installation scripts. that's their whole main character job.

here's the vibe check on defaults, bestie: gethostname, gethostbyname and gethostbyaddr called without any option will print out the hostname, all specified aliases, and the IP address of the locally resolved hostname. and calling getservbyname without any option prints out the full service entry. periodt. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -help β€” prints a list of all the options. the "help me bestie" button 🫢
  • -name β€” this one only reports the primary name of the host. just the main character name, nothing else.
  • -aname β€” if this option is set, the Grid Engine host alias file is used for host name resolving. to do that it's necessary to set the environment variable SGE_ROOT and, if more than one cell is defined, also SGE_CELL. this option will print out the Grid Engine host name. iykyk 😭
  • -all β€” using -all prints out all available host information. that info includes the host name, the Grid Engine host name, all host aliases, and the IP address of the host. the full glow-up ✨
  • -number β€” this option prints out the port number of the specified service name. πŸ”’
  • <name> β€” the host name for which the information is requested.
  • <ip> β€” the IP address (dotted decimal notation) for which the information is requested.
  • <service> β€” the service name for which the information is requested (e.g. ftp, sge_qmaster or sge_execd).

🌈 EXAMPLES 🌈

first up, here's how to get the port number of the FTP service:

>/opt/sge/default/lx-amd64/getservbyname -number ftp
21

okay and the next example shows the output of gethostname -all when the host alias file contains this line:

gridmaster extern_name extern_name.mydomain
important bestie: the local host resolving must also provide the alias name gridmaster. each Grid Engine host that wants to use the cluster must be able to resolve the host name gridmaster. no resolving, no cluster, that's just how it is πŸ’€

to setup an alias name, edit your /etc/hosts file or modify your NIS setup to provide the alias for the NIS clients.

and the host alias file must be readable from each host (use e.g. an NFS shared file location). don't gatekeep the file from the other hosts, they need it πŸ₯Ί

>/opt/sge/default/lx-amd64/gethostname -all
Hostname: extern_name.mydomain
SGE name: gridmaster
Aliases:  loghost gridmaster
Host Address(es): 192.168.143.99

🧚 ENVIRONMENT VARIABLES 🧚

  • SGE_ROOT β€” specifies the location of the Grid Engine standard configuration files.
  • SGE_CELL β€” if set, specifies the default Grid Engine cell.

πŸ¦‹ SEE ALSO πŸ¦‹

sge_intro(1), host_aliases(5),


see sge_intro(1) for a full statement of rights and permissions.


and that's the whole page, bestie!! this lil masterpiece is from SGE 8.1.3pre, dated 2009-03-12, living under the Grid Engine User Commands umbrella β€” go resolve some hosts, you absolute icon πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά