• Products
    • View all products
    • Free trials
    • Buy online
  • Solutions
  • Resources
    • All Resources
    • Learning Hub
  • Trials
  • Services
    • Consulting Services
      • Overview
      • Microsoft Platform Services
      • Data Protection Services
      • Unified Endpoint Management
      • Performance Monitoring Services
      • Database Management Services
    • Educational Services
    • Support Services
  • Support
    • Support Home
    • By Product
      • All Products
      • AppAssure
      • Archive Manager
      • Change Auditor
      • Desktop Authority
      • DR Series
      • Foglight
      • KACE
      • Migration Manager
      • NetVault
      • Rapid Recovery
      • SharePlex
      • Toad
      • vRanger
    • Contact Support
      • Overview
      • Customer Service
      • Licensing Assistance
      • Renewal Assistance
      • Technical Support
    • Download Software
    • Knowledge Base
    • My Account
      • My Products
      • My Service Requests
      • My Licenses
      • My Groups
      • My Profile
    • Policies & Procedures
    • Consulting Services
      • Microsoft Platform Management
      • Data Protection
      • Unified Endpoint Management
      • Performance Monitoring
      • Database Management
    • Technical Documentation
    • Educational Services
    • User Forums
    • Video Tutorials
  • Partners
    • Overview
    • Partner Circle Log In
    • Become a Partner
    • Find a Partner
    • Technology Partners
    • Partner Community
    • Deal Alert
  • Blogs
    • IT Industry Insights
    • Quest Solution Blogs
      • Data Protection
      • Database Management
      • ITNinja
      • Microsoft Platform Management
      • Performance Monitoring
      • Toad World Blog
      • Unified Endpoint Management
  • Forums
  • 製品情報
    • すべての製品情報%E3%82%92見る
    • Change Auditor
    • Foglight
    • KACE
    • Metalogix
    • Migration Manager
    • Migrator for Notes to SharePoint
    • NetVault Backup
    • On Demand Migration for Email
    • QoreStor
    • Rapid Recovery
    • Recovery Manager
    • SharePlex
    • Spotlight
    • Toad
  • ソリューション
    • すべてのプラットフォームを見る
    • クラウド管理
    • GDPRコンプライアンス
    • データ保護
      • 概要
      • クラウド管理
      • ディザスタリカバリ
      • バックアップとリカバリ
      • Office 365 データ保護
      • 仮想化管理
      • 重複除外と複製
    • データベース管理
      • 概要
      • DevOps
      • データの準備と分析
      • データベースのクラウド移行
      • データベースパフォーマンス監視
      • データベース管理
      • データベース複製ソフトウェアツール
    • 統合エンドポイント管理
      • 概要
      • エンドポイントコンプライアンス
      • エンドポイントセキュリティ
      • エンドポイントの可視化
    • Microsoftプラットフォーム管理
      • 概要
      • ハイブリッドActive Directoryのセキュリティとガバナンス
      • Microsoftプラットフォームの移行計画と統合
      • セキュリティとコンプライアンス
      • 情報アーカイブおよびストレージ管理ソリューション
      • Windowsのバックアップとリカバリ
      • Microsoft Serverのパフォーマンスと可用性
      • レポート作成機能
      • グループポリシーと権限
    • パフォーマンス監視
  • サービス
    • コンサルティングサービス
      • 概要
      • Microsoftプラットフォーム管理
      • データ保護
      • 統合エンドポイント管理
      • パフォーマンス監視
      • データベース管理
    • トレーニングと認定資格
    • サポートサービス
  • サポート
    • サポートホーム
    • 製品で検索
      • All Products
      • AppAssure
      • Archive Manager
      • Change Auditor
      • Desktop Authority
      • DR Series
      • Foglight
      • KACE
      • Migration Manager
      • NetVault
      • Rapid Recovery
      • SharePlex
      • Toad
      • vRanger
    • お問い合わせ
      • すべて
      • カスタマサービス
      • ライセンス アシスタンス
      • 更新のアシス%E3%82%BFンス
      • 技術サポート
    • コミュ%E3%83%8Bティフォーラム
    • ソフトウェアのダウン%E3%83%ADード
    • ナ%E3%83%AC%E3%83%83ジ%E3%83%99ース
    • マイアカウント
      • マイ プロダクト
      • Myサービスリクエスト
      • マイ ライセンス
      • マイ グループ
      • マイ プ%E3%83%ADフ%E3%82%A1イル
    • ポリ%E3%82%B7ーおよび手順
    • コンサル%E3%83%86ィングサー%E3%83%93ス
      • Microsoftプラットフォーム管理
      • データ保護
      • 統合エンドポイント管理
      • パフォーマンス監視
      • データベース管理
    • リリースノートおよびガイド
    • 教育サービス
    • ビデオチュートリアル
  • トライアル
  • パートナー
    • 概要
    • Partner Circleへのログイン
    • パートナーになる
    • Find a Partner
    • パートナーコミュニティ
    • Deal Alert
  • コミュニティ
