nv-l
[Top] [All Lists]

Re: Sample API code for DEC Unix in C

To: nv-l@lists.tivoli.com
Subject: Re: Sample API code for DEC Unix in C
From: James Shanks <James_Shanks@TIVOLI.COM>
Date: Mon, 30 Aug 1999 16:17:54 -0400
Bob -

I'm still pretty much in the dark about this sample you got from someone in
Tivoli -- I don't recognize it -- so I don't know what to tell you to do about
integrating it.  If you have to prove that NetView can be of use by writing
code, then you  have quite a task, since our assumption is that only very
experienced coders will be using our APIs.   We expect that you have read our
Programmer's Guide and Programmer's Reference, and have a good idea about what
you want to do.   You are right that filtertrap has no comments except what is
in the code.  The only other trick is that you must build the filter using the
filter editor (type "filtered" from the command line to invoke it) before you
can tell the filtertrap program to use it.

How about this for an approach?  Start out by sending an event from the command
line, and them build an additional action script, such as I described before, to
do something simple with it.  If you like what you get, then you can move on to
building a more complex app from there.

You can send an event from a command line using the event command or snmptrap.
Both have man pages that may help, so perhaps you can set up your button to do
that at a later time.    I urge you to play with event  (just typing "event"
will send a dummy Node Up to your events window, "event -h abc" will send a
dummy Node up from a bogus host called 'abc', and "event -e NDWN_EV -h abc" will
let you send a dummy Node Down from that node) and then tackle snmptrap.
snmptrap will let you send any trap you like, while event sends only NetView
traps.   But snmptrap syntax is harder to understand.  You have to specify the
trap variables in SNMP format yourself.   Here's an example, which sends a dummy
Interface Down trap.
 /usr/OV/bin/snmptrap  \
   'nv6ktst5.raleigh.ibm.com'  .1.3.6.1.4.1.2.6.3.1  \
   'james1'  6 58916867  1 \
   .1.1.0  Integer 2  \
   .1.2.0  OctetStringascii  "james1"  \
   .1.3.0  OctetStringascii  "Interface 123.456.789.01 down" \
   .1.4.0  OctetStringascii  "123.456.789.01"  \
   .1.5.0  OctetStringascii  "openview"

To get this example to work in your environment, change
'nv6ktst5.raleigh.ibm.com' to the name of your NetView box, and "james1"
to the name of some real host in your network.


Once you have the trap, then try to add an additional action script such as I
proposed before.   The sample in the man page for trapd.conf will get you
started.

Good luck

James Shanks
Tivoli (NetView for UNIX) L3 Support



Bob Stamm <Robert_Stamm@RES.RAYTHEON.COM> on 08/30/99 03:14:23 PM

Please respond to Discussion of IBM NetView and POLYCENTER Manager on NetView
      <NV-L@UCSBVM.UCSB.EDU>

To:   NV-L@UCSBVM.UCSB.EDU
cc:    (bcc: James Shanks/Tivoli Systems)
Subject:  Re: Sample API code for DEC Unix in C




Thanks for the response.  You seem to be a busy man on this server ... nice
work,

When I try to access the Redbooks I get URL errors and a message saying
they're reorganizing the
material.  Some of the redbooks you've listed in your earlier message I
can't get to.

You asked me to explain what I'm trying to do:

We received a evaluation copy (actually several) from Tivoli.  We're
(meaning me) are attempting to
show how we can integrate NetView into our current environment (a large Air
Traffic Control
System),  I have done much already and have omplemented a few test
applications successgully
but haven't messed with filtering traps.

