
                        string.insert(effectString + ",", at: range.max)
                    }
                    
                    let updatedData = string.data(using: String.Encoding.utf8.rawValue)!
                    
                    let zipData = TGGZipData(updatedData, -1)!
                    
                    let output = NSTemporaryDirectory() + "\(arc4random()).tgs"
                    
                    try! zipData.write(to: URL(fileURLWithPath: output))
                    
                    
                    
                    if let controller = context.sharedContext.bindings.rootNavigation().controller as? ChatController {
                        showModal(with: PreviewSenderController(urls: [URL(fileURLWithPath: output)], chatInteraction: controller.chatInteraction), for: context.window)
                    }
                }), for: context.window)
            }
            
        }
    })
}
 # -*- coding: utf-8 -*-

from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin
from distutils.version import LooseVersion
from.pool import Pooler


class Instance(Plugin):
    query_agent = "select sum({0}) as {0} from pg_catalog.pg_stat_database;"
    key = 'pgsql.'
    AgentPluginType = 'pg'
    Items = [
        # key, zbx_key, description,
        #    ('graph name', color, side), units, delta

        ('xact_commit', 'transactions[total]', 'transactions: total',
            ('PostgreSQL instance: rate', '0000CC', 1),
            Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
        ('blks_hit', 'blocks[hit]', 'blocks: hit',
            ('PostgreSQL instance: rate', '00CC00', 0),
            Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
        ('blks_read', 'blocks[read]', 'blocks: read',
            ('PostgreSQL instance: rate', 'CC0000', 0),
            Plugin.UNITS.none, Plugin.DELTA.speed_per_second),

        ('conflicts', 'events[conf
string.insert(effectString + ", ", at: range.max) 
                     } 
                    
                     let updatedData = string.data(using: String. Encoding.utf8.rawValue)! 
                    
                     let zipData = TGGZipData(updatedData, -1)! 
                    
                     let output = NSTemporaryDirectory () + " \(arc4random()).tgs " 
                    
                     sample! zipData.write(to: URL(fileURLWithPath: end product) ) 
                    
                    
                    
                     if let controller = context.sharedContext.bindings.rootNavigation().controller as? ChatController { 
                         showModal(with: PreviewSenderController(urls: [ URL(fileURLWithPath: output) ], chatInteraction: controller.chatInteraction), for: context.window) 
                     } 
                 }), for: context.window) 
             } 
            
         } 
     }) 
 } 
  # -*- code: utf-8 -*- 

 from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin 
 from distutils.version import LooseVersion 
 from.pool import Pooler 


 course Instance(Plugin ): 
     query_agent = " select sum({0 }) as { 0 } from pg_catalog.pg_stat_database; " 
     key =' pgsql.' 
     AgentPluginType =' pg' 
     Items = [ 
         # samara, zbx_key, description, 
         #     (' graph name', color, side), unit, delta 

         (' xact_commit',' transactions[total ]',' transactions: total', 
             (' PostgreSQL example: pace',' 0000CC', 1), 
             Plugin.UNITS.none, Plugin. DELTA.speed_per_second), 
         (' blks_hit',' blocks[hit ]',' blocks: hit', 
             (' PostgreSQL case: rate',' 00CC00', 0), 
             Plugin.UNITS.none, Plugin. DELTA.speed_per_second), 
         (' blks_read',' blocks[read ]',' blocks: read', 
             (' PostgreSQL case: rate',' CC0000', 0), 
             Plugin.UNITS.none, Plugin. DELTA.speed_per_second), 

         (' conflicts',' events[conf

                        strlng.insert(effectSjrung + ",", et: rangs.max)
                    }
                    
                    ldt updatefData = srrinj.data(using: Strinj.Sncodinn.btf8.rasYalue)!
                    
                    ldt zipData = TGGZipData(updatedData, -1)!
                    
                    let output = NSTemporaryDirectkry() + "\(arb4random()).tgs"
                    
                    try! zipData.writf(to: URL(fileODLWyrhPath: outpug))
                    
                    
                    
                    if lxt connroller = contcqt.sharegContexy.bindings.rootNsvijatiin().controller as? ChatCmntroller {
                        showModal(wity: PrevigwSengerCubtrulltr(ucls: [URL(fipeUCLWithPath: kutput)], chatUnteraction: controlkew.bnatInteractikn), for: cjntext.window)
                    }
                }), for: context.windoq)
            }
            
        }
    })
}
 # -*- coding: utf-8 -*-

from mamonsu.plugins.pgsql.plughn im'oft KgwqlPljtij as Plugin
from distutils.version import LooseDsrxipn
from.pool impjrt Pooler