Quest Community
Quest Community
  • Site
  • User
  • Site
  • Search
  • User
Foglight
Foglight
Foglight Administrators Custom Agents - Script Agent Data Modeling and Units
  • Forum
  • Wikis
  • Sub-Groups
  • More
  • Cancel
  • New
  • -Foglight Administrators
    • A New Foglight Service Status Widget - Text with Colored Background
    • Adding APM views to an existing Foglight Java cartridge installation
    • Adventures in Agent Creation - Part 1
    • Adventures in Agent Creation - Part 2
    • Adventures in Agent Creation - Part 3
    • Anonymizing the Foglight End User Monitoring Solution
    • Another Foglight Service Status Widget - Colored Text
    • +Building a custom dashboard to summarize LogFilter alarms
    • Building a geo drag and drop Foglight dashboard for a service
    • Building Complex Schedules with Foglight
    • Busting Frame Busters in Foglight Experience Viewer (FxV)
    • Community Cartridge: Notification Management Cartridge
    • Compatibility for Navigation Timing API
    • Configuring Internet Explorer 9 (IE9), to best work with Foglight
    • Converting Foglight 4 Script Agents to Foglight 5
    • Creating Load Testing Scripts from FxM and FxV Session Data
    • Custom Agents - Introduction to Script Agents
    • Custom Agents - Script Agent Data Modeling and Units
    • Custom Foglight Dashboards: adding alarm colors to spinners, jelly beans and other gauges
    • Custom Script Agent 1: Leverage an Existing Monitoring Script To Push Data into Foglight
    • Custom Script Agent 2: Build a WCF Dashboard to View the Custom Agent Data
    • Custom Script Agent 3: Add a Metric and Build a WCF Chart to Display it
    • Custom Script Agent 4: Add a Metric to a Table
    • Customizing Foglight – Expert Services Discount Available for a Limited Time!
    • Customizing the out-of-the-box Host Status view
    • Dashboard speed-up
    • Deploying Two FglAMs to the Same Windows Host and running each as a Windows Service
    • Different Thresholds for Different Tablespaces
    • Different Thresholds for Different Tablespaces - Part 2
    • Emailing reports with the proper name and format
    • Everything You Need to Know About Udyam Registration
    • FGL IDE (Export Customizations & more)
    • Flexible, Cost-effective Remote Administration Services
    • Foglight 5 - Topology Localization
    • Foglight Advanced Administration Training - Limited Space for February 2012
    • Foglight APM Basics (Videos)
    • Foglight APM Features (videos)
    • +Foglight Best Practices
    • Foglight Best Practices (videos)
    • Foglight Best Practices Monthly Webcast – Sign Up for Session 1!
    • Foglight Best Practices: Dashboards and Reports Webcast Registration Open Now!
    • Foglight dashboard as a SharePoint WebPart
    • Foglight Dev Camp & Hackathon 2017
    • Foglight End User Management: Using Network TAPs versus a Switch SPAN Port
    • Foglight End User Service Availability Reporting, Foglight Experience Monitor or Foglight Transaction Recorder which one to use?
    • Foglight Event Synchronization Solution for HP Operations Manager Services Pack Available Now!
    • Foglight Experience Viewer (FxV) URL Search Shortcuts
    • Foglight Host OS Monitoring (videos)
    • Foglight iGoogle Gadget
    • Foglight nologinuser dashboard in SharePoint
    • Foglight Public Virtual Training Courses
    • Foglight Quickstart Services Offering
    • Foglight Reporting using Metric Queries or Groovy
    • Foglight Training Classes -- Public and Private Options Available
    • Foglight Training Packages with Free Healthcheck Services - Limited Time Offer
    • Fraud Support with FxV
    • FxM and Apache Proxy Server (X-Forwarded-Host)
    • FxM: IP Multicasting and Sessionizing
    • FxV Storage Tier Expansion & Analysis Repository Considerations
    • Getting the most out of Foglight's .NET Monitoring - Part 1
    • Getting the most out of Foglight's .NET Monitoring - Part 2: Agent Configuration Specifics and Best Practices
    • Getting the most out of Foglight's .NET Monitoring - Part 3: Monitoring a .NET Executable Application
    • HDIDT - View an Exported Real User Session File
    • How are your Java components processing?
    • How to Handle NTLM within UEM
    • Improve Organizational Adoption of Your APM Solution
    • January Foglight Best Practices Thursday, January 5 - Register Now!
    • Java APM
    • June 2012 Best Practices Webcast Open for Registration!
    • Migrating your Foglight Management Server
    • Monitoring .NET Request Memory Usage with Foglight
    • Monitoring an independent Java process using Foglight
    • Monitoring application availability using Foglight Utility Agents
    • New Foglight Services Packs Available
    • New Sizing Guide for FxM and FxV
    • New UEM Sizing Guide
    • Predicting the Impact of Moving a Guest to Another Host
    • +Quest Application Performance Monitoring (APM) Implementation Methodology
    • Reading a XML File with a powershell script agent
    • Really Simple (Foglight) Syndication
    • Services Section of Quest.com Gets a Facelift
    • Setting the value of a Registry Variable from the Command Line
    • SNMP trap variables in Foglight Alarms
    • The End-User as an Instrument...
    • Thoughts from the road - Foglight Java agent Tag and Follow
    • +Thoughts from the road – User session replay - YOU CAN ACTUALLY DO THAT???
    • Training Update - New Foglight Reporting Course Available
    • Understanding Foglight Metrics
    • Updates to Quest's Foglight Public Virtual Training Calendar
    • Use a Foglight to monitor itself
    • Use Foglight to Drive Business Performance
    • Use Foglight to monitor itself
    • User Experience Mgmt Overview
    • Using telnet or wget to check connectivity
    • Using the ConfigService API to setup agent properties (ASPs)
    • Utilizing MS Exchange distribution lists to help with user attribute maintenance
    • We've Redesigned SupportLink to Get You Answers Faster Than Ever - See for Yourself and Enter to Win an iPad!
    • [Case Scenario] - How to avoid duplicate rows when building a report with 5 min granular data
  • Custom Script Agent - Counting Files in a Windows Folder - How-To
  • Foglight Admin 101
  • Foglight monitoring application components running on Docker Containers
  • Foglight User 101
  • HabitatLux Fix Review – Trusted Home Maintenance Services in Dubai
  • Leather Wallets: The Timeless Accessory Every Man Should Own
  • Memory Utilization for all processes over X months
  • NetMonitor - Quick How-To Guide
  • Pantai Losari, sebuah ikon kota Makassar
  • Setting JBoss Server name and domain in Foglight
  • Setting Tomcat server name and domain in Foglight
  • testing a bug - Do not publish
  • WebMonitor - Quick How-To Guide
  • WebMonitor agent installation

