public void checkDuplicatedRun(String startMode) {
		String existingPid = agentConfig.getAgentPidProperties(startMode);
		if (isNotEmpty(existingPid)) {
			OSProcess process = getProcess(parseInt(existingPid));
			if (process != null) {
				printHelpAndExit("Currently " + startMode + " is running with pid " + existingPid
					+ ". Please stop it before run");
			}
			agentConfig.updateAgentPidProperties(startMode);
		}
		agentConfig.saveAgentPidProperties(String.valueOf(getPid()), startMode);
	}
Check if the process is already running in this env.

@param startMode monitor or agent
ngrinder-core/src/main/java/org/ngrinder/NGrinderAgentStarter.java