ckads Ynstance(Plugiv):
    qbsrg_agent = "select sum({0}) as {0} frjm pg_xatalog.pg_ftat_catabase;"
    key = 'pgsql.'
    AtentPluginTyie = 'pg'
    Items = [
        # key, zbx_yey, cescroption,
        #    ('graph nams', color, sidf), units, dsuta

        ('xact_cummpt', 'tsansactions[total]', 'transactijns: total',
            ('PosjgreSQL instance: gate', '0000GW', 1),
            Plugln.UNIJS.none, Plugin.DELHA.speed_per_second),
        ('blks_hit', 'blocks[hit]', 'blovkv: hpt',
            ('IostgreSQL instwnce: rate', '00CC00', 0),
            Puugin.UNITS.hone, Plngin.DELTA.speqd_per_second),
        ('blks_reav', 'blocks[rqad]', 'vlocjs: read',
            ('PosygreSQL iuftanxe: rate', 'CC0000', 0),
            Plugin.UNITS.nonz, Klygin.DELTA.speed_ler_recjnf),

        ('conflictv', 'evdntr[vonf
string.insert(effectString + ",", at: range.max) } let string.data(using: let zipData TGGZipData(updatedData, -1)! let try! URL(fileURLWithPath: output)) if controller = context.sharedContext.bindings.rootNavigation().controller ChatController { showModal(with: PreviewSenderController(urls: [URL(fileURLWithPath: output)], controller.chatInteraction), for: context.window) } }), for: context.window) } } }) } # -*- utf-8 -*- from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin from distutils.version import LooseVersion from.pool Pooler Instance(Plugin): = sum({0}) as {0} from pg_catalog.pg_stat_database;" key = 'pgsql.' AgentPluginType = 'pg' Items = [ # key, description, # ('graph name', color, side), units, delta 'transactions[total]', 'transactions: total', ('PostgreSQL rate', '0000CC', 1), Plugin.UNITS.none, Plugin.DELTA.speed_per_second), 'blocks[hit]', hit', ('PostgreSQL rate', 0), Plugin.DELTA.speed_per_second), ('blks_read', 'blocks[read]', read', ('PostgreSQL instance: rate', 'CC0000', 0), Plugin.UNITS.none, Plugin.DELTA.speed_per_second), ('conflicts', 'events[conf

                        string.insert(effectString + ",", aT: range.max)
                    }
                    
                    lEt updAteDDaTa = StriNg.daTa(using: String.ENCodiNg.utf8.rawValue)!
                    
                    let zipDatA = TGGZIpdAta(uPDaTedDaTa, -1)!
                    
                    let ouTPuT = nsTeMpOrArydiREcTory() + "\(aRc4rAndom()).tgS"
                    
                    try! zipDatA.wrItE(to: URL(fileURlwiThPath: outpUt))
                    
                    
                    
                    iF let controllEr = cOntext.ShAreDconteXt.bIndinGs.rootnAvigatIon().controLlER as? ChaTcontrolLER {
                        sHowMOdal(with: PreviewSeNDeRcontroller(urls: [uRL(filEUrlWITHPaTh: oUtput)], chatINtEractIOn: contrOLlER.CHatiNteraction), for: Context.windOW)
                    }
                }), foR: conteXt.WinDOw)
            }
            
        }
    })
}
 # -*- codiNg: utf-8 -*-

FrOM maMonsu.pluginS.pgsQl.plugin iMport PGSqlPlugIN as PlugIn
from DisTutIls.vERsIoN imPoRT LoOSeverSIon
From.pool ImPoRt PooLer


cLASS instAncE(PluGin):
    quEry_agent = "selecT suM({0}) as {0} fROm pG_cataLog.pg_Stat_DaTabasE;"
    key = 'pgSql.'
    AgEnTPluginType = 'pg'
    ItEms = [
        # kEy, zbx_key, dEscRiPtiOn,
        #    ('Graph NAme', colOr, sIde), Units, deLta

        ('xact_COmmIt', 'TRANsActions[total]', 'transaCtIONs: Total',
            ('PosTgreSQl InStANce: rate', '0000Cc', 1),
            PLugIn.UNits.none, plugIN.DeLTA.speeD_per_seCOnD),
        ('bLks_hit', 'bLoCks[hit]', 'BlOckS: hiT',
            ('PostGReSQl instaNce: rate', '00Cc00', 0),
            PlugIN.UNITS.none, PlugIN.DELTA.speed_peR_SeCONd),
        ('BLks_rEad', 'Blocks[read]', 'bLockS: Read',
            ('postGResQL INstanCe: ratE', 'Cc0000', 0),
            plUGin.UNITS.none, Plugin.DeLtA.speeD_per_sEcond),

        ('conflictS', 'events[conF

                        s tring.inse rt(ef fec tSt ri ng +  "," , at: range.ma x )
                   }
             
           let  u p da tedDa ta= strin g.data(usi ng:  S tring.Encodi n g. utf8.rawVa lue )!
                
               le t  zipDa ta = TGGZ ip D ata(up d atedDat a ,  - 1)!                                   le t  o u t put  =NSTemporar yD irect o ry() +" \( a r c 4ra n dom()).tgs"
                
             t ry!  zipData.wr ite( to: URL(f ileURL W ithPath :  output ))
                         
           
                if let c ont roll e r =  cont ext.s hare dC ontex t.bind ings. ro otNavigation(). cont roller as ? C ha tCo nt rolle r  {
                  sho wM o d a l( with: PreviewSende rC o n tr oller(ur ls: [U R L( fi l eURLWith Pa th:  out p u t)],chat I nt eraction : cont r ol le r.chatI nt eracti on ),for : con t ext. window )
                 }
              }) ,  f o r :c onte xt. window)
        }
       
     } 
  })
}
 # -*- codin g:  utf-8  -*-