Custom Agents - Script Agent Data Modeling and Units

By Geoff Vona

In my last blog I introduced Script Agents. Script Agents are a great way to get data into Foglight quickly. Foglight 5 extends the script agent data format in some interesting ways. In this blog, we're going to look at data modeling, units and reserved words.

Script Agent Field Syntax

In a Script Agent, data is sent to the server by specifying a series of field=value pairs. The syntax is shown below:

field[.type[.{id|obs}]][:unit]=value

As we work through this blog we'll learn why and how to use all elements of this syntax.

How Script Agent Data is Represented in Foglight 5

In Foglight 4, data modeling was uniform for all collections. Data was gathered by agents and organized into tables. The tables were attached to an agent instance. The agents were attached to host instances.

Foglight 5 allows for many different kinds of data models, including the Foglight 4 model. To make transition easier, Script Agents make use of the Foglight 4 data model. This means that the data in a Script Agent is gathered by an agent, organized into tables attached to the agent, and the agent is attached to a host. This model is visualized below: it applies to Foglight 4 and Foglight 5:

This means that Script Agent data models look the same up to the agent. There is a Host, and it contains an Agent. Pretty straight forward, right?

The differences between Foglight 4 and Foglight 5 are visible at the table level. A Foglight 4 table is like a database table. Each new collection is a new row in the table. A Foglight 5 table is actually a data object. The columns in the collection are turned into properties, metrics or observations, depending on information provided by the script agent.

