Subversion Repositories DevTools

Rev

Rev 1361 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1361 Rev 4123
Line 46... Line 46...
46
    /**
46
    /**
47
    * This method start the thread and performs all the operations.
47
    * This method start the thread and performs all the operations.
48
    */
48
    */
49
    public void run() {
49
    public void run() {
50
        mLogger.fatal("NagiosThread Run");
50
        mLogger.fatal("NagiosThread Run");
-
 
51
        setName("Nagios");
51
        try {
52
        try {
52
            // Wait for connection from client.
53
            // Wait for connection from client.
53
            while (isRunning) {
54
            while (isRunning) {
54
                Socket socket = srv.accept();
55
                Socket socket = srv.accept();
-
 
56
                mLogger.warn("Nagios Socket Accepted");
-
 
57
                
55
 
58
 
56
            // Open a reader to receive (and ignore the input)
59
            // Open a reader to receive (and ignore the input)
57
            BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
60
            BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
58
 
61
 
59
            // Write the status message to the outputstream
62
            // Write the status message to the outputstream
Line 65... Line 68...
65
                    wr.write("Build Daemon status: NULL\n");
68
                    wr.write("Build Daemon status: NULL\n");
66
                } else if ( mBuildDaemon.checkThreads() ) {
69
                } else if ( mBuildDaemon.checkThreads() ) {
67
                    wr.write("Build Daemon status: OK\n");
70
                    wr.write("Build Daemon status: OK\n");
68
                } else {
71
                } else {
69
                    wr.write("Build Daemon status: NOT HAPPY\n");
72
                    wr.write("Build Daemon status: NOT HAPPY\n");
-
 
73
                    mLogger.fatal("NagiosThread: NOT HAPPY");
70
                }
74
                }
71
 
75
 
72
                wr.write("Version: "+ this.getClass().getPackage().getImplementationVersion() + "\n");
76
                wr.write("Version: "+ this.getClass().getPackage().getImplementationVersion() + "\n");
73
                wr.write("HostName: "+ mBuildDaemon.mHostname + "\n");
77
                wr.write("HostName: "+ mBuildDaemon.mHostname + "\n");
74
 
78