Following an example, getting latest data for a host via the API and Perl is pretty straight forward:
which is super nice and all but returns values to 4 decimal places and only two are significant
I noticed selectPreprocessing "Left trim" would suggest that I can preprocess the API call to return values left trimmed to drop the last two digits, but I'm not sure how. The 4.x API documentation doesn't have an example, the 5.x documentation example isn't obvious to me.
Does anyone have implementation examples? Seems like a convenient feature.
-David
Code:
$json = {
jsonrpc=> '2.0',
method => 'item.get',
params =>
{
output => ['itemid','name','key_','lastvalue'],
host => "Group Temp",
sortfield => 'name'
},
id => 3,
auth => "$authID",
};
$response = $client->call($url, $json);
which is super nice and all but returns values to 4 decimal places and only two are significant
I noticed selectPreprocessing "Left trim" would suggest that I can preprocess the API call to return values left trimmed to drop the last two digits, but I'm not sure how. The 4.x API documentation doesn't have an example, the 5.x documentation example isn't obvious to me.
Does anyone have implementation examples? Seems like a convenient feature.
-David
Comment