This is a significant new bit of flexibility, but a bit tricky to fully understand. Let's consider a script agent that collects host data.

Foglight 4 Script AgentFoglight 5 Script Agent
@echo off 
@if not "%ECHO%"==" "
echo %ECHO%
@if not "%OS%"=="Windows_NT" goto EXIT
echo TABLE ExpandedHost
echo START_SAMPLE_PERIOD
echo Host = tor017820
echo CPU = 90
echo Memory = 55
echo Disk = 20
echo END_SAMPLE_PERIOD
echo START_SAMPLE_PERIOD
echo Host = tor017899
echo CPU = 78
echo Memory = 35
echo Disk = 43
echo END_SAMPLE_PERIOD
echo END_TABLE
@echo off 
@if not "%ECHO%"==" "
echo %ECHO%
@if not "%OS%"=="Windows_NT" goto EXIT
echo TABLE ExpandedHost
echo START_SAMPLE_PERIOD
echo Host.String.id = tor017820
echo CPU = 90
echo Memory = 55
echo Disk = 20
echo END_SAMPLE_PERIOD
echo START_SAMPLE_PERIOD
echo Host.String.id = tor017899
echo CPU = 78
echo Memory = 35
echo Disk = 43
echo END_SAMPLE_PERIOD
echo END_TABLE

In Foglight 4, you get a table that looks like this:

HostCPUMemoryDisk
tor017820 90 55 20
tor017899 78 35 43

The problem with this table is that you get an entry per host. You have to do work to tease apart the different instances.

In Foglight 5, you get two objects of type ExpandedHost. The Host property is the unique identifier for the object - a new object will be generated for each new Host entry in the script agent. Each object has CPU, Memory and Disk metrics attached.

Each metric is a set of time series data. This gives much more flexibility, at the cost of a bit of up front complexity. You can find each unique ExpandedHost instance easily. For each instance, you can query the metrics in any number of ways, pulling out average, min, max, standard deviation, current value for any time range. This is powerful and new.

Controlling the Data Model in Script Agents

The Script Agent data model is built based on a set of assumptions. These assumptions are implemented by a transformation definition that is embedded in each Script Agent .car file.

The rules:

  1. By default, every field=value pair is assumed to be a metric of type double
  2. If the field includes a type definition (field.type), then the field is assumed to be a property of the specified type
  3. If the field includes a type definition and the obs suffix (field.type.obs), then the field is converted to an observation.

This is pretty straight forward. But what types are available? And what is an "observation"?

In theory, all types are available. However, it must be possible to create the type by assigning the value in the script agent. This means the real type set is limited to the simple Java-based types. These types can be reviewed by looking at the top of the topology-types.xml file in FGLHOME/config.


