Health Monitors

This section contains different types of health monitors you can use in your declarations. Some include multiple monitors, so you can include the monitor(s) that best suit your needs.

Use the index on the right to locate specific examples.

Important

Most of the example declarations have been updated in the documentation for AS3 3.20 to remove any template that was specified, and rename any virtual services that used the name serviceMain to service. In AS3 3.20, the generic template is the default, which allows services to use any name.

This also means that many of these declarations on a version prior to 3.20 they will fail unless you add a template. See this FAQ entry and this Troubleshooting entry for more information.

1: Using an LDAP monitor in a declaration

This example shows how you use an LDAP monitor in a declaration. This example shows 4 different LDAP monitors that you can use in your declarations. See the Schema Reference for usage options and additional features.

  • Partition (tenant) named Sample_monitor_01.
  • A pool named monitorLDAP_pool with one member.
  • Four LDAP monitors, named monitorLDAPdefault, monitorLDAPsimple, monitorLDAPnonDefault1, and monitorLDAPnonDefault2.
{
    "class": "ADC",
    "schemaVersion": "3.6.0",
    "id": "TEST_MONITOR_LDAP",
    "remark": "Test LDAP Monitor",
    "Sample_monitor_01": {
      "class": "Tenant",
      "TEST_Monitor_LDAP": {
        "class": "Application",
        "monitorLDAP_simple": {
          "class": "Monitor",
          "monitorType": "ldap"
        },
        "monitorLDAP_default": {
          "class": "Monitor",
          "monitorType": "ldap",
          "targetAddress": "",
          "targetPort": 0,
          "interval": 5,
          "upInterval": 0,
          "timeUntilUp": 0,
          "timeout": 16,
          "security": "none",
          "mandatoryAttributes": false,
          "chaseReferrals": true
        },
        "monitorLDAP_nonDefault1": {
          "class": "Monitor",
          "monitorType": "ldap",
          "targetAddress": "192.0.2.17",
          "targetPort": 389,
          "interval": 10,
          "upInterval": 15,
          "timeUntilUp": 20,
          "timeout": 46,
          "security": "ssl",
          "mandatoryAttributes": true,
          "chaseReferrals": false,
          "username": "Adm-nM+nkey",
          "passphrase": {
            "ciphertext": "ZjVmNQ==",
            "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
            "ignoreChanges": true
          },
          "base": "dc=bigip-test,dc=org",
          "filter": "objectClass=employee"
        },
        "monitorLDAP_nonDefault2": {
          "class": "Monitor",
          "monitorType": "ldap",
          "targetAddress": "192.0.2.18",
          "targetPort": 389,
          "username": "B*zzL!ghtyear",
          "passphrase": {
            "ciphertext": "ZjVmNQ==",
            "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
            "ignoreChanges": true
          },
          "base": "dc=bigip-test,dc=net",
          "filter": "objectClass=person",
          "security": "tls"
        },
        "monitorLDAP_pool": {
          "class": "Pool",
          "members": [
            {
              "servicePort": 443,
              "serverAddresses": [
                "192.0.2.19"
              ],
              "minimumMonitors": 1,
              "monitors": [
                { "use": "monitorLDAP_nonDefault1" },
                { "use": "monitorLDAP_nonDefault2" }
              ]
            }
          ]
        }
      }
    }
  }
  

Back to top

2: Using a DNS monitor in a declaration

This example shows how you use a DNS monitor in a declaration. This example shows two monitors, a simple DNS monitor and a DNS monitor with all available properties that you can use in your declarations. See the Schema Reference for usage options and information.

  • Partition (tenant) named Sample_monitor_02.
  • A pool named monitorDNS_pool with one member.
  • Two monitors attached to the pool: monitorDNS_simple and monitorDNS_AllProperties.
{
    "class": "ADC",
    "schemaVersion": "3.6.0",
    "id": "TEST_MONITOR_DNS",
    "remark": "Test DNS Monitor",
    "Sample_monitor_02": {
      "class": "Tenant",
      "TEST_Monitor_DNS": {
        "class": "Application",
        "monitorDNS_simple": {
          "class": "Monitor",
          "monitorType": "dns",
          "queryName": "apple.test"
        },
        "monitorDNS_AllProperties": {
          "class": "Monitor",
          "monitorType": "dns",
          "queryName": "radish.test",
          "acceptRCODE": "no-error",
          "adaptive": true,
          "adaptiveDivergenceType": "absolute",
          "adaptiveDivergenceMilliseconds": 200,
          "adaptiveLimitMilliseconds": 5000,
          "adaptiveWindow": 1500,
          "answerContains": "query-type",
          "queryType": "aaaa",
          "receive": "fdf5:4153:3300::a",
          "reverse": false,
          "interval": 60,
          "timeUntilUp": 1200,
          "timeout": 600,
          "upInterval": 2400,
          "transparent": false,
          "targetAddress": "fdf5:4153:3300::b",
          "targetPort": 53
        },
        "monitorDNS_pool": {
          "class": "Pool",
          "members": [
            {
              "servicePort": 443,
              "serverAddresses": [
                "fdf5:4153:3300::c"
            ],
              "minimumMonitors": 1,
              "monitors": [
                { "use": "monitorDNS_AllProperties" },
                { "use": "monitorDNS_simple" }
              ]
            }
          ]
        }
      }
    }
  }
  