I took one of the example pieces of code that draws a series of buttons in
a menu and allows you to
change a symbol's status on a submap.  This app I've been attempting to
augment to allow it to send
an event (initiated by a new button I'd add) and respond to it.  The
response might be just a printf
or perhaps the nifty banner you suggested earlier.

The goal is to demonstrate how I can filter a simple event and produce some
sort of input.  The task
seems simple enough but all I have to work with is whatever example and
document come with the
product (NetView for DEC Unix).

When I look at the filtertrap example it seems a little confusing (although
I just started looking at it)
and I'm not sure the relation of all the other examples found in that
directory to it.  The only
documentation on that function is whatever comments are found in its
C-code.

I need to initiate an event that can be demonstrated (that's where I
thought the button menu might
come in handy), see it received event log and then see some other action
occur (like a printf or
banner) by my app once that event is detected by NetView.






James Shanks <James_Shanks@TIVOLI.COM> on 08/27/99 06:21:11 PM

Please respond to Discussion of IBM NetView and POLYCENTER Manager on
      NetView <NV-L@UCSBVM.UCSB.EDU>

To:   NV-L@UCSBVM.UCSB.EDU
cc:    (bcc: Robert Stamm/RES/Raytheon/US)
Subject:  Re: Sample API code for DEC Unix in C




Bob -

There are coding samples in various old redbooks,
     GG24-4059-00   Examples of Using AIX NetView/6000 APIs
     GG24-4327-00   Examples of Using NetView for AIX
     SG24- 4515-00  Examples of  NetView for AIX Version 4
but they are specific to what the writers of those books wanted to achieve,
and
I am not sure how you would adapt any of them to what you want to do.
What
they say is all about AIX, because the books are older than the port to
DEC, but
the NetView APIs they use are available in DEC, thought some of the
AIX-specific
operating system functions may not be (such as trapgend and the errlog
functions).   Still you could look there to see what others have done.  But
there is no support for these sources either.

As for support for user coding, there isn't much.  You are basically on
your own
unless you want to get a contract with Tivoli Professional Services and
have
someone help you for a fee.

But I am still not clear what exactly you want to do.  You can trap an
event
with a ruleset or automatic action and have it kick off ovxecho to put up a
pop-up window.   This happens in the background without operator
intervention.
They only get involved to close the window.  Is that what you want to do
only
from a program?   The filtertrap sample is all about building an app which
uses
a filter to connect to trapd and get events.  You could build on this and
expand
it to issue the ovexcho command to put up the pop-up using the C system( )
function.    The sample just prints its results using printf.  Of course,
if you
are experienced with Xwindows programming, you could go all the way and put
up
your own window.

Or do you want an operator to select an event off the event window and
cause
something to happen as a result?  There is an interface provided for that.
It
is called an "Additional Action".  The man page for trapd.conf has a
lengthy
explanation about how you can build a command (could just be a script --
the
example is )  to be executed from a selected event or set of events when
the
operator pulls down Options --> Additional Actions from the event window
menu.
You build  your command, script or executable, and then use xnmtrap and
"Configure Additional Actions" to add it to the list NetView provides.  The
man
page tells you what your input will look like.   When everything is in
place
your operators simply select the event or events, pull down the menu, and
click
on your action, and it happens.

Hope this helps

James Shanks
Tivoli (NetView for UNIX) L3 Support



Bob Stamm <Robert_Stamm@RES.RAYTHEON.COM> on 08/27/99 05:22:48 PM

Please respond to Discussion of IBM NetView and POLYCENTER Manager on
NetView
      <NV-L@UCSBVM.UCSB.EDU>

To:   NV-L@UCSBVM.UCSB.EDU
cc:    (bcc: James Shanks/Tivoli Systems)
Subject:  Sample API code for DEC Unix in C




Is there any collection of sample code besides whats fround in the NetView
prg_samples
directory,  I'm part of a Raytheon Systems Company research project to
ddemonstrate the
capabilities of NetView in an Air Traffic Control System environment.

Currently I'm trying to figure out how to capture an event and post a
message on the display
using C and the API.  An event will do.  Using the prog_samples provided I
have a push button widget
I could use to initiate an event on the local machine at the GUI.  What we
have is code provided to
us by the Tivoli Federal Group's sales staff but no support really.
Therefore its hard to
demonstrate the capabilities of the product although I have created a few
apps so far.  For example
I can build a subma[p automatically from a API-based app that placed
symbols, unique to our setup in
a specific geometry on the map.

I just dont know where to go for help.

Thanks


<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web