[] = optional (x..y) = range | = one of the listed & = any number of the listed # = integral number "" = string (request) delimiters (can be constants or SNMP requests) '' = string (constant) delimeters optional ... = last command can be repeated
[debug alive|both] [version #version(1..2) | (useid | fullmenu | noconfirm | notimeout)] [retry #retries] [loaddll "extern.dll"] [appname "name"] [about #line(1..3) "text" ...] -- comment @ multi line comment @ menudef 'name' { popup 'popup' { graph 'menutext' 'table' [#interval] chart 'menutext' 'table' [#interval] table 'menutext' 'table' [#interval] edit 'menutext' 'table' history 'menutext' 'table' run 'menutext' 'filename' 'parameters' wrun 'menutext' 'filename' 'parameters' macro 'menutext' 'macro' set 'menutext' 'variable' 'value' rundll 'menutext' '!dllproc()' popup 'popup' { ... } } ... } ... hubdef { [useget | usenext] [chassis [x y] [bitmap 'bitmap']] [pollpersec #polls] [pollint #pause] [menus { 'menuname' ... }] [load "SNMP_variable" 'internal_variable' ...] [print x y 'string'] slotgroup { numslots # | [count] "numslot_request" & slotpos { <position> } slottype "slottype_request" { 'response' ... uses slotdef 'slotdefname' [bitmap 'bitmap']|[color 'color'] ... default uses slotdef 'slotdefname' [bitmap 'bitmap']|[color 'color'] fail uses slotdef 'slotdefname' [bitmap 'bitmap']|[color 'color'] } slotdef 'name' { [load "SNMP_variable" 'internal_slot_variable'] [print x y 'string'] [menus { 'menuname' ... }] [hotspot at x y size w h { menucommand 'table' ['value/params']}] portgroup { numports # | [count] "numport_request" & portpos { <position> } porttype "porttype_request" { 'response' ... uses portdef 'portdefname' [bitmap 'bitmap'] | built_in_type ... default uses portdef 'portdefname' [bitmap 'bitmap'] | built_in_type fail uses portdef 'portdefname' [bitmap 'bitmap'] | built_in_type } portdef 'name' { [print x y 'string'] [menus { 'menuname' ... }] [mouse { right { menucommand 'table' ['value/params'] } left { menucommand 'table' ['value/params'] } center { menucommand 'table' ['value/params'] } }] var "variable_request" { varpos { <position> } 'response' uses bitmap 'bitmap' ... change uses bitmap 'bitmap' default uses bitmap 'bitmap' fail uses bitmap 'bitmap' } } ... } ... } ... } ... }
In addition to these, BitView defines some special characters:
When a string is used in menu tables and parameters (not menu text), load,
numslots, slottype, numports, porttype, and var commands, these characters
are replaced. The dollar sign is a way of getting at internal variables.
The exclamation mark is used to call functions from a DLL.
The hash mark (pound sign) is used to collect indexes when using the count
flag on numslots and numports commands. The indexes returned are stored
internally along with the current slot/port and can be retrieved using the
dollar sign with the variable name. See either the numslots or numports
definitions for further explanation.
For instance:
porttype "198.92.129.1@!resolve_comm($slot):RFC1213-MIB|ifType.$port"
is a valid variable request for BitView.
Where the type of quotes comes into play is wher BitView will be doing
requests (load, numslots, slottype, numports, porttype, var). Double quotes
will do an SNMP query to the device, whereas a single quote string will
replace any internal variables and call any DLL procedures and return it's
value right away without going out to the device. This is again explained
where these requests are made.
See also: menudef,
load, numslots,
slottype, numports,
porttype, var.
n at x y [size w h] [select x y size w h] [bit b length l]
N is the index that will replace a $slot or $port in a request
string (make sure you are using the correct
version). X and Y are the coordinates where this
object should be (0,0 is in the upper left hand corner). All measurements
are in pixels. Slot positions are relative to the entire chassis picture
and port positions are relative to the slot they are in. Size is the area
that can be selected: width and height. Select will let you specify a
position and size that you can click on. If no sizes are provided,
BitView takes the dimensions of the port or slot type bitmap. This is
usefull if you are trying to get a 3d effect on the screen. You will want
a module to appear in orthagonal view, but you only want the face
selectable. All size measurements are ignored for variable positions since
indicators are not selectable. Bit and length will allow you to select
certain bit strings from a number. If you are taking bits from an
octet-string of q bytes, they will progress from 0 to 8*q-1 going from most
significant byte on the first byte to the least significant on the last.
If the value you are getting bits from is a number, the bits will follow
the PC mapping (from least to most significant). Bit is the offset to
start looking at and length is the number of bytes to take. Results will
be converted to base 10 for response comparison. Since
most faceplates have objects evenly spaced along them, there is a way to
define a group of positions sequentially.
sequence { n at x y [size w h] space x y count c
[select x y size w h] [bit b length l] }
N is the index to start with. X, Y, size, select, bit, and lenth
parameters are identical to the previous definition style. Count is the
number of times to repeat this object and space is the x and y offset
of each object. Both methods can be used interchangably. The following
is an example of a 13 port repeater that has 12 ports in a block and an
extra port on the side.
portpos {
sequence { 1 at 50 10 size 15 15 space 20 0 count 12 }
13 at 10 10 size 30 15
}
porttype "MAU-MIB|rpMauType.$slot.$port.1" {
...
}
See also: slotpos, varpos,
portpos, porttype,
slottype.
&
|
=
![]()
In this example case, it would have just been easier to include the gray
background in the BMP file itself and make it smaller
(
). The other extension, BLK, is to create
blinking lights. BitView will alternate between the BMP and BLK image on
each timer tick. Thus:
&
|
(
+
)
=
and
Again, it would be easier to just use smaller bitmaps:
(
and
). For each
image you will need a file with a BMP extension. So if you wanted a solid
green led and a blinking green led, you would need at least these files:
GREENLED.BMP (
),
BLINKLED.BMP (
),
and BLINKLED.BLK (
). Eventually, instead of
using files, you will be able to get your bitmaps out of a
DLL.
set 'Set SysName dialog' 'sysName.0' '!mydlg()'
or
set "Enable Port" "slotStatusVar.$slot" "!PortCode(on)"
set "Disable Port" "slotStatusVar.$slot" "!PortCode(off)"
Another might be a repeater that has non-standard slot numbering. You
could do this:
porttype "MY-MIB|rptrGroupType.!findslot().$port"
This will allow you to look up the the correct slot number and
return it to BitView which will do the request. I could go on listing
examples for days, but this is a very powerful command and the possiblities
are endless. This is an advanced feature and you should only use it if
you are familiar with windows programming and DLL programming. The
function definition should be:
int far pascal DllProc(HINSTANCE hInst, HWND hWnd, char *dest,
char *node, int sg, int slot, int pg, int port, char *data);
When BitView calls your function, it will pass it's instance and window
handle. Any window related functions you do (CreateWindow/CreateDialog)
will have to use BitView's instance, not the DLL's instance (this is just
a Windows thing). Also, you have to make you code re-entrant since multiple
copies of bitview can run at the same time. You can use either the instance
or window as a session handle if you need one since they will be unique to
an instance of BitView. Any text in the parentheses will be passed verbatim
to your function in the data parameter. Do not include any extra close
parentheses in here. Node is the node name that bitview is running with.
SG and PG are the slot group and port group associated with this call
indexed from 1. Slot and Port are the current slot and port as taken from
slotpos and portpos. The
string you want substituted in the original request should be returned in
"dest". Dest is an array of 256 characters. You should return non zero if
your function is successful. If you return a 0, BitView will display an
error message box if there is text returned in data. Here is an example
function in C.
int far pascal
PortCode(HINSTANCE hInst, HWND hWnd, char *dest, char *node,
int sg, int slot, int pg, int port, char *data)
{
if (port==0) {
strcpy(dest,"You must select a port."); // since a port must be
return (0); // selected for this, print
// this error message.
} else {
if (!strcmp(data,"on")) // special number that must be
sprintf(dest,"%d",2*port); // set. based on the port
else if (!strcmp(data,"off")) // number. evens turn port on,
sprintf(dest,"%d",2*port+1); // odds turn port off
else {
strcpy(dest,"Parameter must be either 'on' or 'off'.");
return (0);
}
}
return (1);
}
This command is optional and if used, must appear at the top level.
See also: string, rundll.
hubdef {
menus { 'main' } -- main
slotdef {
menus { 'slot' } -- main + slot
portdef {
menus { 'port' } -- main + slot + port
}
}
}
With the fullmenu feature you can do this:
hubdef {
menus { 'main' } -- main
slotdef {
menus { 'slotmain' } -- slotmain
portdef {
menus { 'slotmain' 'port' } -- slotmain + port
}
}
}
Noconfirm will not ask the user yes or no for any set commands. Notimeout
will not inform the user when the timeout's occur, but instead it will
create a fail state in whatever was polling.
When the version was first introduced, it took a number as an argument,
either one or two. One was the normal bitview and two used the new
features. This does not let you select the features you want and the only
reason it was included was for backward compatibility. Version 2 is
equivalent to the fullmenu and useid flags.
This command is optional and if used, must appear at the top level.
See also: slotpos, varpos,
portpos, menus.
The windows menu strucure is based on popup menus and menu items. Popups
appear as items accross the windows menu bar and as pull asides in the
menu body. You can have as many popup menus as you want, but you should
take into account that if the menus extend wider than the window, they
will wrap around.
This will start a real time graph on the table listed in the SNMPc MDI
window. If a number is supplied, SNMPc will take that as the poll
interval instead of asking the user.
graph 'Graph Port Traffic' 'RFC1213-MIB|IfEntry.$port' 1
This will start a real time chart on the table listed in the SNMPc MDI
window. If a number is supplied, SNMPc will take that as the poll
interval instead of asking the user.
chart 'Chart Port Traffic' 'RFC1213-MIB|IfEntry.$port' 1
This will start a real time table display on the table listed in the
SNMPc MDI window. If a number is supplied, SNMPc will take that as the
poll interval instead of asking the user.
table 'Display Routing Table' 'RFC1213-MIB|IpRouteEntry' 10
This will bring up a table entry on the table listed.
edit 'Edit System Info' 'RFC1213-MIB|SystemInfo'
This will bring up the History Edit dialog box with the table listed.
The user must then select an interval, thresholds and poll interval.
history 'Save Port Traffic' 'RFC1213-MIB|IfEntry.$port'
This will tell SNMPc to run the program for that node. SNMPc looks for
the program in the apiexec directory and will use the node name and
window handle for the first two command line arguments. This can be used
to spawn new bitviews. Since the third argument can be a forced script
file, you chould have the default script be a chassis view. Then when
you selected a slot, you could have a menu item to zoom in on the slot
with your slot script. Notice in this example, the current slot was also
passed to the new BitView. In the slotdef.bit file, wherevever you would
normally use a $slot, you would use $arg1 and it would get the slot to
use from the command line.
run 'Zoom In' 'bitview.exe' 'slotdef.bit $slot'
This is similar to the run command except you can
specify a full path name and no default arguments are appended. To
simulate a run command you could use "$node $win" as the parameters.
run 'My Telnet' 'c:\tcpip\telnet.exe' '$addr 23'
This will execute an SNMPc macro file (see SNMPc Reference Guide, chapter
6-Customizing SNMPc on how to create macro files).
macro 'Upload Bridge Filter Table' 'brgdata.mac'
This is used to send a set to a device. BitView will prompt the user to
make sure they want to do the set. If the set fails, an error will be
displayed. By default a set will use the write community string defined
in the map, but this can be over written with the colon character in the
variable string.
set 'Disable Port' 'SNMP-REPEATER-MIB|rptrPortOperStatus.$slotport' 'down'
Basically, this just does a character replacement on the
string and returns. It is up to your DLL to
display any message boxes or to do any SNMP functions.
rundll 'Login to device' '!login($setcomm)'
load "MY-MIB|readCommunityName.0" 'community'
Now wherever you did requests in your script, you could use "$community:" in
front of the variable to use the community name you read in. An example of
a slotdef load is:
load "MY-MIB|slotStatusVar.$slot" 'slotstatus'
Now for the port status, instead of doing requests for each port, you would
use a single quote string (no SNMP request) to
indicate status.
var '$statusvar' {
varpos {
1 at 50 20 bit 0 len 2 2 at 60 20 bit 2 len 2
3 at 70 20 bit 4 len 2 4 at 80 20 bit 6 len 2
}
"0" uses bitmap "status1.bmp"
"1" uses bitmap "status2.bmp"
"2" uses bitmap "status3.bmp"
"3" uses bitmap "status4.bmp"
}
numslots count "RFC1213-MIB|ifIndex.#portid"
This will see how many interfaces there are, and save each of the indexes
in an internal variable "portid" that can be used like this:
slottype "RFC1213-MIB|ifType.$portid" { ...
slottype "MY-MIB|slotType" {
"UTP" uses slotdef "def1" bitmap 'mydir\slotpic1.bmp'
"COAX" uses slotdef "def2" bitmap 'bitmap\slotpic2.bmp'
}
hotspot at 10 50 size 20 20 {
SET "MY-MIB|portAdminStatus.$slot.$port" "enabled"
}
mouse {
LEFT { GRAPH "RFC1213-MIB|IfEntry.1" }
RIGHT { CHART "RFC1213-MIB|IfEntry.1" }
}
var "MY-MIB|portAdminStatus.$slot.$port" {
varpos {
1 at 10 50
2 at 20 50
3 at 30 50
4 at 40 50
}
"on" uses bitmap "mydir\porton.bmp"
"off" uses bitmap "mydir\porton.bmp"
}