Back to top

3: Using an external monitor in a declaration

This example shows how you can create an external monitor in a declaration. An external monitor allows you to use a custom script for monitoring. In this example, we reference a script located in an external location. You could also reference a script file already present on the BIG-IP.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_monitor_03.
  • A pool named externalMonitorPool.
  • An external monitor named mNewExternalMonitorFile, that uses a script hosted in an external location.
{
  "class": "ADC",
  "schemaVersion": "3.6.0",
  "id": "MONITOR_EXTERNAL",
  "remark": "external monitor",
  "Sample_monitor_03": {
    "class": "Tenant",
    "Monitors": {
      "class": "Application",
      "label": "simple external monitor",
      "mNewExternalMonitorFile": {
        "class": "Monitor",
        "monitorType": "external",
        "interval": 5,
        "upInterval": 0,
        "timeUntilUp": 0,
        "timeout": 16,
        "expand": false,
        "script": {
          "url": "https://example.com/monitor.sh"
        }
      },
      "monitorExternal_pool": {
        "class": "Pool",
        "members": [
          {
            "servicePort": 443,
            "serverAddresses": [
              "192.0.2.19"
            ],
            "minimumMonitors": 1,
            "monitors": [
              { "use": "mNewExternalMonitorFile" }
            ]
          }
        ]
      }
    }
  }
}

Back to top

4: Using a RADIUS monitor in a declaration

This example shows how you use a RADIUS monitor in a declaration. This example shows 3 different RADIUS monitors that you can use in your declarations. See Monitor_FTP in the Schema Reference for usage options and additional features.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named Sample_monitor_04.
  • A pool named monitorRADIUS_pool with one member.
  • Three example RADIUS monitors, named monitorRADIUSdefault, monitorRADIUS_nondefault1, monitorRADIUS_nondefault2.
{
    "class": "ADC",
    "schemaVersion": "3.7.0",
    "id": "TEST_MONITOR_RADIUS",
    "remark": "Test RADIUS Monitor",
    "Sample_monitor_04": {
      "class": "Tenant",
      "TEST_Monitor_RADIUS": {
        "class": "Application",
        "monitorRADIUS_simple": {
          "class": "Monitor",
          "monitorType": "radius"
        },
        "monitorRADIUS_default": {
          "class": "Monitor",
          "monitorType": "radius",
          "targetAddress": "",
          "targetPort": 0,
          "interval": 5,
          "upInterval": 0,
          "timeUntilUp": 0,
          "timeout": 16
        },
        "monitorRADIUS_nonDefault1": {
          "class": "Monitor",
          "monitorType": "radius",
          "targetAddress": "192.0.2.17",
          "targetPort": 1812,
          "interval": 10,
          "upInterval": 15,
          "timeUntilUp": 20,
          "timeout": 46,
          "username": "Adm-nM+nkey",
          "passphrase": {
            "ciphertext": "ZjVmNQ==",
            "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
            "ignoreChanges": true
          },
          "secret": {
            "ciphertext": "ZjVmNQ==",
            "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
            "ignoreChanges": true
          },
          "nasIpAddress": "198.0.2.20"
        },
        "monitorRADIUS_nonDefault2": {
          "class": "Monitor",
          "monitorType": "radius",
          "targetAddress": "192.0.2.18",
          "targetPort": 1645,
          "username": "B*zzL!ghtyear",
          "passphrase": {
            "ciphertext": "ZjVmNQ==",
            "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
            "ignoreChanges": true
          },
          "secret": {
            "ciphertext": "ZjVmNQ==",
            "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
            "ignoreChanges": true
          },
          "nasIpAddress": "192.0.2.20"
        },
        "monitorRADIUS_pool": {
          "class": "Pool",
          "members": [
            {
              "servicePort": 443,
              "serverAddresses": [
                "192.0.2.19"
              ],
              "minimumMonitors": 1,
              "monitors": [
                { "use": "monitorRADIUS_nonDefault1" },
                { "use": "monitorRADIUS_nonDefault2" }
              ]
            }
          ]
        }
      }
    }
  }
  

Back to top

5: Using an FTP monitor in a declaration