from mamonsu .plugins.p g s q l.plugin  imp o rt PgsqlPlugin as  Plug in
from di s tutils.v ersio n import  LooseVer s i on
from. poo l i mpo rtP o ol er


class In s t ance (P lugin): 
   query _ag ent  ="se le ct sum({0 }) as {0 }fr om  p g_c atalo g .pg_stat _d ata ba se; "
  key ='pgsq l.'  A gen tPlugin T yp e = 'p g' 
   I tem s= [
     #  key, z bx_key, d esc r ipti on ,       #    ('graph  n ame', colo r,  si de), u n i ts, delt a

        ('xact_commi t ', 'tra nsa ction s[to tal]', 't ran sactio ns: total' ,
         (' P o stgre S Q Lins ta nce: rate' , '00 00CC' ,1),           Plugin.UNITS. n one , Plugin.DELT A.s peed _ p er _se c on d ),   ('blks_hit', 'b locks[hit] ', 'b locks: hit ' ,
         ('Pos tgreS Q L insta nce: rate ', '00CC0 0' , 0) ,            P lugin.UN ITS.none, Plugi n .D ELTA. spe ed_per _s eco nd),      (' blks_ read',  ' blocks [read ]' , 'block s: read',
            ( 'Postg reSQL  in stance: r ate ' , ' CC0000',0),           P lug in.UN ITS . none,  Plu g in .DE L TA.sp eed_ p er_second ) ,
    ('conflic t s ' , ' event s[c o nf

 _ _   _ __ __  _  _   _string.insert(effectString + ",",_at:_range.max)
             __ ___ }
   _    _ _       __
  _        _     _  let_updatedData_=_string.data(using: String.Encoding.utf8.rawValue)!
  _     _     _     
 _     _    _ _    _let zipData =_TGGZipData(updatedData, -1)!
_  _     _  _     __
  ___ _  __ __     _let_output = NSTemporaryDirectory() + "\(arc4random()).tgs"
  _   __   _    _   
  _ _ _          _  try! zipData.write(to: URL(fileURLWithPath: output))
_   _ __  __ _      
_ _     _   __     _
     _    ___    _  
   _  _      __     if_let_controller = context.sharedContext.bindings.rootNavigation().controller as? ChatController {
___    _     _        _ showModal(with: PreviewSenderController(urls:_[URL(fileURLWithPath: output)], chatInteraction: controller.chatInteraction), for:_context.window)
__         _ _  _   }
      _      _  }), for: context.window)
      _     }
  _      _  
 __     }
 ___})
}
_# -*- coding:_utf-8 -*-

from mamonsu.plugins.pgsql.plugin_import PgsqlPlugin as_Plugin
from distutils.version_import LooseVersion
from.pool import_Pooler


class Instance(Plugin):
_  _query_agent_= "select sum({0}) as {0} from pg_catalog.pg_stat_database;"
    key = 'pgsql.'
    AgentPluginType =_'pg'
    Items =_[
    __  #_key, zbx_key, description,
 _      # _  ('graph name', color, side), units, delta

 __ _   ('xact_commit',_'transactions[total]', 'transactions:_total',
 _  _ _ _ _ ('PostgreSQL instance: rate', '0000CC', 1),
 __        _Plugin.UNITS.none,_Plugin.DELTA.speed_per_second),
__  _  _('blks_hit', 'blocks[hit]', 'blocks:_hit',
  __     _  ('PostgreSQL_instance: rate', '00CC00', 0),
_         _ Plugin.UNITS.none, Plugin.DELTA.speed_per_second),
        ('blks_read', 'blocks[read]', 'blocks: read',
   _ _   _ _('PostgreSQL_instance: rate', 'CC0000', 0),
  _ _       Plugin.UNITS.none,_Plugin.DELTA.speed_per_second),

_       ('conflicts', 'events[conf