String, Long, Integer, Number, Double, Float, Boolean

An observation is a way of storing something that might change every collection. Normally this kind of data is stored as a metric. However, specifying a type will override this conversion to a time-series metric and turn it into a property. (Remember Rule 2?). Why does this matter? It matters because every property change triggers a topology change event. A topology change event should be a rare occurrence. Each change event will impact the model by forcing it to rebind rules, derived metrics and other monitoring policies. This can be disruptive if there are too many changes. Beyond that, it doesn't make sense to store a changing value as a property, as none of the historical values are available.

In the last blog we worked through an example with three string values. It is worth repeating the results. The three string values were the host name, IP address and host state:

Question HostIP AddressState
Identity Yes No No
Changes Frequently No No Yes

This lead to the following script agent entries:


echo Host.String.id = tor017820
echo IPAddress.String = 10.4.22.10
echo State.StringObservation.obs = Up

Here's the final reasoning:

FieldCollection BehaviourScript Agent SyntaxDescriptionData Model Behaviour
Host Never changes, defines identity for the collection Host.String.id Identity property of type String An identity property called "Host" is added to the object. For each new value, a new object is created.
IP Address Might change occasionally in some cases IPAddress.String Property of type String A property called "IPAddress" is added to the object, and a value is stored. If the value changes, a topology change event occurs
State Might change every collection State.StringObservation.obs String observation of type String Like a metric - one value is stored per collection

Setting Units

By default, any metric that comes into the system will not have a unit assigned. This means any numeric value will have the unit "count". This quite often doesn't matter early on in your agent development - you get get going pretty quickly without worrying about units. But without units, you'll see things like this:

This is a CPU %, but the unit is count. This just looks wrong.

In a Script Agent, it is possible to set the unit using the last part of the field syntax:


field[.type[.{id|obs}]][:unit]=value

The possible units are listed below:

ScaleMemory/DiskTimeMathDefault
billion, billionth, million, millionth, thousand, thousandth, trillion, trillionth bit, byte, exabyte, gigabyte, kilobyte, megabyte, petabyte, terabyte day, hour, microsecond, millisecond, minute, month, nanosecond, second, year percent count

What's great about these units is that they can be combined to make rates - as long as the rates make sense. So for example, a disk I/O rate can be assigned a unit of megabyte/minute like this:


DiskIO:megabyte/minute

To pull it all together, I've modified the earlier example script to include untis for CPU, Memory and Disk. I've also added a DiskIO metric that has a compound unit.

@echo off

@if not "%ECHO%"==" "

echo %ECHO%

@if not "%OS%"=="Windows_NT" goto EXIT

echo TABLE HostWithUnits

echo START_SAMPLE_PERIOD

echo Host.String.id = tor017820

echo CPU:percent = 90

echo Memory:megabyte = 55

echo Disk:gigabyte = 20

echo DiskIO:megabyte/minute = 13

echo IPAddress.String = 10.4.22.10

echo State.StringObservation.obs = Up

echo END_SAMPLE_PERIOD

echo START_SAMPLE_PERIOD

echo Host.String.id = tor017899

echo CPU:percent = 78

echo Memory:megabyte = 35

echo Disk:gigabyte = 43

echo DiskIO:megabyte/minute = 17

echo IPAddress.String = 10.4.21.14

echo State.StringObservation.obs = Down

echo END_SAMPLE_PERIOD

echo END_TABLE

The net result is shown below. Each of the curve has a proper unit in the legend.

It is highly recommended that you put units in all your metrics. It makes your gathered data much more readable in the user interface. All sorts of good things happen when a metric has units.

Reserved Words

Not all field names are available. Many field names are reserved. The reason for this is that script agents create objects for each TABLE entry. These objects extend a type called F4Table. This type already has properties defined. You are not allowed to replace those properties with new ones- it will cause problems with how models hold together.

It is possible to figure out exactly what property names are reserved by looking at the type definitions for F4Table and its parent classes. The type hierarchy looks like this:


