Code review comment for lp:~lazypower/charms/precise/nrpe/fix-lp-1287393

Revision history for this message
Matt Bruzek (mbruzek) wrote :

I have a comment/question about the new command you are using.

https://codereview.appspot.com/69980048/diff/1/hooks/nrpe-relation-joined
File hooks/nrpe-relation-joined (right):

https://codereview.appspot.com/69980048/diff/1/hooks/nrpe-relation-joined#newcode10
hooks/nrpe-relation-joined:10: address=`nslookup $(unit-get
private-address) | grep Add | grep -v '#' | cut -f 2 -d ' '`
I ran this nslookup command on my own system and I believe the two greps
are cancelling each out.

$ nslookup 192.168.168.13
Server: 127.0.1.1
Address: 127.0.1.1#53

** server can't find 13.168.168.192.in-addr.arpa.: NXDOMAIN

$ nslookup 192.168.168.13 | grep Add
Address: 127.0.1.1#53

$ nslookup 192.168.168.13 | grep Add | grep -v '#'
(no match)

Are you sure this command works in all cases? Am I using the command
incorrectly here, or should we consider refining the command to work in
this case too?

https://codereview.appspot.com/69980048/

« Back to merge proposal