<div dir="ltr"><div>Hi J.C.,<br><br></div>Adding the '\Z' instead of '$' doesn't seem to work either.<br><br>[root@<host> ~]# xymoncmd env | grep NORRD<br>NORRDDISKS=^/dev|^/var|^/tmpZ<br><div class="gmail_extra"><br><br></div><div class="gmail_extra">How would I do that shell wrapper launched from tasks.cfg?<br><br></div><div class="gmail_extra">I tried to stick it in /etc/sysconfig/xymonlaunch and it came back with an error message "Ignoring invalid environment assignment 'env FOO=$': /etc/sysconfig/xymonlaunch" and "xymoncmd[15102]: 2016-03-02 15:55:16.622168 xgetenv: Cannot find value for variable FOO".<br><br></div><div class="gmail_extra">Just putting in FOO='$' without the 'env' didn't work either.<br><br><br></div><div class="gmail_extra">Thanks for your help!!<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div>--</div><div>Matt Vander Werf</div></div></div>
<br><div class="gmail_quote">On Wed, Mar 2, 2016 at 3:06 PM, J.C. Cleaver <span dir="ltr"><<a href="mailto:cleaver@terabithia.org" target="_blank">cleaver@terabithia.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hmm. Taking a look at the code, there's not really a provision for<br>
escaping in this manner. And unfortunately, this is parsed in various<br>
places throughout xymonlaunch (and passed onto the shell).<br>
<br>
The only workaround that seems to work properly is substitution prior to<br>
xymoncmd's reading:<br>
<br>
in xymonserver.cfg:<br>
NORRDDISKS='^(/dev|/tmp|/var)$FOO'<br>
<br>
then run:<br>
env FOO='$' xymoncmd env | grep NORRD<br>
<br>
<br>
You could either place FOO='$' in a shell wrapper launched from tasks.cfg,<br>
or stick it way up in /etc/sysconfig/xymonlaunch (if you're using the<br>
RPM).<br>
<br>
I'm tempted to try a patch allowing '$$' to mean an unprocessed '$', but<br>
that might interfere with people who want a shell PID for some reason.<br>
Alternatively, adding '\' escaping globally in environment files might<br>
cause other sorts of problems for folks.<br>
<br>
<br>
Alternatively-alternatively, NORRDDISKS='^(/dev|/tmp|/var)\Z' might work<br>
for you, since this *is* just straight PCRE...<br>
<span class=""><font color="#888888"><br>
<br>
-jc<br>
</font></span><div class=""><div class="h5"><br>
<br>
On Wed, March 2, 2016 11:23 am, Matt Vander Werf wrote:<br>
> Hi J.C.,<br>
><br>
> It doesn't seem to be working with or without the escape backslash. It<br>
> doesn't show up in the env output either way.<br>
><br>
> root@<host> ~]# grep NORRDDISK /etc/xymon/xymonserver.cfg<br>
> NORRDDISKS="^/dev|^/var|^/tmp$"<br>
> [root@<host> ~]# xymoncmd env | grep NORRD<br>
> 2016-03-02 14:18:47.151545 xgetenv: Cannot find value for variable<br>
> NORRDDISKS=^/dev|^/var|^/tmp<br>
><br>
> [root@<host> ~]# grep NORRDDISK /etc/xymon/xymonserver.cfg<br>
> NORRDDISKS="^/dev|^/var|^/tmp\$"<br>
> [root@<host> ~]# xymoncmd env | grep NORRD<br>
> 2016-03-02 14:17:47.233910 xgetenv: Cannot find value for variable<br>
> NORRDDISKS=^/dev|^/var|^/tmp<br>
><br>
><br>
> When I do it with them grouped together, it gives me the same result:<br>
><br>
> [root@<host> ~]# grep NORRDDISK /etc/xymon/xymonserver.cfg<br>
> NORRDDISKS="^(/dev|/var|/tmp)$"<br>
> [root@<host> ~]# xymoncmd env | grep NORRD<br>
> 2016-03-02 14:20:35.984507 xgetenv: Cannot find value for variable<br>
> NORRDDISKS=^(/dev|/var|/tmp)<br>
><br>
> Any ideas?<br>
><br>
> Thanks!!<br>
><br>
> --<br>
> Matt Vander Werf<br>
><br>
> On Wed, Mar 2, 2016 at 11:50 AM, J.C. Cleaver <<a href="mailto:cleaver@terabithia.org">cleaver@terabithia.org</a>><br>
> wrote:<br>
><br>
>><br>
>><br>
>> On Wed, March 2, 2016 8:31 am, Matt Vander Werf wrote:<br>
>> > Hello,<br>
>> ><br>
>> > Looking at past list e-mails, it is my understanding that the<br>
>> NORRDDISKS<br>
>> > setting in xymonserver.cfg allows for PCRE regular expressions. Is<br>
>> this<br>
>> > correct? Or does it only allow certain PCRE regular expressions, but<br>
>> not<br>
>> > everything?<br>
>> ><br>
>> > I ask because I'm experiencing an issue with my NORRDDISKS setting.<br>
>> ><br>
>> > I'd like to ignore disks for graphing that have mount points "/tmp",<br>
>> but<br>
>> > not ignore disks with mount points that have "tmp" in them, like<br>
>> > "/tmpscratch".<br>
>> ><br>
>> > I noticed that for other disk mount point names that if you just use<br>
>> > "^/<name>" with no modifiers, then it only ignores disk mount points<br>
>> with<br>
>> > only exactly "^/<name>" and not "^/<name><additional text>" or<br>
>> > "^/<name>/<more name>" (at least from what I can tell).<br>
>> ><br>
>> > For example when using:<br>
>> ><br>
>> > NORRDDISKS="^/dev|^/tmp|^/var"<br>
>> ><br>
>> > It ignores disks with mount points "/dev" and "/var", but also "/tmp"<br>
>> AND<br>
>> > "/tmpscratch". But it doesn't look like it ignores "/var/tmp" (at<br>
>> least<br>
>> as<br>
>> > far as I can tell).<br>
>> ><br>
>> > I tried using "^/tmp$" and that didn't work either (still ignored both<br>
>> > names).<br>
>> ><br>
>> ><br>
>> > Any idea what's going on here? Or how this can be done correctly? Is<br>
>> the<br>
>> > "$" metacharacter not allowed in this setting?<br>
>> ><br>
>> ><br>
>> > If it's needed, I'm running the latest 4.3.26-1 Terabithia RPM on RHEL<br>
>> 7.<br>
>> ><br>
>> > Thanks for any help!!<br>
>> ><br>
>> > --<br>
>> > Matt Vander Werf<br>
>><br>
>><br>
>> Try checking the output of 'xymoncmd env | grep NORRD' ? If the '$' is<br>
>> not<br>
>> coming through, it might be getting read in as an attempt at a shell<br>
>> variable.<br>
>><br>
>> If so, can you try escaping it as \$ instead?<br>
>><br>
>> Alternatively: '^(/dev|/tmp|/var)$'<br>
>><br>
>><br>
>> HTH,<br>
>> -jc<br>
>><br>
>><br>
><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>