added debug options
This commit is contained in:
		
							parent
							
								
									cc2aaee908
								
							
						
					
					
						commit
						567f4d8602
					
				
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							@ -3,6 +3,10 @@
 | 
			
		||||
"""Mailcow check for domains"""
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
from pprint import pprint
 | 
			
		||||
 | 
			
		||||
from cmk.utils import debug
 | 
			
		||||
 | 
			
		||||
# import necessary elements from API version 2
 | 
			
		||||
from cmk.agent_based.v2 import (
 | 
			
		||||
    AgentSection,
 | 
			
		||||
@ -92,6 +96,8 @@ def discover_mailcow_domains(section):
 | 
			
		||||
 | 
			
		||||
def check_mailcow_domains(item, params, section):
 | 
			
		||||
    """the check function"""
 | 
			
		||||
    if debug.enabled():
 | 
			
		||||
        pprint(section)
 | 
			
		||||
    domain = section.get(item)
 | 
			
		||||
    if not domain:
 | 
			
		||||
        # if a previously found domain does not exist anymore, create a meaningful result
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,9 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
# pylint: disable=line-too-long, simplifiable-if-statement, missing-module-docstring, too-many-locals
 | 
			
		||||
# pylint: disable=line-too-long, simplifiable-if-statement, missing-module-docstring, too-many-locals, unused-argument
 | 
			
		||||
 | 
			
		||||
from pprint import pprint
 | 
			
		||||
 | 
			
		||||
from cmk.utils import debug
 | 
			
		||||
 | 
			
		||||
# import necessary elements from API version 2
 | 
			
		||||
from cmk.agent_based.v2 import (
 | 
			
		||||
@ -61,6 +65,8 @@ def discover_mailcow_info(section):
 | 
			
		||||
 | 
			
		||||
def check_mailcow_info(params, section):
 | 
			
		||||
    """the check function"""
 | 
			
		||||
    if debug.enabled():
 | 
			
		||||
        pprint(section)
 | 
			
		||||
    # get thresholds
 | 
			
		||||
    _type, levels_num_domains = params["levels_num_domains"]
 | 
			
		||||
    _type, levels_num_mailboxes = params["levels_num_mailboxes"]
 | 
			
		||||
 | 
			
		||||
@ -3,6 +3,9 @@
 | 
			
		||||
"""Mailcow check for mailboxes"""
 | 
			
		||||
 | 
			
		||||
import time
 | 
			
		||||
from pprint import pprint
 | 
			
		||||
 | 
			
		||||
from cmk.utils import debug
 | 
			
		||||
 | 
			
		||||
# import necessary elements from API version 2
 | 
			
		||||
from cmk.agent_based.v2 import (
 | 
			
		||||
@ -112,6 +115,8 @@ def parse_mailcow_mailboxes(string_table):
 | 
			
		||||
def discover_mailcow_mailboxes(section):
 | 
			
		||||
    """the discover function"""
 | 
			
		||||
    # since we have a service with item here we must create one service per item
 | 
			
		||||
    if debug.enabled():
 | 
			
		||||
        pprint(section)
 | 
			
		||||
    for key in section:
 | 
			
		||||
        yield Service(item=key)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user