BMC Communities Banner

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
15 Replies Last post: Feb 26, 2003 11:23 AM by RobbieG77   1 2 Previous Next
RobbieG77 HotShot 247 posts since
Dec 28, 2000
Currently Being Moderated

Feb 24, 2003 5:05 PM

Getting value of text parameter

If I have a text parameter that contains text only can I pull the text of that parameter some how? I have tried to get it using the get("/".applicationclass."/"instance."/".parameter."/value); command with out any luck. Using that command I can get values on graphs but that's about it. Any ideas?

Thanks

Xpericon HotShot 399 posts since
Jul 29, 2002
Currently Being Moderated
1. Feb 25, 2003 2:05 AM in response to: RobbieG77

Robbie,

Nothing wrong with your example, the same method should work for a text parameter !
So there must be something else wrong ...

Can you give us a glimp of the code that populates the text parameter and the one that get's the value?

msharpe HotShot 190 posts since
Mar 22, 2001
Currently Being Moderated
3. Feb 25, 2003 9:49 PM in response to: RobbieG77

"
populate
set("../LOGAlarms/value", errdisp, unique(matchedline) ); #errodisp is a title and matchedline is text pulled from a log file.
"

Whoa...hold it Unless the unique(matchedline) returns a timestamp....and a recent one you will have problems here. The third argument of set() should be a timestamp in seconds past the epoch format. If your unique(matchedline) is textual it will evalute to 0 numerically...which would represent the epoch....Dec 1970....which is likely way outside your retention period for history even...and definately not the most recent value of this parameter.

Perhaps you meant

<br/>set&#40;&quot;../LOGAlarms/value&quot;, errdisp . &quot;\n&quot; . unique&#40;matchedline&#41; &#41;; <br/>

 

Xpericon HotShot 399 posts since
Jul 29, 2002
Currently Being Moderated
4. Feb 26, 2003 4:39 AM in response to: RobbieG77

Msharpe,

Aren't you talking about the batch_set() function instead of the set() function ?
Or is this un undocumented feature of the set() function, because I can't find any reference to a third parameter for the set() function (3.4 and 3.5 manual)?

Greetz,
Bert

msharpe HotShot 190 posts since
Mar 22, 2001
Currently Being Moderated
5. Feb 26, 2003 7:28 AM in response to: RobbieG77

The timestamp works on set() too. Thought we had that doc'ed now? Guess not. Will address that.

Geert De Peuter Expert 733 posts since
Dec 20, 1999
Currently Being Moderated
6. Feb 26, 2003 7:29 AM in response to: RobbieG77

Indeed, this is undocumented in the manual, but already documented in the devcon forum since 2000 ...

See :
http://communities.bmc.com/communities/thread/14530

-- Geert

Xpericon HotShot 399 posts since
Jul 29, 2002
Currently Being Moderated
7. Feb 26, 2003 8:32 AM in response to: RobbieG77

What's the difference with Batch_set() then ...

I could do a search offcourse, because I did see a topic about this function, but since we're on the topic anyway ;-)

Bert

Geert De Peuter Expert 733 posts since
Dec 20, 1999
Currently Being Moderated
8. Feb 26, 2003 8:45 AM in response to: RobbieG77

set() :  sets a single value, with a single call on a single namespace variable.

batch_set() : allows you to combine multiple set()'s in a single PSL instruction, wasting less resources.

This is just to prevent
set()
set()
set()
...
set()

Nothing more !

-- Geert

Geert De Peuter Expert 733 posts since
Dec 20, 1999
Currently Being Moderated
10. Feb 26, 2003 9:11 AM in response to: RobbieG77

Strange ...

Just to help us move forward on this, could you remove the timestamp from the set instruction (for now) ?

Also after you set the paramter - looks like you are doing it from another parameter - just do the following :

<br/>set&#40;&quot;../LOGAlarms/value&quot;, errdisp &#41;; <br/>parampath = &quot;/&quot;.get&#40;&quot;../../name&quot;&#41;.&quot;/&quot;.get&#40;&quot;../sid&quot;&#41;.&quot;/LOGAlarms/value&quot;;<br/>print&#40;&quot;TESTING print&#40;get&#40;&quot;.parampath.&quot;&#41;&#41;; = &quot;.get&#40;parampath&#41;.&quot;\n&quot;&#41;;<br/>



Now see what get's printed in the SOW and try the same get from %PSL

Let us know what happens.

-- Geert

msharpe HotShot 190 posts since
Mar 22, 2001
Currently Being Moderated
12. Feb 26, 2003 10:19 AM in response to: RobbieG77

I am really confused now Your original post shows that you are using three arguments for the set(). The third argument is meant to be a timestamp. You then indicated that the 3rd argument was a timestamp, and now you indicate that it is not? What is it? If the third argument to set() is not a timestamp I suspect that is causing the problem.

Geert De Peuter Expert 733 posts since
Dec 20, 1999
Currently Being Moderated
13. Feb 26, 2003 10:36 AM in response to: RobbieG77

Let's copy this in your even notification action for event 11.

I think that will explain what you have to use to get the data you want ...

<br/><br/># Retrieve event information in a &quot;safe&quot; way<br/>evstatus = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_STATUS&#125; <br/>END_OF_TEXT;<br/><br/>thetime = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_TIME&#125; <br/>END_OF_TEXT; <br/><br/>type = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_TYPE&#125; <br/>END_OF_TEXT; <br/><br/>node = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_NODE&#125; <br/>END_OF_TEXT; <br/><br/>origin = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_ORIGIN&#125; <br/>END_OF_TEXT; <br/><br/>desc = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_DESC&#125; <br/>END_OF_TEXT; <br/><br/>args = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_ARGS&#125; <br/>END_OF_TEXT; <br/><br/>name = &lt;&lt;&lt;END_OF_TEXT <br/>%&#123;EV_NAME&#125; <br/>END_OF_TEXT; <br/><br/>severity = &lt;&lt;&lt;END_OF_TEXT<br/>%&#123;EV_NSEVERITY&#125;<br/>END_OF_TEXT;<br/><br/># Extract the additional information from the event     <br/>alm_range = nthargf&#40;args,1,&quot;\t&quot;&#41;;<br/>arg2 = nthargf&#40;args,2,&quot;\t&quot;&#41;;<br/>arg3 = nthargf&#40;args,3,&quot;\t&quot;&#41;;<br/>arg4 = nthargf&#40;args,4,&quot;\t&quot;&#41;;<br/>alm_min = nthargf&#40;args,5,&quot;\t&quot;&#41;;<br/>evvalue = nthargf&#40;args,6,&quot;\t&quot;&#41;;<br/>alm_max = nthargf&#40;args,7,&quot;\t&quot;&#41;;<br/><br/>appl = nthargf&#40;arg4,1,&quot;.&quot;&#41;;<br/>inst = nthargf&#40;arg4,&quot;2-&quot;,&quot;.&quot;,&quot;.&quot;&#41;;<br/>parm = arg3;<br/><br/>global = &#40;arg2 == &quot;global&quot;&#41;;<br/>parampath = sprintf&#40;&quot;/%s/%s/%s&quot;,appl,inst,parm&#41;;<br/>paramstatus = get&#40;parampath.&quot;/status&quot;&#41;;<br/>value = get&#40;parampath.&quot;/value&quot;&#41;;<br/><br/># Show some information about this event<br/>data=sprintf&#40;&quot;ORIGIN=%s\n&quot;.<br/>             &quot;NAME=%s\n&quot;.<br/>             &quot;NODE=%s\n&quot;.<br/>             &quot;TYPE=%s\n&quot;.<br/>             &quot;TIME=%s\n&quot;.<br/>             &quot;SEVERITY=%s\n&quot;.<br/>             &quot;ALARM_RANGE#=%s\n&quot;.<br/>             &quot;ALARM_RANGE_DEFINITION=&#91;%s,%s&#93;\n&quot;.<br/>             &quot;PARAM STATUS=%s\n&quot;.<br/>             &quot;EVENT STATUS=%s\n&quot;.<br/>             &quot;NAMESPACE VALUE=%s\n&quot;.<br/>             &quot;VALUE IN EVENT=%s\n&quot;.<br/>             &quot;APPLICATION=%s\n&quot;.<br/>             &quot;INSTANCE=%s\n&quot;.<br/>             &quot;PARAMETER=%s\n&quot;.<br/>             &quot;PARAMETER_IS_GLOBAL=%s\n&quot;.<br/>             &quot;DESCRIPTION=%s\n&quot;,<br/>             origin,<br/>             name,<br/>             node,<br/>             type,<br/>             thetime,<br/>             severity,<br/>             alm_range,<br/>             alm_min,alm_max,<br/>             paramstatus,<br/>             evstatus,<br/>             value,<br/>             evvalue,<br/>             appl,<br/>             inst,<br/>             parm,<br/>             global,<br/>             desc<br/>             &#41;;<br/>             <br/>print&#40;data.&quot;\n&quot;&#41;;<br/><br/>print&#40;&quot;get&#40;\&quot;&quot;.parampath.&quot;/value\&quot;&#41;; = &quot;.value.&quot;\n&quot;&#41;;<br/><br/>



-- Geert

1 2 Previous Next

More Like This

  • Retrieving data ...