Logo Search packages:      
Sourcecode: nagstamon version File versions  Download package

def Nagstamon::nagstamonGUI::Popwin::TreeviewPopupMenuResponse (   self,
  widget,
  remoteservice 
)

    responses to the menu items
    binaries get called by subprocess.Popen to beware nagstamon of hanging while
    waiting for the called binary exit code
    the requested binary and its arguments are given by a list

Definition at line 1340 of file nagstamonGUI.py.

01340                                                               :
        """
            responses to the menu items
            binaries get called by subprocess.Popen to beware nagstamon of hanging while
            waiting for the called binary exit code
            the requested binary and its arguments are given by a list
        """
        
        # closing popwin is innecessary in case of rechecking, otherwise it must be done
        # because the dialog/app window will stay under the popwin   
        if not remoteservice == "Recheck":
            self.Close()  
        
        #debug    
        if str(self.conf.debug_mode) == "True":
            print self.miserable_server.name, ":", remoteservice, self.miserable_host, self.miserable_service
            
        # choose appropriate service for menu entry
        # it seems to be more responsive especially while rechecking if every service
        # looks for its own for the miserable host's ip if it is needed
        try:
            if remoteservice == "SSH":
                # get host ip to connect to be independent of dns resolver
                host = self.miserable_server.GetHost(self.miserable_host)
                if host != "ERROR":
                    # workaround for bug 2080503@sf.net
                    if self.conf.app_ssh_options == "": args = self.conf.app_ssh_bin + " " + host
                    else: args = self.conf.app_ssh_bin + " " + self.conf.app_ssh_options + " " + host
                    sub = subprocess.Popen(args.split(" "))
            elif remoteservice == "RDP":
                # get host ip to connect to be independent of dns resolver
                host = self.miserable_server.GetHost(self.miserable_host)
                if host != "ERROR":
                    # workaround for bug 2080503@sf.net
                    if self.conf.app_rdp_options == "": args = self.conf.app_rdp_bin + " " + host
                    else: args = self.conf.app_rdp_bin + " " + self.conf.app_rdp_options + " " + host
                    sub = subprocess.Popen(args.split(" "))
            elif remoteservice == "VNC":
                # get host ip to connect to be independent of dns resolver
                host = self.miserable_server.GetHost(self.miserable_host)
                if host != "ERROR":
                    # workaround for bug 2080503@sf.net
                    if self.conf.app_vnc_options == "": args = self.conf.app_vnc_bin + " " + host
                    else: args = self.conf.app_vnc_bin + " " + self.conf.app_vnc_options + " " + host
                    sub = subprocess.Popen(args.split(" "))
            elif remoteservice == "HTTP":
                # get host ip to connect to be independent of dns resolver
                host = self.miserable_server.GetHost(self.miserable_host)
                if host != "ERROR":
                    nagstamonActions.TreeViewHTTP(host)
            elif remoteservice == "Nagios":
                # let nagstamonActions.TreeViewNagios do the work to open a webbrowser with nagios informations
                nagstamonActions.TreeViewNagios(self.miserable_server, self.miserable_host, self.miserable_service)
            elif remoteservice == "Recheck":
                # start new rechecking thread
                recheck = nagstamonActions.Recheck(server=self.miserable_server, host=self.miserable_host, service=self.miserable_service)
                recheck.start()
            elif remoteservice == "Acknowledge":
                self.output.AcknowledgeDialogShow(server=self.miserable_server, host=self.miserable_host, service=self.miserable_service)
            elif remoteservice == "Downtime":
                self.output.DowntimeDialogShow(server=self.miserable_server, host=self.miserable_host, service=self.miserable_service)
            # close popwin
            self.PopDown()
                
        except Exception, err:
            self.output.ErrorDialog(err)
            

    def ComboboxClicked(self, widget=None):


Generated by  Doxygen 1.6.0   Back to index