This example shows how you use an FTP monitor in a declaration. This declaration only includes the monitor, and no pool or virtual service, but simply shows how to create an FTP monitor with AS3. See the Schema Reference for usage options and additional features.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named TEST_FTPMonitor.
  • An FTP monitor named sampleFTPmonitor.
{
    "class": "ADC",
    "schemaVersion": "3.10.0",
    "id": "Monitor",
    "TEST_FTPMonitor": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "sampleFTPmonitor": {
                "class": "Monitor",
                "monitorType": "ftp",
                "mode": "port",
                "username": "testUser",
                "passphrase": {
                    "ciphertext": "ZjVmNQ==",
                    "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
                    "ignoreChanges": true
                },
                "filename": "testpath/test/"
            }
        }
    }
}

Back to top

6: Using certificates in an HTTPS monitor

This example shows how you can create an HTTPS monitor that uses a certificate and key. This declaration only includes the monitor and certificates, and no pool or virtual service, but simply shows how to create an HTTPS monitor that uses a certificate with AS3. See the Schema Reference for usage options and additional features.

Important

The way you compose the declaration depends on whether you are using BIG-IP/TMOS version 13.1 or later (uses the clientTLS property), or a version prior to 13.1 (uses the clientCertificate property). Use the appropriate example.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named TEST_HTTPSMonitor.
  • An HTTPS monitor named sampleHTTPSmonitor.

For versions 13.1 and later

Note in this example, you are also creating a TLS_Client profile (ServerSSL profile in the BIG-IP UI) for the certificate, which is attached to the monitor.

{
    "class": "ADC",
    "schemaVersion": "3.13.0",
    "id": "Monitor",
    "TEST_HTTPSMonitor": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "sampleHTTPSmonitor": {
                "class": "Monitor",
                "monitorType": "https",
                "clientTLS": {
                    "use": "webtls"
                }
            },
            "webtls": {
                "class": "TLS_Client",
                "trustCA": {
                     "bigip": "/Common/default.crt"
                }
            }      
        }
    }
}

For versions prior to 13.1

In this example, you specify the certificate and key you want to use in the monitor.

{
    "class": "ADC",
    "schemaVersion": "3.10.0",
    "id": "Monitor",
    "TEST_HTTPSMonitor": {
        "class": "Tenant",
        "Application": {
            "class": "Application",
            "template": "https",
            "sampleHTTPSmonitor": {
                "class": "Monitor",
                "monitorType": "https",
                "clientCertificate": "webcert"
            },
            "webcert": {
            "class": "Certificate",
            "certificate": {"bigip":"/Common/default.crt"},
            "privateKey":{"bigip":"/Common/default.key"}
            }
        }
    }
}

Back to top

6: Creating a mySQL monitor in a declaration

This example shows how you can create a mySQL monitor in a declaration. The mySQL monitor verifies MySQL-based services. For more information, see the mySQL monitor reference. You can also refer to this older article on DevCentral about monitoring open-source databases with BIG-IP.

See Monitor_MySQL and Monitor_MySQL_Passphrase for AS3 options and usage information.

This declaration creates the following objects on the BIG-IP:

  • Partition (tenant) named mySQLTenant.
  • A virtual server named service that references the pool.
  • A pool named monitorMySQL_pool that references the monitorMySQL_AllProperties monitor.
  • Two monitors, the monitorMySQL_AllProperties monitor which contains all available mySQL monitor properties, and a simple monitor (monitorMySQL_Simple) that is created by the declaration but not used by the pool.
{
  "class": "ADC",
  "schemaVersion": "3.23.0",
  "id": "Example_Monitor_MySQL",
  "remark": "Example MySQL Monitor",
  "mySQLTenant": {
    "class": "Tenant",
    "Application": {
      "class": "Application",
      "service": {
        "class": "Service_HTTP",
        "virtualAddresses": [
          "10.0.14.10"
        ],
        "pool": "monitorMySQL_pool"
      },
      "monitorMySQL_Simple": {
        "class": "Monitor",
        "monitorType": "mysql"
      },
      "monitorMySQL_AllProperties": {
        "class": "Monitor",
        "monitorType": "mysql",
        "remark": "This is a remark",
        "targetAddress": "10.11.12.13",
        "targetPort": 3456,
        "timeUntilUp": 30,
        "timeout": 81,
        "upInterval": 5,
        "count": 10,
        "database": "test_db",
        "interval": 10,
        "send": "SELECT id,first_name,last_name",
        "receive": "something received",
        "receiveColumn": 3,
        "receiveRow": 2,
        "username": "sql-user",
        "passphrase": {
          "ciphertext": "ZjVmNQ==",
          "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJub25lIn0",
          "ignoreChanges": true
        }
      },
      "monitorMySQL_pool": {
        "class": "Pool",
        "monitors": [
          {
            "use": "monitorMySQL_AllProperties"
          }
        ],
        "members": [
          {
            "servicePort": 443,
            "serverAddresses": [
              "11.12.13.14",
              "11.12.13.15"
            ]
          }
        ]
      }
    }
  }
}

Back to top