|
|
You can make direct queries to database tables in TrafficDirector to view the statistical information you want in an "ad hoc" report format. An ad hoc report is an impromptu report that is created for specific variables you select, letting you choose what is reported and how it is sorted.You can even specify wild characters in some fields when you construct a query.
TrafficDirector uses a single database, named NSTREND_DB, that contains all TrafficDirector-related tables. You can access the tables in this database by specifying a table in your SQL query.
The database in TrafficDirector contains different tables that provide a wide range of useful statistical information. Probes collect the following statistics for reporting in TrafficDirector:
After you have chosen the type of statistics you want to see, you must select the level of report granularity you want reflected as the result of your query--either detail or daily-level. Statistic are stored in the following three kinds of storages:
Table 45-1 lists and describes the specific statistics that are logged in each of the tables in the database.
| Table | Contents | Number of Bytes per Row |
|---|---|---|
| protocol_snap | Media-independent protocol statistics snapshots | 125 |
| protocol_detail | Media-independent protocol statistics details | 165 |
| protocol_summary | Media-independent protocol daily statistics | 165 |
| seg_et_snap | Ethernet segment statistics snapshots | 260 |
| seg_et_detail | Ethernet segment statistics details | 280 |
| set_et_summary | Ethernet segment daily statistics | 280 |
| seg_wan_snap | WAN segment statistics snapshots | 260 |
| seg_wan_detail | WAN segment statistics details | 280 |
| seg_wan_summary | WAN segment daily statistics | 280 |
| seg_fddi_snap | FDDI segment statistics snapshots | 260 |
| seg_fddi_detail | FDDI segment statistics details | 280 |
| seg_fddi_summary | FDDI segment daily statistics | 280 |
| seg_tr_snap | Token Ring segment statistics snapshots | 449 |
| seg_tr_detail | Token Ring segment statistics details | 469 |
| seg_tr_summary | Token Ring segment daily statistics | 469 |
| host_snap | Host statistics snapshots | 205 |
| host_detail | Host statistics details | 225 |
| host_summary | Host statistics daily statistics | 225 |
| conv_snap | Conversation statistics snapshots | 181 |
| conv_detail | Conversation statistics details | 201 |
| conv_summary | Conversation daily statistics | 201 |
| ip_ping_snap | Round-trip delay statistics snapshots | 125 |
| ipping_detail | Round-trip delay statistics details | 145 |
| ip_ping_summary | Round-trip delay daily statistics | 145 |
If your platform is Windows 95 or Windows NT 3.5 or higher, you will use the administrative tools provided with Microsoft SQL Server 6.0 client and server software to perform SQL ad hoc queries to the NSTREND_DB. Use the ISQL\w tool provided with the SQL client software to print ad hoc reports or save them to a file.
See the Microsoft SQL Server Administrator's Companion manual for more information about using ISQL\w.
Windows users must use the Microsoft SQL Server 6.0 or higher administrative tools to generate ad hoc reports.
As a quick reference, use the following list to process the SQL queries you construct, or to get help:
Before you use SQL queries with Trend Reporter, you should be familiar with SQL syntax and usage. The following sample query shows intervals for the Ethernet probe et105 where utilization exceeded 10 percent:
select Agent, Domain, StartTimeText, Utilization from segetdt_970410 where Agent = 'et105' and Utilization > 10 order by Agent, Domain, StartTimeText\g
| select | The SQL command to find and extract one or more field names you specify. |
| Agent | The name of the database field that contains an agent name in the segment detail table for Ethernet. |
| Domain | A 15-character field containing a domain name in the segment detail table for Ethernet. |
| StartTimeText | The name of a database field that contains the start time in text format in the segment detail table for Ethernet. |
| Utilization | The name of the database field that contains the average segment utilization for a specified time interval in the segment detail table for Ethernet. |
| from | The SQL syntax you use to point to the table that you want to query. |
| segetdt_yymmdd | An example of an Ethernet segment detail table name, where segetdt is the name of the table type, and yymmdd the two-digit year, month, and day that you specify. |
| where | The SQL syntax you use to specify the values that fields must match, if applicable. |
| Agent = | The name of the field whose value must exactly match the value you specify after the equal sign (=). When using wildcards in a query, specify the command like instead of the equals sign. (See "Using Wildcards in MSQL Queries" for more details and sample queries that use wildcards.) |
| 'et105' | The value you want the Agent field to match. Note that any value you specify, for example, an agent name or StartTime, must be enclosed in single quotes. |
| and | The syntax you use to connect one criterion to another. Using this syntax means that the SQL query you are specifying contains at least two criteria that must match. |
| Utilization > | The name of the field which value must be greater than the value you specify after the greater than sign (>). |
| 10 | The value that the Utilization field uses as a baseline; values included in the report must be greater than this baseline value. |
| order by | The syntax you use to specify how you want the report ordered. The first field you specify after this is the primary sort variable. |
| Agent | The primary sort variable for the report. |
| Domain | The next sort variable for the report. |
| StartTimeText | The last sort variable for the report. |
| \g | The command syntax for Go, the command to send the query to the database. |
You use can wildcards with msql when specifying agent or domain names in a query. You can use wildcards at the beginning, middle or end of a name. Keep in mind that the wildcards you use to construct ad hoc queries are different and perform different substitutions from the wildcards you use with either UNIX or Windows operating systems. In fact, if you use a UNIX or Windows supported character as a wildcard, msql returns an error message. The following wildcards are valid with msql:
When you use wildcards, you must use the like command instead of the equals symbol (=). The following is an example of a query you can use to discover which agents are logging utilization at greater than 65 percent:
select Agent, Domain, StartTimeText, Utilization from segetdt_970410 where Agent like 'et%' and Utilization > 65 order by Utilization, Agent, Domain, StartTimeText\g
This section lists sample queries that run certain reports to give you an idea of how you might structure and run your own ad hoc queries.
select distinct Agent, Domain from protocol_summary order by Agent, Domain\g
select Agent, Domain, StartTimeText, Utilization from segwadt_yymmdd where Agent like 'ny%' and Utilization > 60 order by Agent, Domain, StartTimeText\g
For more information on details and other database tables, see Appendix B, "Report Resource Information."
The following are some sample Windows detail table queries:
The following are some sample queries for UNIX and Windows:
You can store queries in a text file and direct the output to a text file, as the following example shows (where query-high-util is the name of the query file, and high-util-list is the name of the resulting output text file):
msql NSTREND_DB < query-high-util > high-util-list
This section shows you how to print any report generated on an ad hoc basis using SQL queries.
To print a report to display on your management console screen, use the following syntax:
msql NSTREND_DB textfilename
textfilename is the text file you created that contains one or more SQL queries.
To print a report to a file use the following syntax:
msql NSTREND_DB textfilename filename
textfilename is the text file you created that contains one or more SQL queries.
To print the report directly to a printer use the following syntax:
msql NSTREND_DB textfilename | lpr
textfilename is the text file you have created that contains one or more SQL queries. This pipes the output (|) to the print spooler (lpr), which then prints it to the default printer. To specify a different printer, you would also need to specify -Pprintername after lpr.
To send the report as an e-mail to a user in your organization, use the following syntax:
msql NSTREND_DB textfilename | mail emailaddress
textfilename is the text file you created that contains one or more SQL queries. This sends the output as an email to the emailaddress you specify.
|
|