Search code examples
lotus-domino

Can I read a notes.ini parameter from a different server?


I wonder if I am able to open a server connection in an Agent running on server A to access the notes.ini of server B. I want to read check for a parameter in that notes.ini. Is that possible via coding? I am aware of session.getEnvironment methods but they access the notes.ini of the server where the Agent is running on (or the Notes client). Any ideas?

Used the solution from Egor:

/**
 * checks for notes.ini value for
 * @return
 * @throws NotesException
 */
private boolean checkNoSessionInfo(String serverName) {
    boolean result = false;
    try {
        String console = session.sendConsoleCommand(serverName, "show config *");
        result = console.contains("LOG_DISABLE_SESSION_INFO=1");
    } catch (NotesException e) {
        oli.logErrorEx(e, "Could not check if server's user session info was disabled", OpenLogItem.SEVERITY_MEDIUM, null);
    }
    return result;
}

Works like a charm! :-)

Thank you all!


Solution

  • Try to add the Server A to Trusted Servers of Server B server document in names.nsf (and maybe few other fields on security tab). After I'd just use Session.sendConsoleCommand method (use command "show config *". See documentation for reference: https://www-01.ibm.com/support/knowledgecenter/SSVRGU_9.0.1/com.ibm.designer.domino.main.doc/H_SENDCONSOLECOMMAND_METHOD_SESSION_JAVA.html