Xymon Mailing List Archive search

xymon 4.3.17 glitch - .netrc passwd not working for some https cont tests

6 messages in this thread

list Betsy Schwartz · Wed, 27 Aug 2014 14:59:43 -0400 ·
I'm testing our 4.3.17 upgrade on a dev box and finding a minor glitch,
that some https tests with content and passwords in .netrc are not working.
they do work with password in the host file, so it's not a blocker, but I'm
hoping to avoid that.

This line works:
 cc.example.com # noconn ssh cont;
https://username:user-8f1bb9bfe39d@xymon.invalid/webdav/DEMO/;Hello
delayred=http:2,conn:2,ssh:2

this line does not work
 cc.example.com # noconn ssh cont;https://cc.example.com/webdav/DEMO/;Hello
delayred=http:2,conn:2,ssh:2

with .netrc containing:
machine webdav-cc2.example.com login username password password
machine webdav-cc1.example.com login username password password
machine webdav-cc3.example.com login username password password
machine cc.example.com login username password password

There are four machines in the hosts.cfg , one representing the vip and
three representing physical servers. Only the first machine, webdav-cc1,
works. I played around with the order in both hosts.cfg and .netrc, doesn't
seem to matter. I can auth with all of them using wget at the command line
so it's not a connectivity issue

any thoughts?
exact same host file and .netrc work on the production server
thanks Betsy
list Jeremy Laidman · Thu, 28 Aug 2014 10:39:33 +1000 ·
On 28 August 2014 04:59, Betsy Schwartz <user-c61747246f66@xymon.invalid> wrote:
any thoughts?
You sure it's looking for ~/.netrc where you think it is?  You might have
$XYMONHOME/etc/netrc, which will mask any you have in ~/.netrc.  Perhaps
run xymonnet via strace, grepping for netrc and see where it's
looking/finding it.

J
list Betsy Schwartz · Fri, 29 Aug 2014 17:35:19 -0400 ·
Jeremy you were correct (as always) thank you !!
 the server was using /usr/local/xymon/.netrc and I was editing
/usr/local/xymon/server/etc/.netrc


What controls whether/which of these files is used?
thank you!

(now all I have to do is figure out why my esxi cpu tests are yellow in dev
but not in prod, but I think I can blame vmware tools for that one)


On Wed, Aug 27, 2014 at 8:39 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>
quoted from Jeremy Laidman
wrote:
On 28 August 2014 04:59, Betsy Schwartz <user-c61747246f66@xymon.invalid> wrote:
any thoughts?
You sure it's looking for ~/.netrc where you think it is?  You might have
$XYMONHOME/etc/netrc, which will mask any you have in ~/.netrc.  Perhaps
run xymonnet via strace, grepping for netrc and see where it's
looking/finding it.

J

list Tim McCloskey · Fri, 29 Aug 2014 21:45:49 +0000 ·
quoted from Jeremy Laidman
On Wed, Aug 27, 2014 at 8:39 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid<mailto:user-71895fb2e44c@xymon.invalid>> wrote:
 Perhaps run xymonnet via strace, grepping for netrc and see where it's looking/finding it.

^ This reminds me of a question I was going to post yesterday before I had to go deal with an outage.

Is there a way to send what xymon has parsed as it's config to std out?  I looked through some of the files and options for them in the bin dir but did not see anything obvious.  (short of running strace/truss) 

Thanks, 

Tim
list Jeremy Laidman · Mon, 1 Sep 2014 13:06:07 +1000 ·
On 30 August 2014 07:35, Betsy Schwartz <user-c61747246f66@xymon.invalid> wrote:
Jeremy you were correct (as always) thank you !!
You're most welcome.
quoted from Betsy Schwartz

 the server was using /usr/local/xymon/.netrc and I was editing
/usr/local/xymon/server/etc/.netrc


What controls whether/which of these files is used?
Why the source code of course!  ;-)

And for the answer you really wanted, the source code (lib/url.c) tells me
that Xymon first looks in $XYMONHOME/etc/netrc (no dot) and uses that file.
 If there's no file there, or of Xymon failed to open the file (eg
permission denied), then it looks for it in $HOME/.netrc (leading dot).  If
still no file opened, Xymon gives up.

So on your system, this would be /usr/local/xymon/server/etc/netrc, then (I
think) /usr/local/xymon/.netrc.

J
list Jeremy Laidman · Mon, 1 Sep 2014 16:31:50 +1000 ·
quoted from Tim McCloskey
On 30 August 2014 07:45, Tim McCloskey <user-440820cc07d6@xymon.invalid> wrote:
Is there a way to send what xymon has parsed as it's config to std out?  I
looked through some of the files and options for them in the bin dir but
did not see anything obvious.  (short of running strace/truss)
$XYMON $XYMSRV hostinfo

This will give the parsed hosts.cfg file in pipe-separated value format.

$XYMON $XYMSRV 'config hosts.cfg'

This will give the semi-parsed hosts.cfg file in original format, but with
"include" files expanded.

The latter works with other files too, such as "tasks.cfg".

Cheers
Jeremy