Hi Bill...

On 18/9-2003, at 16:13, William W. Fisher wrote:

On Thursday, September 18, 2003, at 04:47 AM, Jakob Peterh�nsel wrote:

LINE OFF
EXPT "${String to verify}"i else goto @NO_MATCH
MTCH m"([0-9]\.[0-9]+)"i else goto #+2
STOR "Version" "${1}"
MTCH m"[0-9]\sdays,\s.*" else goto #+2
STOR "Uptime" "${1}"
DONE OKAY

The line:


MTCH m"[0-9]\sdays,\s.*" else goto #+2

does not contain parentheses, so ${1} will not be defined as anything. You may simply have to type it like this (note the i for case-insensitive):

MTCH m"([0-9])\sdays,\s.*"i else goto #+2

If you can get the first MTCH command to match, it might be easier for you to use one regular expression:

MTCH m"version\s(#+.#+)\#uptime\s(#+\sdays,\s##:##:##)"i else #+2
STOR "Version" "${1}"
STOR "Uptime" "${2}"

Sorry, but that is not working! Seems like it should, but it is not. To be specific, here is what I have found:

Using multiple matches in one GREP does not work, like:
mtch m"(#).(##)"
Only ${1} is filled with data here.
Also, "\s" for finding SPACE does not work. A . (wildcard char) does work, though.


So, MTCH m"(#+\sdays,\s##:##:##)"i else #+2
does NOT work, but
MTCH m"(#+.days,.##:##:##)"i else #+2
does work!


MTCH m"(#+.#+)"i else #+2 STOR "Version" "${1}" MTCH m"(#+.days,.##:##:##)"i else #+2 STOR "Uptime" "${1}"

While on the subject, initiating the var and then not finding it in the TCP script, makes the var NOT FOUND.

Doing this:
STOR "Uptime" "n/a"
CONN #60
...
MTCH m"###.###"i else goto #+2
STOR "Uptime" "${1}"

The above code will display the VAR Uptime as "n/a" or the value found, if the script is able to connect to the remote server.
If it is NOT able to connect (like, if you unplug the ethernet cable..) the variable will show as "NOT FOUND: Uptime"


Could we get a 'fix' for this? I would like to be able to determine whet should be displayed here.
One possible solution could be to do the STOR trick I do, but let it work, or alter the STOR command to:


STOR "myVar" "theResult"|"defaultValue"

The minus about the default value, is that it will not execute if the script terminates before the line is executed, so I would actually like to ask IM to respect the variable value that it HAS filled out, hence the variable should be there.

(Seems like the tcp-script 'dumps' variables if it's not able to connect.)

____________________________________________
Jakob Peterh�nsel
Technical Engineer
Tel: +45 7022 1014
Fax: +45 7022 1013
Mob: +45�22 68 49 61
[EMAIL PROTECTED]
www.NetPoint.com

<<inline: image.tiff>>



The information contained in this message is confidential or protected by law.
If you are not the intended recipient, please contact the sender and delete this message. Any unauthorised copying of this message or unauthorised distribution of the information contained herein is prohibited.




Reply via email to