To create a new configuration file that customizes a context menu
Example custom context menu files
Display device CDP connections
Create device SNMP dump
Polling control of devices
Run port utilization trend report
Display routing table
Raise synthetic events
Launch a URL from the Entuity client
User menu hierarchy using ping example
Application of instance custom menu
Launch a user action from an event
In Entuity, you can customize context menus to add extra items that are not there as standard. This means that you can customize the Entuity UI to better suit the way in which you manage your network.
You can customize a context menu with two types of action:
- launch URLs to access new pages in the UI, typically in a new tab.
- cause actions to happen on the relevant server, e.g. if you are in a multi-server environment, the context menu action would cause an action to happen on whichever server the selected component/s is/are on.
Customizing context menu items for a View is more complicated than for other types of managed object, because Views can be spread across multi-server environments. Typically, these would be invoked within the Data Management Kernel.
Because the process of customizing context menus requires back-end file editing, it is recommended that you contact Entuity Support if you would like to customize them.
To customize a context menu:
Context menus are determined by configuration files in entuity_home/etc.
- Create a new configuration file (see below) and save it to entuity_home/etc.
- Open sw_menu_def_site_specific.cfg and add the name of the file containing the custom context menu configuration. You must prepend the file name with a "!".
- Open the Entuity UI. Entuity automatically discovers new menu configuration files, which means that you don't need to shut down and restart Entuity. Note, there may be a delay of several minutes before the changes are reflected in the UI, and it may help to log out and then log back in again.
Note, in a multi-server deployment, you will need to apply the menu configurations to the consolidation server and all the remote servers.
To create a new configuration file that customizes a context menu:
Each action of a context menu item is specified through its own individually-named section in a configuration file. For example, the Ping_Device_Client section defines a custom menu that runs from the Entuity server and pings the device selected from Entuity (note, this example is only for use on a Windows server):
[MenuItem Ping_Device_Server]
displayName=At Server
actionMethod=simple;"ping.exe"
actionArguments=simple;
= variable newobj=DeviceEx(getObject(head(var.objList).swObjectId));
= [ newobj.name ]
actionLocation=Server
actionOutput=Yes
actionType=Exec
parentMenuItem=Ping_Device
supportedApps=webUI
toolGroups=Show User Menus
itemPosition=0
supportedTypes=device
selectionLimit=1
actionTimeout=30000
filter=simple;1
where:
Parameter | Description |
---|---|
MenuItem |
unique name of each menu item. The MenuItem:
|
displayName | menu item name displayed in the context menu UI. |
parentMenuItem |
references the menu item below which this current menu item is displayed.
Note, a parent menu item must not have an associated action. It must only be used to hold child menu items (to improve the organization of your menu structure). |
selectionLimit | maximum number of UI selections supported by a single invocation of a menu item action. E.g., some commands, such as ping or SNMPwalk, only act on one object at a time, and so the user should only be able to select one device from the web UI. |
itemPosition | position of the menu item within the list of menu items. When two items are given the same position, Entuity will sort them alphanumerically. |
SupportedApps | comma-separated list of Entuity client applications for which the menu item applies, e.g. webUI, Remedy. |
toolGroups |
determines accessibility based on group permissions:
|
actionMethod | action associated with the menu item, e.g. the application to run or the URL called. Actions are specified using the Entuity Statement Language. |
actionArguments | arguments passed to the action. Arguments are specified using the Entuity Statement Language. |
actionLocation | location where the action is performed, e.g. Server for the Entuity client server. |
actionOutput |
identifies how the output of the Entuity client is handled:
|
actionType |
type of menu item action:
|
actionTimeoutc | maximum elapsed time, in milliseconds, allowed for the action to execute. Entuity terminates the action process, and releases all associated resources, when the timeout period is exceeded. |
supportedTypes | comma-separated list of StormWorks object types supported by item- and instance-based menu items. Type hierarchy is taken into account such that further derived types are included unless their exclusion is specifically listed. E.g., the list port, !wanPort includes all the port types, i.e. port, portEx, llport, frport, atmport, with the exception of wanPorts. |
Filter | optional attribute containing StormWorks Simple Statement Language method, which controls visibility of instance-based menu item. |
supportedEventTypes |
comma-separated list of incident and event identifiers supported by event-based menu items. You can specify event types using:
|
Types of menu items:
- Type - these items are associated with StormWorks object types. They are only available when the selected object(s) corresponds with their supported object type list. For example, a type menu item can be configured to display only when the current context is a device.
- Instance - these items are linked to specific instances of a StormWorks object type. They are only available when the selected object(s) match the supported object(s). For example, an instance menu item can be configured to display only when the current context is that of the particular device specified.
- Event - these items are associated with specific event types. When events of those types are raised in EMS and selected, then these Event-based menu items are available.
Entuity recommend placing Instance based menu items under a parent item. Whether an Instance based item is available is dependent on the current context matching the supported objects. Applying this filter can cause a slight delay as the Entuity server must perform the check, so placing it within a parent menu item ensures it is only called when required.
Example custom context menu files:
Create services
Description: creates a hierarchy of services for a View.
Context: View.
Details: when executed for a View, a service called "<VIEW_NAME> on <SERVER_NAME>" is created in that View.
[MenuItem Custom_Service_Creation]
displayName=Create Site Services
parentMenuItem=
itemPosition=100
supportedApps=webUI
toolGroups=Admin Only
actionMethod=simple;
= variable serverName = var.eyeServer;
= variable userName = var.userId;
= foreach(var.objList,
= variable swObject = this;
= variable viewPath = swObject.viewName;
= variable viewObj = get_view(viewPath);
= variable topServiceObj = eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " on ", serverName), 1, 0, 0, 1, 0, 0, 0, "", viewObj.viewId, null, userName, 0, null));
= variable circuitsServiceObj = eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Circuits"), 4, 2, 1, 1, 0, 0, 0, "", null, topServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Backup Circuit"), 1, 0, 0, 1, 0, 0, 0, "", null, circuitsServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Primary Circuit"), 1, 0, 0, 1, 0, 0, 0, "", null, circuitsServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Network Security"), 1, 0, 0, 1, 0, 0, 0, "", null, topServiceObj.id, userName, 0, null));
= variable tunnelsServiceObj = eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Tunnels"), 1, 0, 0, 1, 0, 0, 0, "", null, topServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Backup Tunnels"), 4, 2, 1, 1, 0, 0, 0, "", null, tunnelsServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Primary Tunnels"), 4, 2, 1, 1, 0, 0, 0, "", null, tunnelsServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Wireless"), 4, 2, 1, 1, 0, 0, 0, "", null, topServiceObj.id, userName, 0, null));
= eval(viewObj, viewObj, create_service(concat(viewObj.viewName, " Servers"), 1, 0, 0, 1, 0, 0, 0, "", null, topServiceObj.id, userName, 0, null))
= );
= "javascript:euif.appCtx().showInformation(ebase.SMessage('Site Services have been successfully created'))"
actionArguments=simple;[]
actionLocation=Client
actionOutput=Url
actionType=Echo
actionTimeout=30000
selectionLimit=100
supportedTypes=view
filter=simple;true
Display device CDP connections
Description: displays a list of ports that are connected to other Cisco devices
Context: fully managed device
Details: for Cisco devices, a list of ports that have been discovered to be connected to other Cisco devices using CDP is displayed along with the remote device and port description
Capabilities demonstrated: shows how statement language can be used to build a list of selected details. This list is then displayed in an HTML formatted table in a popup dialog.
[MenuItem CDP Connections]
displayName=Show CDP Connections
parentMenuItem=
itemPosition=0
supportedApps=webUI
toolGroups=Show User Menus
actionMethod=simple;
= variable serverId = get_config_var("server.Id");
= variable swObject = head(var.objList);
= variable objectId = swObject.swObjectId;
= variable deviceObj = DeviceEx(getObject(objectId));
= variable localDeviceName = deviceObj.name;
= variable portList = foreach(deviceObj.ref.ports, this, head(ref.portTopoNode.ref.portTopoNodeCdpPeers)!=null);
= concat(
= "<H1>CDP connections from ", localDeviceName, "</H1>",
= "<div style=\"white-space: nowrap; overflow: auto; height: 300px;\"><br><br><table border=\"1\" style=\"width:100%\">",
= "<th>Local Port</th>",
= "<th>Remote Device</th>",
= "<th>Remote Port</th>",
= concat(foreach(portList,
= (
= variable remotePortObj=head(portEx(this).ref.portTopoNode.ref.portTopoNodeCdpPeers).ref.port;
= variable localPort=portEx(this).ifDescr;
= variable remoteDevice=remotePortObj.portDeviceName;
= variable remotePort=remotePortObj.ifDescr;
= concat(
= "<tr>",
= "<td>",localPort,"</td>",
= "<td>",remoteDevice,"</td>",
= "<td>",remotePort,"</td>",
= "</tr>"
= )
= )
= )),
= "</table><br></div>"
= )
actionArguments=simple;[]
actionLocation=Client
actionOutput=Yes
actionType=Echo
actionTimeout=30000
selectionLimit=1
supportedTypes=device
filter=simple;true
Create device SNMP dump
Description: create an snmpdump file that can be sent to Entuity Support when requesting a device to be certified
Context: SNMP managed device
Details: the snmpdump utility is executed on the server that is managing the device. The dump is performed using SNMPv2c and the same community string used to manage it is used. The output file is written to the log directory using the name of the device and the “.txt” extension.
Capabilities demonstrated: on command running an executable on the Entuity server. Using a shell or command prompt to allow a file to be written to. Using the completion popup to indicate when an operation that can take several seconds/minutes has completed. A timeout of 5 minutes (300,000 ms) is used and will auto-terminate the operation if it is exceeded.
Linux:
[MenuItem Device_Snmpdump]
displayName=Run snmpdump
parentMenuItem=
itemPosition=1
supportedApps=webUI
toolGroups=
actionMethod=simple; "/bin/sh"
actionArguments=simple;
= variable obj=DeviceEx(getObject(head(var.objList).swObjectId));
= [ "-c", concat(get_config_var("ENTUITY_HOME"), "/lib/tools/snmpdump -v2c -c ", obj.snmpCommunity, " ", obj.name, " > ", get_config_var("ENTUITY_HOME"), "/log/", obj.name, ".txt") ]
actionLocation=Server
actionOutput=Yes
actionType=Exec
actionTimeout=300000
selectionLimit=1
supportedTypes=device
Windows:
[MenuItem Device_Snmpdump]
displayName=Run snmpdump
parentMenuItem=
itemPosition=1
supportedApps=webUI
toolGroups=
actionMethod=simple; "cmd"
actionArguments=simple;
= variable obj=DeviceEx(getObject(head(var.objList).swObjectId));
= [ "/c", concat(get_config_var("ENTUITY_HOME"), "\\lib\\tools\\snmpdump -v2c -c ", obj.snmpCommunity, " ", obj.name, " > ", get_config_var("ENTUITY_HOME"), "\\log\\", obj.name, ".txt") ]
actionLocation=Server
actionOutput=Yes
actionType=Exec
actionTimeout=300000
selectionLimit=1
supportedTypes=device
Polling control of devices
Description: enable/disable the SNMP polling of one or multiple devices
Context: device (one or multiple)
Details: the Poll Status attribute of the selected device(s) is set for those selected devices that are SNMP polled. Use on non-SNMP managed devices results in a helpful error message.
Capabilities demonstrated: overriding the setting of an editable attribute. Handling multiple selected components. Handling situations where an operation may not be valid for all selected components.
[MenuItem POLLING_CONTROL]
displayName=Enable/Disable SNMP polling
parentMenuItem=
itemPosition=0
supportedApps=webUI
toolGroups=Admin Only
actionMethod=simple;""
actionArguments=simple;[]
actionLocation=N/A
actionOutput=N/A
actionType=N/A
actionTimeout=30000
selectionLimit=2000
supportedTypes=BasicDevice
filter=
[MenuItem DISABLE_POILLING]
displayName=Disable SNMP polling
parentMenuItem=POLLING_CONTROL
itemPosition=1
supportedApps=webUI
toolGroups=Admin Only
actionMethod=simple;
= foreach(var.objList,
= variable objId = this.swObjectId;
= variable deviceObj = BasicDevice(getObject(objId));
= eval (deviceObj, deviceObj, set_object_attrib("pollStatus", 1, 1)),
= getObject(this.swObjectId).isa(DeviceEx));
= variable succeeded=count(foreach(var.objList,1,getObject(this.swObjectId).isa(DeviceEx)));
= variable failuresList=foreach(foreach(var.objList,getObject(this.swObjectId)),BasicDevice(this).name,not(this.isa(DeviceEx)) && this.isa(BasicDevice));
= variable failures=join(failuresList,"\n");
= variable failed=count(failuresList);
= concat("Successfully disabled polling on ",succeeded," device(s)\n",if((failed > 0), concat("Failed to disable polling on the following ",failed," device(s):\n\n",failures,"\n\nNote that devices must be fully managed for polling controls to be available\n"), ""))
actionArguments=simple;[]
actionLocation=Server
actionOutput=Yes
actionType=Echo
actionTimeout=30000
selectionLimit=2000
supportedTypes=BasicDevice
filter=
[MenuItem ENABLE_POILLING]
displayName=Enable SNMP polling
parentMenuItem=POLLING_CONTROL
itemPosition=2
supportedApps=webUI
toolGroups=Admin Only
actionMethod=simple;
= foreach(var.objList,
= variable objId = this.swObjectId;
= variable deviceObj = BasicDevice(getObject(objId));
= eval (deviceObj, deviceObj, set_object_attrib("pollStatus", 0, 0)),
= getObject(this.swObjectId).isa(DeviceEx));
= variable succeeded=count(foreach(var.objList,1,getObject(this.swObjectId).isa(DeviceEx)));
= variable failuresList=foreach(foreach(var.objList,getObject(this.swObjectId)),BasicDevice(this).name,not(this.isa(DeviceEx)) && this.isa(BasicDevice));
= variable failures=join(failuresList,"\n");
= variable failed=count(failuresList);
= concat("Successfully enabled polling on ",succeeded," device(s)\n",if((failed > 0), concat("Failed to enable polling on the following ",failed," device(s):\n\n",failures,"\n\nNote that devices must be fully managed for polling controls to be available\n"), ""))
actionArguments=simple;[]
actionLocation=Server
actionOutput=Yes
actionType=Echo
actionTimeout=30000
selectionLimit=2000
supportedTypes=BasicDevice
filter=
Run port utilization trend report
Description: display the forward trend prediction for port utilization
Context: port
Details: runs a Port Utilization Trend report for the selected port and displays the results in a new tab
Capabilities demonstrated: launching a report in the context of a selected component. Redirecting the report output to a new browser tab.
[MenuItem PortUtilTrendReport]
displayName=Show Util Trend Report
parentMenuItem=
selectionLimit=1
itemPosition=0
supportedApps=webUI
toolGroups=Show User Menus
actionMethod=simple;
= variable swObject = head(var.objList);
= variable objId=swObject.swObjectId;
= variable portDevObjId=port(getObject(objId)).ref.device.id;
= variable serverId = get_config_var("server.Id");
= variable serverObjectId = concat(serverId, ":", portDevObjId);
= concat("/webUI/jasperReport.do?format=HTML&report=%2Freports%2FActivity%2FPortUtilTrend&autoRun=1&eyeServer=",
= encode_uri_component(serverId),
= "&view=All%20Objects&serverDeviceId=",
= encode_uri_component(serverObjectId),
= "&deviceListType=All&allowAllDevices=false&portId=",
= objId,
= "&portList=&timeFrame=prev%3A8w&primeTime=Sun%3ASun%400%3A0&reportGenerationId=&framework=0&eyeTarget=_blank")
actionArguments=simple;[]
actionLocation=Client
actionOutput=Url
actionType=Echo
actionTimeout=30000
supportedTypes=port
filter=simple;1
Display routing table
Description: obtains and displays the routing table contents directly from a router
Context: fully managed device
Details: performs an on-demand SNMP walk of the routing table and displays the contents in an HTML formatted table in a popup dialog. Long tables are handled using a combination of pagination and an SNMP getnext capability to continue the walk if the table is extremely long.
Capabilities demonstrated: on-demand SNMP polling and table walking. Issuing SNMP getnext requests to continue a table walk. HTML formatting of a table in a popup dialog.
[MenuItem Routing_Table]
displayName=Routing Table
actionMethod=
actionArguments=
actionLocation=N/A
actionOutput=N/A
actionType=N/A
parentMenuItem=
itemPosition=0
supportedApps=webUI
toolGroups=Show User Menus
actionTimeout=30000
supportedTypes=DeviceEx
filter=simple;1
[MenuItem Routing_Table_Start]
displayName=Start...
parentMenuItem=Routing_Table
selectionLimit=1
supportedApps=webUI
toolGroups=Show User Menus
itemPosition=0
actionMethod=simple;
= variable userName = var.userId;
= variable routeType = [ "unknown", "other", "invalid", "direct", "indirect" ];
= variable devObject = DeviceEx(getObject(head(var.objList).swObjectId));
= variable stashKeyPage = concat("routingTableMenu-page-",userName,"-",devObject.id);
= variable stashKeyPageInfo = concat("routingTableMenu-page-info-",userName,"-",devObject.id);
= variable batchSize = 100;
= variable start = 0;
=
= variable data = eval(devObject, devObject,
= snmp_get_table(1, [".1.3.6.1.2.1.4.21.1.1",
= ".1.3.6.1.2.1.4.21.1.7",
= ".1.3.6.1.2.1.4.21.1.2",
= ".1.3.6.1.2.1.4.21.1.10",
= ".1.3.6.1.2.1.4.21.1.3",
= ".1.3.6.1.2.1.4.21.1.4",
= ".1.3.6.1.2.1.4.21.1.11",
= ".1.3.6.1.2.1.4.21.1.8"],
= start,
= batchSize)
= );
=
= stash_put(stashKeyPage, 1);
= variable endMessage = if(count(data[1]) == batchSize,
= (stash_put(stashKeyPageInfo, [{1,"0"}, {2,lastValid(data[1])[0]}]); ""),
= (stash_put(stashKeyPageInfo, [{1,"0"}]); "End of routing table")
= );
=
= variable displayNumberMsg = if(count(data[1]) > 0, concat("Showing rows 1 to ", count(data[1])), "No rows to show");
=
= concat(
= "<div style=\"white-space: nowrap; overflow: auto; height: 300px;\"><br>Page 1<br>",displayNumberMsg,"<br><br><table border=\"1\" style=\"width:100%\">",
= "<th>Line</th>",
= "<th>Destination</th>",
= "<th>Next Hop</th>",
= "<th>Interface</th>",
= "<th>Route Age</th>",
= "<th>Metric 1</th>",
= "<th>Metric 2</th>",
= "<th>Network Mask</th>",
= "<th>Routing Type</th>",
= concat(foreach(data[1],
= (
= variable ipRouteDest = ipv4_to_string(this[1]);
= variable ipRouteNextHop = ipv4_to_string(this[2]);
= variable ipRouteIfIndex = (variable index = this[3]; try(trim(portEx(head(find(devObject.ref.ports,concat("simple; convert(port(this).portIndex.ifIndex, string) == convert(",index,",string)"), true))).ifDescr), index));
= variable ipRouteAge = this[4];
= variable ipRouteMetric1 = this[5];
= variable ipRouteMetric2 = this[6];
= variable ipRouteMask = ipv4_to_string(this[7]);
= variable ipRouteType = routeType[int32(this[8])];
= concat(
= "<tr>",
= "<td>",position+1,"</td>",
= "<td>",ipRouteDest,"</td>",
= "<td>",ipRouteNextHop,"</td>",
= "<td>",ipRouteIfIndex,"</td>",
= "<td>",ipRouteAge,"</td>",
= "<td>",ipRouteMetric1,"</td>",
= "<td>",ipRouteMetric2,"</td>",
= "<td>",ipRouteMask,"</td>",
= "<td>",ipRouteType,"</td>",
= "</tr>"
= )
= )
= )),
= "</table><br>Page 1<br>",displayNumberMsg,"<br>",endMessage,"</div>"
= )
actionArguments=simple;[]
actionLocation=Server
actionOutput=Yes
actionType=Echo
actionTimeout=30000
supportedTypes=DeviceEx
filter=
[MenuItem Routing_Table_Next]
displayName=Next...
parentMenuItem=Routing_Table
selectionLimit=1
supportedApps=webUI
toolGroups=Show User Menus
itemPosition=1
actionMethod=simple;
= variable userName = var.userId;
= variable routeType = [ "unknown", "other", "invalid", "direct", "indirect" ];
= variable devObject = DeviceEx(getObject(head(var.objList).swObjectId));
= variable stashKeyPage = concat("routingTableMenu-page-",userName,"-",devObject.id);
= variable stashKeyPageInfo = concat("routingTableMenu-page-info-",userName,"-",devObject.id);
= variable batchSize = 100;
= variable pageInfo = stash_get(stashKeyPageInfo);
= variable page = if(stash_get(stashKeyPage) == count(pageInfo),stash_get(stashKeyPage),stash_get(stashKeyPage) + 1);
= variable start = struct(list(pageInfo)[int32(page-1)])[1];
=
= variable data = eval(devObject, devObject,
= snmp_get_table(1, [".1.3.6.1.2.1.4.21.1.1",
= ".1.3.6.1.2.1.4.21.1.7",
= ".1.3.6.1.2.1.4.21.1.2",
= ".1.3.6.1.2.1.4.21.1.10",
= ".1.3.6.1.2.1.4.21.1.3",
= ".1.3.6.1.2.1.4.21.1.4",
= ".1.3.6.1.2.1.4.21.1.11",
= ".1.3.6.1.2.1.4.21.1.8"],
= start,
= batchSize)
= );
=
= variable endMessage =
= if(count(data[1]) == batchSize,
= (
= stash_put(stashKeyPage,page);
= stash_put(stashKeyPageInfo,list_union(pageInfo,[{page+1,lastValid(data[1])[0]}]));
= ""
= ),
= if(count(data[1]) > 0,(stash_put(stashKeyPage,page); "End of routing table"),"End of routing table")
= );
=
= variable startRow = (page - 1) * batchSize;
= variable displayNumberMsg = if(count(data[1]) > 0, concat("Showing rows ",startRow+1," to ", startRow + count(data[1])), concat("Shown ",startRow+1," rows. No more to show"));
=
= concat(
= "<div style=\"white-space: nowrap; overflow: auto; height: 300px;\"><br>Page ",page,"<br>",displayNumberMsg,"<br><br><table border=\"1\" style=\"width:100%\">",
= "<th>Line</th>",
= "<th>Destination</th>",
= "<th>Next Hop</th>",
= "<th>Interface</th>",
= "<th>Route Age</th>",
= "<th>Metric 1</th>",
= "<th>Metric 2</th>",
= "<th>Network Mask</th>",
= "<th>Routing Type</th>",
= concat(foreach(data[1],
= (
= variable ipRouteDest = ipv4_to_string(this[1]);
= variable ipRouteNextHop = ipv4_to_string(this[2]);
= variable ipRouteIfIndex = (variable index = this[3]; try(trim(portEx(head(find(devObject.ref.ports,concat("simple; convert(port(this).portIndex.ifIndex, string) == convert(",index,",string)"), true))).ifDescr), index));
= variable ipRouteAge = this[4];
= variable ipRouteMetric1 = this[5];
= variable ipRouteMetric2 = this[6];
= variable ipRouteMask = ipv4_to_string(this[7]);
= variable ipRouteType = routeType[int32(this[8])];
= concat(
= "<tr>",
= "<td>",startRow+position+1,"</td>",
= "<td>",ipRouteDest,"</td>",
= "<td>",ipRouteNextHop,"</td>",
= "<td>",ipRouteIfIndex,"</td>",
= "<td>",ipRouteAge,"</td>",
= "<td>",ipRouteMetric1,"</td>",
= "<td>",ipRouteMetric2,"</td>",
= "<td>",ipRouteMask,"</td>",
= "<td>",ipRouteType,"</td>",
= "</tr>"
= )
= )
= )),
= "</table><br>Page ",page,"<br>",displayNumberMsg,"<br>",endMessage,"</div>"
= )
actionArguments=simple;[]
actionLocation=Server
actionOutput=Yes
actionType=Echo
actionTimeout=30000
supportedTypes=DeviceEx
filter=simple;
= variable userName = var.userId;
= variable devObject = DeviceEx(getObject(head(var.objList).swObjectId));
= variable stashKeyPage = concat("routingTableMenu-page-",userName,"-",devObject.id);
= stash_exists(stashKeyPage) && stash_get(stashKeyPage) > 0
[MenuItem Routing_Table_Prev]
displayName=Prev...
parentMenuItem=Routing_Table
selectionLimit=1
supportedApps=webUI
toolGroups=Show User Menus
itemPosition=2
actionMethod=simple;
= variable userName = var.userId;
= variable routeType = [ "unknown", "other", "invalid", "direct", "indirect" ];
= variable devObject = DeviceEx(getObject(head(var.objList).swObjectId));
= variable stashKeyPage = concat("routingTableMenu-page-",userName,"-",devObject.id);
= variable stashKeyPageInfo = concat("routingTableMenu-page-info-",userName,"-",devObject.id);
= variable batchSize = 100;
= variable page = if(stash_get(stashKeyPage) < 2,1,stash_get(stashKeyPage) - 1);
= variable pageInfo = stash_get(stashKeyPageInfo);
= variable start = struct(list(pageInfo)[int32(page-1)])[1];
=
= variable data = eval(devObject, devObject,
= snmp_get_table(1, [".1.3.6.1.2.1.4.21.1.1",
= ".1.3.6.1.2.1.4.21.1.7",
= ".1.3.6.1.2.1.4.21.1.2",
= ".1.3.6.1.2.1.4.21.1.10",
= ".1.3.6.1.2.1.4.21.1.3",
= ".1.3.6.1.2.1.4.21.1.4",
= ".1.3.6.1.2.1.4.21.1.11",
= ".1.3.6.1.2.1.4.21.1.8"],
= start,
= batchSize)
= );
=
= stash_put(stashKeyPage,page);
=
= variable startRow = (page - 1) * batchSize;
= variable displayNumberMsg = concat("Showing rows ",startRow+1," to ", startRow + count(data[1]));
=
= concat(
= "<div style=\"white-space: nowrap; overflow: auto; height: 300px;\"><br>Page ",page,"<br>",displayNumberMsg,"<br><br><table border=\"1\" style=\"width:100%\">",
= "<th>Line</th>",
= "<th>Destination</th>",
= "<th>Next Hop</th>",
= "<th>Interface</th>",
= "<th>Route Age</th>",
= "<th>Metric 1</th>",
= "<th>Metric 2</th>",
= "<th>Network Mask</th>",
= "<th>Routing Type</th>",
= concat(foreach(data[1],
= (
= variable ipRouteDest = ipv4_to_string(this[1]);
= variable ipRouteNextHop = ipv4_to_string(this[2]);
= variable ipRouteIfIndex = (variable index = this[3]; try(trim(portEx(head(find(devObject.ref.ports,concat("simple; convert(port(this).portIndex.ifIndex, string) == convert(",index,",string)"), true))).ifDescr), index));
= variable ipRouteAge = this[4];
= variable ipRouteMetric1 = this[5];
= variable ipRouteMetric2 = this[6];
= variable ipRouteMask = ipv4_to_string(this[7]);
= variable ipRouteType = routeType[int32(this[8])];
= concat(
= "<tr>",
= "<td>",startRow+position+1,"</td>",
= "<td>",ipRouteDest,"</td>",
= "<td>",ipRouteNextHop,"</td>",
= "<td>",ipRouteIfIndex,"</td>",
= "<td>",ipRouteAge,"</td>",
= "<td>",ipRouteMetric1,"</td>",
= "<td>",ipRouteMetric2,"</td>",
= "<td>",ipRouteMask,"</td>",
= "<td>",ipRouteType,"</td>",
= "</tr>"
= )
= )
= )),
= "</table><br>Page ",page,"<br>",displayNumberMsg,"</div>"
= )
actionArguments=simple;[]
actionLocation=Server
actionOutput=Yes
actionType=Echo
actionTimeout=30000
supportedTypes=DeviceEx
filter=simple;
= variable userName = var.userId;
= variable devObject = DeviceEx(getObject(head(var.objList).swObjectId));
= variable stashKeyPage = concat("routingTableMenu-page-",userName,"-",devObject.id);
= stash_exists(stashKeyPage) && stash_get(stashKeyPage) > 1
Raise synthetic events
Description: Raise a Network Outage event
Context: Device
Details: Creates either a Network Outage or a Network Outage Cleared event
Capabilities demonstrated: Creating an event
[MenuItem synthetic_events]
displayName=Raise Synthetic Events
parentMenuItem=
itemPosition=0
supportedApps=webUI
toolGroups=
actionMethod=
actionArguments=
actionLocation=Client
actionOutput=No
actionType=Echo
actionTimeout=30000
selectionLimit=1
supportedTypes=device
filter=simple;true
[MenuItem raise_network_outage]
displayName=Raise a Network Outage event
parentMenuItem=synthetic_events
itemPosition=1
supportedApps=webUI
toolGroups=
actionMethod=simple;
= variable swObject = head(var.objList);
= variable objectId = swObject.swObjectId;
= variable deviceObj = DeviceEx(getObject(objectId));
= eval(deviceObj, deviceObj, raise_event("networkOutage",concat("Node Unreachable: ", DeviceEx(this).name),classic_object_description(),classic_impacted(),classic_object_priority(),0,classic_impact_type()))
actionArguments=simple;[]
actionLocation=Client
actionOutput=No
actionType=Echo
actionTimeout=30000
selectionLimit=1
supportedTypes=device
filter=simple;true
[MenuItem raise_network_outage_cleared]
displayName=Raise a Network Outage Cleared event
parentMenuItem=synthetic_events
itemPosition=2
supportedApps=webUI
toolGroups=
actionMethod=simple;
= variable swObject = head(var.objList);
= variable objectId = swObject.swObjectId;
= variable deviceObj = DeviceEx(getObject(objectId));
= eval(deviceObj, deviceObj, raise_event("networkOutageCleared",concat("Node Unreachable: ", DeviceEx(this).name),classic_object_description(),classic_impacted(),classic_object_priority(),0,classic_impact_type()))
actionArguments=simple;[]
actionLocation=Client
actionOutput=No
actionType=Echo
actionTimeout=30000
selectionLimit=1
supportedTypes=device
filter=simple;true
Launch a URL from the Entuity client
This section defines a menu item called "Entuity Home".
- opens the default browser on the Entuity client to view the home page of the Entuity website.
- defined as a URL action, through actionOutput.
[MenuItem Global_Entuity_Home]
displayName=Entuity Home
parentMenuItem=
itemPosition=0
supportedApps=webUI
toolGroups=Show User Menus
actionMethod=simple;"http://www.entuity.com"
actionArguments=[]
actionLocation=Client
actionOutput=Url
actionType=Echo
actionTimeout=30000
supportedApps=webUI
User menu hierarchy using ping example
The ping example from the sample configuration file sw_menu_example.cfg includes a ping advanced action. The action is available as a menu item grouped within the parent Ping menu item.
Setting parent menu items
This section defines a menu item that acts as the parent to the ping action that is included in the sample configuration file. As the parent item, it does not reference its child menu items. parentMenuItem is left blank, so it is set against the root menu. It does not include any actions of its own.
[MenuItem Ping_Device]
displayName=Ping
actionMethod=
actionArguments=
actionLocation=N/A
actionOutput=N/A
actionType=N/A
parentMenuItem=
itemPosition=0
supportedApps=WebUI
toolGroups=Show User Menus
actionTimeout=30000
supportedTypes=device
filter=simple;1
Pinging the current device from the Entuity server
This section defines a menu item called "At Server". This pings the selected device from the Entuity server. Note, this example is only valid when Entuity is installed in a Windows environment.
[MenuItem Ping_Device_Server]
displayName=At Server
actionMethod=simple;"ping.exe"
actionArguments=simple;
= variable newobj=DeviceEx(getObject(head(var.objList).swObjectId));
= [ newobj.name ]
actionLocation=Server
actionOutput=Yes
actionType=Exec
parentMenuItem=Ping_Device
supportedApps=WebUI
toolGroups=Show User Menus
itemPosition=0
supportedTypes=device
selectionLimit=1
filter=simple;1
actionTimeout=30000
This section defines a menu item called "Walk Device".
- uses the snmpwalk executable with Entuity, specified through actionMethod.
- provides an SNMP walk of the current device from the Entuity server, as configured through actionArguments.
- is available on devices that meet the set filter, i.e. a system OID equal to .1.3.6.1.2.1.2.2.1.2
- you can amend the filter to another system OID, or set it to be available against all devices: filter=simple;1
- outputs the SNMP dump results to a separate result window. Because selectionLimit is set to 1, you cannot run another user action until it is closed (Entuity displays an appropriate information message if you attempt to do so).
[MenuItem Walk_Device]
displayName=Walk Device
parentMenuItem=
itemPosition=0
supportedApps=webUI
toolGroups=Show User Menus
actionMethod=simple; concat(get_config_var("ENTUITY_HOME"), "/lib/
tools/snmpwalk")
actionArguments=simple;
= variable devObj=DeviceEx(getObject(head(var.objList).swObjectId));
= variable snmpCommunity=concat("-c", devObj.snmpCommunity);
= [snmpCommunity, "-v1", devObj.name, ".1.3.6.1.2.1.2.2.1.2" ]
actionLocation=Server
actionOutput=Yes
actionType=Exec
actionTimeout=30000
selectionLimit=1
supportedTypes=device
filter=
Launch a user action from an event
This section defines a menu item called "Display Event".
- displays device details of the selected event.
[MenuItem Event_Menu]
displayName=Display Event
actionMethod=simple;"The Event: "
actionArguments=simple;
= foreach ( var.eventList, { eyeServer,eventNum,groupId,
id,timeStamp,objCompId,priority,typeDescr,objDescr,impactType,
impactDescr,eventDetails } )
actionLocation=Client
actionOutput=Yes
actionType=Echo
parentMenuItem=
supportedApps=WebUI
toolGroups=Show User Menus
itemPosition=0
supportedEventTypes=*:*
selectionLimit=1
actionTimeout=30000
filter=simple;1
Comments
0 comments
Please sign in to leave a comment.