utils/check-status.js
function updateAgent(id, group, source, status) {
    var groupId = groups.indexOf(group);
    if (groupId <= 0) {
        console.error("ERROR: group='" + group + "' was not found.");
        return;
    }
    var sourceId = sources.indexOf(source);
    if (sourceId <= 0) {
        console.error("ERROR: source='" + source + "' was not found.");
        return;
    }
    console.log("UPDATE `Agents` SET `status`='" + status + "', " +
                "`agentGroup_id`='" + groupId + "', " +
                "`agentSource_id`='" + sourceId + "' WHERE " +
                "`id`='" + id + "';");
}
function updateAgent(id, group, source, status) {
    var groupId = groups.indexOf(group);
    if (groupId <= 0) {
        console.error("ERROR: group='" + group + "' was not found.");
        return;
    }
    var sourceId = sources.indexOf(source);
    if (sourceId <= 0) {
        console.error("ERROR: source='" + source + "' was not found.");
        return;
    }
    console.log("UPDATE `Agents` SET `status`='" + status + "', " +
                "`agentGroup_id`='" + groupId + "', " +
                "`agentSource_id`='" + sourceId + "' WHERE " +
                "`id`='" + id + "';");
}
function updateAgent ( id , group , source , status ) { var groupId = groups . indexOf ( group ) ; if ( groupId <= 0 ) { console . error ( "ERROR: group='" + group + "' was not found." ) ; return ; } var sourceId = sources . indexOf ( source ) ; if ( sourceId <= 0 ) { console . error ( "ERROR: source='" + source + "' was not found." ) ; return ; } console . log ( "UPDATE `Agents` SET `status`='" + status + "', " + "`agentGroup_id`='" + groupId + "', " + "`agentSource_id`='" + sourceId + "' WHERE " + "`id`='" + id + "';" ) ; }
create an UPDATE statement to set Agent status, groupId and sourceId.

@param id Agent.id
@param group string.
@param source string.
create an UPDATE statement to set Agent status groupId and sourceId .