remote_check()
Check the validity of a remote session
Format
remote_check(sessionID)
Parameter
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameter | Definition |
| sessionID | identifier of the remote PatrolAgent session that is to be verified. The sessionID is returned by the remote_open() function when you open a remote PatrolAgent session. |
Description
The remote_check() function verifies whether a remote session to another PATROLAgent is still valid. The function returns 1 if the session is still valid. If the session is no longer valid, the function returns 0 and errno is set to E_PSL_REMOTE_SESSION_INVALID (145).
Example
Code:
targetHost="192.168.10.100";
targetPort="3181";
user="patrol";
password="Pat123rol";
encrypted_passwd=encrypt(password,"PEM");
mysession=remote_open(targetHost,targetPort,"PEM",user,encrypted_passwd);
r_check=remote_check(mysession);
print("r_check: ",r_check,"\n");
if(r_check==1){
remote_event_trigger(mysession,"myorigin","STD","41","ALARM","5","myarg");
}
else
{
print("Lost connection to remote Agent.Go to plan B.\n",errno,"\n");
}
Output:


