We need to monitor the number of active connections on a port, report this as a QOS metric and alarm if a threshold is breached. Is this possible?
There is no probe that can achieve this natively as a qos however it is possible to use the logmon probe to execute netstat to collect this data and then report this as a QOS value.
The netstat command to collect the number of active connections to a port is
netstat -na | find /c "port"
eg to collect port 48000
netstat -na | find /c "48000"
The instructions below show how to configure the logmon probe to run this command, generate QOS messages for the number of active connections to port 48000 and generate alarms when thresholds are breached
- Open logmon configuration and click the setup button
- Select the "Quality of Service Definitions" tab
- Click the green plus to create a new QoS Definition
- QoS name = Qos_port_48000_connections
- Description = number of connections to port 48000
- QoS Unit and Unit Abbreviation = "Bytes" "B"
- Create a new profile called "port_48000" and define the following settings on the General tab
- Mode = command
- Command = netstat -na | find /c "48000"
- Select "Generate Quality of Service"
- Select "Generate Alarm"
- No need to create a Format Rule
- Create a Watcher Rule called "count" and configure the watcher tabs as below
- Create a new variable called "connections"
- in variable settings select "text Block"
- ok the variable settings
- Dbl Click "connections" under "QoS on Variables"
- QoS Name = Qos_port_48000_connections
- QoS Target = <Robot name>
Create Alarm based on Threshold
- Each Alarm threshold requires an additional watcher
- You need to use a regex expression to define the threshold
- This example sets an alarm when the number of connections is >400 so we need a regex for >400
- Create a Watcher Rule called "alarm greater than 400" and configure the watcher tabs as below
- Match Expression = [4-9](?!00$)[0-9][0-9]
- Message to Send on Match = Connections on port 48000 exceeded 400
- Message Severity = Your choice of severity for this alarm