Best way to setup env for NHC?

28 views
Skip to first unread message

Belgin, Mehmet

unread,
Jul 5, 2018, 5:24:23 PM7/5/18
to n...@lbl.gov, Belgin, Mehmet
Hi Michael, everyone, 

I find scheduler related checks extremely useful, but our manual torque/moab installations are in non-stand paths (namely /opt/torque/current and /opt/moab/current). As a result, commands in lbnl_moab.nhc are failing. I can configure some of these manually, e.g.:

* || export MDIAG_CMD=/opt/moab/current/bin/mdiag

but not everything has a variable defined this way(e.g. qmgr). As a bandaid, I added all paths as follows:

* || export PATH=/opt/torque/current/sbin:/opt/torque/current/bin:/opt/moab/current/bin:/opt/moab/current/sbin:$PATH

which works fine, but it’s too ugly for my taste. I’m sure there is a much more elegant way to setup env variables for NHC. 

So… is there a way to tell NHC to source some specific files (e.g. those in profile.d) before it runs, without touching any of its source code? 

Thanks in advance!
-Mehmet


---
Mehmet Belgin, Ph.D. 
Research Facilitation Lead
Partnership for an Advanced Computing Environment (PACE)
Georgia Institute of Technology
258 4th Street NW, Rich Building, #326 
Atlanta, GA  30332-0700
(404) 385-0665



Dockendorf, Trey

unread,
Jul 6, 2018, 8:13:48 AM7/6/18
to n...@lbl.gov, Belgin, Mehmet

Your approach of setting PATH is exactly what we do, and may be your best option.

 

* || export NHC_RM=pbs

* || export PATH="$PATH:/opt/torque/bin:/opt/torque/sbin:/opt/moab/bin"

* || export PBS_SERVER_HOME=/var/spool/torque

 

-- 

Trey Dockendorf

HPC Systems Engineer

Ohio Supercomputer Center

--
You received this message because you are subscribed to the Google Groups "LBNL Node Health Check" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhc+uns...@lbl.gov.
To post to this group, send email to n...@lbl.gov.
Visit this group at https://groups.google.com/a/lbl.gov/group/nhc/.

Belgin, Mehmet

unread,
Jul 16, 2018, 2:01:16 PM7/16/18
to Dockendorf, Trey, n...@lbl.gov
Ah, thanks Trey, it helps to know that this is indeed a common approach! 


-Mehmet

---
Mehmet Belgin, Ph.D. 
Research Facilitation Lead
Partnership for an Advanced Computing Environment (PACE)
Georgia Institute of Technology
258 4th Street NW, Rich Building, #326 
Atlanta, GA  30332-0700
(404) 385-0665


Michael Jennings

unread,
Jul 16, 2018, 4:07:44 PM7/16/18
to LBNL Node Health Check, Belgin, Mehmet
On Thu, Jul 5, 2018 at 3:22 PM, Belgin, Mehmet
<mehmet...@oit.gatech.edu> wrote:

> I find scheduler related checks extremely useful, but our manual torque/moab
> installations are in non-stand paths (namely /opt/torque/current and
> /opt/moab/current). As a result, commands in lbnl_moab.nhc are failing. I
> can configure some of these manually, e.g.:
>
> * || export MDIAG_CMD=/opt/moab/current/bin/mdiag
>
> but not everything has a variable defined this way(e.g. qmgr). As a bandaid,
> I added all paths as follows:
>
> * || export
> PATH=/opt/torque/current/sbin:/opt/torque/current/bin:/opt/moab/current/bin:/opt/moab/current/sbin:$PATH
>
> which works fine, but it’s too ugly for my taste. I’m sure there is a much
> more elegant way to setup env variables for NHC.
>
> So… is there a way to tell NHC to source some specific files (e.g. those in
> profile.d) before it runs, without touching any of its source code?

Actually, that is probably the right answer.

There are 2 ways to effect changes to NHC's environment in the general
sense. One is, as you show above, to put directives in the config to
alter the shell variables like PATH. The other is to use
/etc/sysconfig/nhc (or, if you're using multiple named contexts,
/etc/sysconfig/NAME).

If you check out the NHC docs, you'll see a table of NHC variables
(https://github.com/mej/nhc#supported-variables), some of which are
marked with an asterisk (*). Those are the variables that are used by
NHC *before* the lines from the config file are evaluated; they
therefore cannot be effectively manipulated via the config file and
must instead be modified in /etc/sysconfig/nhc.

The PATH variable is not marked with an asterisk because setting it in
the config works just fine, but you could conceivably set it in
/etc/sysconfig/nhc instead or in addition. Up to you.

The alternative is setting an absolute path for each individual *_CMD
variable, and as you said, that's not always possible (though it
arguably should be).

Michael

--
Michael Jennings (KainX) https://medium.com/@mej0/ <m...@eterm.org>
Linux/HPC Systems Engineer, LANL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"The trouble with doing something right the first time is that nobody
appreciates how difficult it was." -- Walt West
Reply all
Reply to author
Forward
0 new messages