Monitoring Agent statement configuration examples

When you add options for Monitoring Agents to the statement section of the sgagent.conf file, you can use the following examples as a guide.

Port option example

To use port 5555 for the communication between the engines and the Server Pool members instead of the default port:
config port 5555

Boot-delay option example

To set a boot delay of 20 seconds on server1:
begin host server1
config boot-delay 20
end

Alert-interval option example

To set an alert interval of 1 hour on servers 1 and 2:
begin host server1 server2
config alert-interval 1:00:00
end

Alert-script option example

To run alertscript.sh every time an alert is generated:
config alert-script /etc/test/alertscript.sh

Startup-script option example

To run startup.sh when the Monitoring Agent starts on server1:
begin host server1
config startup-script /etc/test/startup.sh
end

Overload-script option example

To run overload.sh script when the threshold value of the load index is reached on server2:
begin host server2
config overload-script /etc/test/overload.sh
end

Listen option example

To make the Monitoring Agent of server2 listen to the IP address 192.168.10.31 using the default port 7777:
begin host server2
config listen 192.168.10.31
end

Load-index option example

This example demonstrates how the measurement of load-average-5 is used on all servers except server1 to compare against the threshold value 4. When the load-average is higher than 4, a log message is generated:
begin host not server1
config load-index 400 load-average-5
end
Because server1 is ignored in the previous statement, it would typically have its own statement with different options, such as the following statement:
begin host server1
config load-index 400 load-average-1
end

Load-index-action option example

To set the server status to Excluded when the threshold value of the load index is reached on server2:
begin host server2
config load-index-action exclude 10
end