public static void main(String args[])
    {
        String externalIp = (args.length < 1) ? null : args[0];
        int automatic = (args.length < 2) ? 0 : Integer.valueOf(args[1]);

        if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }


        ConnectionRegistry registry;
        try {
            registry = new ConnectionRegistry(LocateRegistry.getRegistry(), externalIp);
        } catch (RemoteException e) {
            e.printStackTrace();
            return;
        }

        if (automatic == 0) {
            consoleMonitor(registry);
        } else {
            autoMonitor(registry);
        }
    }