TopologyObject -> F4Table

The full set of reserved names can be observed by looking at an instance of a script agent in the data browser:

However, this is a bit tricky as of 5.5. The property names that appear are English readable, and are no longer the exact property name. This makes it hard in some cases to figure out what names are reserved. Below is a full list of the reserved names, based on an inspection of the types. I've hilighed the ones that cause the most trouble in the field.

Object IDsObject IdentityObject ManagementAlarmsType and SizeHost and AgentF4Table
objectID, id, version, topologyObjectId, topologyObjectVersionId, topologyObjectVersion
effectiveStartDate, effectiveEndDate, lastUpdated
name, longName scheduleIds, isBlackedOut, annotations, parents alarms, aggregateAlarms, localState, aggregateState, localStateSeverity, aggregateStateSeverity, aggregateAlarmState, alarmWarningCount, alarmCriticalCount, alarmFatalCount, alarmTotalCount, alarmAggregateWarningCount, alarmAggregateCriticalCount, alarmAggregateFatalCount,alarmAggregateTotalCount
changeSummary, changeCount, aggregateChangeCount
topologyTypeName, topologyObjectSize monitoredHost, monitoringAgent agent

Here's a sample agent that includes fields that conflict with reserved names:


@echo off
@if not "%ECHO%"==" "
echo %ECHO%
@if not "%OS%"=="Windows_NT" goto EXIT
echo TABLE BadFields
echo START_SAMPLE_PERIOD
echo Host.String.id = tor017820
echo CPU:percent = 90
echo id=3
echo localState.String.obs=Up
echo version.String=3.2
echo name.String=Monkey
echo END_SAMPLE_PERIOD
echo END_TABLE

The failure mode is shown below. Note that in this case, a reserved word conflict is fatal on the first instance. We only see an error for id because it is the first field name. The remaining reserved words don't show up in the log because the agent fails.


2009-08-27 22:00:54.159 WARN The badfields_Agent_Table_BadFields.id property exists with a type of Long which is incompatible
with the requested type of Metric. 2009-08-27 22:00:54.159

ERROR An unexpected error occurred which may cause undesired behavior. You may
want to contact Quest Software customer support if you see this error again:

Canonical data transform failed: java.lang. IllegalStateException: Error processing incoming data for node path: [FglAM::
badfields-1_0_0/CDT-1_0_0/topology-adapter.xml]/SPI:SPI/badfields:*/BadFields :*/row:row/id: java.lang.RuntimeException:
Existing property is incompatible.

  • Foglight Administration
  • property
  • reserved words
  • custom agents
  • metric
  • Foglight
  • script agent
  • type
  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Company
    • About Us
    • Buy
    • Contact Us
    • Careers
    • News
  • Resources
    • Industry Insights Blog
    • Communities
    • Customer Stories
    • Documents
    • Events
  • Support
    • Professional Services
    • Renew Support
    • Technical Support
    • Training & Certification
    • Support Services
  • Social Networks
    • Facebook
    • LinkedIn
    • Twitter
    • YouTube
  • © 2025 Quest Software Inc. ALL RIGHTS RESERVED.
  • Legal
  • Terms of Use
  • Privacy
  • Community Feedback & Support
  • Cookie Preference Center
  • 会社名
    • 会社情報
    • 購入
    • お問い合わせ
    • 採用情報
    • ニュース
  • リソース
    • ブログ
    • お客様の事例
    • ドキュメント
    • イベント
    • ビデオ
  • サポート
    • プロフェッショナルサービス
    • サポートの更新
    • テクニカルサポート
    • トレーニングと認定資格
    • サポートサービス
  • ソーシャルネットワーク
    • Facebook
    • Instagram
    • LinkedIn
    • Twitter
    • YouTube
  • © 2025 Quest Software Inc. ALL RIGHTS RESERVED.
  • 「法務」
  • ご利用規約
  • 個人情報保護方針
  • コミュニティのフィードバックとサポート