Example Code- Verify the Version of the PATROL Agent


The example code in this section creates the PatrolVersionCheck() function that evaluates the version number of the PATROL Agent. The PatrolVersionCheck() function returns a value greater than 0 if the version number indicates that the agent can run international PSL functions. Otherwise, it returns a 0.

export function i18n_set_locale
function PatrolVersionCheck()
{
i18n_version = 0
patrol_version = substr(get("/patrolVersion"), 2, 1);
patrol_release = ntharg(get("/patrolVersion"), 2, ".");
patrol_release2 = ntharg(get("/patrolVersion"), 3, ".")
patrol_release3 = ntharg(get("/patrolVersion"), 4, ".")


if( patrol_version == 3 )
{
if (( patrol_release == 4 ) && (patrol_release2 >= 11))
{
 i18n_version = 1
}
 if (patrol_release > 4)
{
i18n_version = 1
}
if ((patrol_release == 2) && (patrol_release2 == 9) && (patrol_release3 >=1))
{
i18n_version = 2;
}
if( patrol_version > 3)
{
i18n_version = 1;
}
return i18n_version;
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC PATROL Agent 20.08