Host and process utility functions
You can use utility functions to obtain information about the environment in which the probe is running.
The following table describes the host and process functions supported in rules files.
Function |
Description |
Example |
---|---|---|
|
Returns the value of a specified environment variable. |
|
|
Returns the IP address of the host using a naming service (for example, DNS or /etc/hosts). The argument can be a string containing a host name or an IP address. If the host cannot be looked up, the original value is returned. Note: DNS
lookup (and other similar services) can take an appreciable amount
of time which can severely impact the performance of the probe. You
should consider instead using a lookup table in the rules file, and
only use
gethostaddr if the host is not in the table. |
|
|
Returns the name of the host using a naming service (for example, DNS or /etc/hosts). The argument can be a string containing a host name or IP address. If the host cannot be looked up, the original value is returned. Note: DNS
lookup (and other similar services) can take an appreciable amount
of time which can severely impact the performance of the probe. You
should consider instead using a lookup table in the rules file, and
only use
gethostname if the host is not in the table. |
|
|
Returns the process ID of the running probe. |
|
|
Returns the operating system platform the probe is running under. One of the following values is returned: linux2x86, solaris2, hpux11, aix5, or win32. |
|
|
Returns the name of the host on which the probe is running. |
|