====== Cacti ====== ===== Graph de la limite de conntrack ===== **Sur le serveur à grapher :** * Installer le paquet Debian //libsnmp-extension-passpersist-perl// : apt-get install libsnmp-extension-passpersist-perl * Créer le script ///usr/local/bin/conntrack-snmp// : #!/usr/bin/perl -w use strict; use SNMP::Extension::PassPersist; my $oid = '.1.3.6.1.4.1.10650.1.3.54123'; my $extsnmp = SNMP::Extension::PassPersist->new( backend_collect => \&update_tree ); $extsnmp->run; sub update_tree { my $max = `cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max`; my $cur = `cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count`; $extsnmp->add_oid_entry("$oid.0", "integer", $max); $extsnmp->add_oid_entry("$oid.1", "integer", $cur); } * Ajouter la ligne suivante à la fin du fichier ///etc/snmp/snmpd.conf// et redémarrer le service ensuite : pass_persist .1.3.6.1.4.1.10650.1.3.54123 /usr/local/bin/conntrack-snmp **Sur le serveur Cacti :** * **Ajouter deux //Data Template// comme suit :** * **Un pour la valeur //maximum// :** * **Data template :** * **Nane :** //ucd/net - Conntrack limit usage - Maximum// * **Data source :** * **Name :** //|host_description| - Conntrack limit usage - Maximum// * **Data Input Method :** //Get SNMP Data// * **Associated RRA's :** sélectionner tout * **Step :** //300// * **Data Source Active :** coché * **Data Source Item :** * **Internal Data Source Name :** //conntrack_limit_max// * **Min value :** //0// * **Max value :** //0// * **Data source type :** //GAUGE// * **Heartbeat :** //600// * **Custum Data :** * **OID :** //.1.3.6.1.4.1.10650.1.3.54123.0// * **Un pour la valeur //courante// :** * **Data template :** * **Nane :** //ucd/net - Conntrack limit usage - Current// * **Data source :** * **Name :** //|host_description| - Conntrack limit usage - Current// * **Data Input Method :** //Get SNMP Data// * **Associated RRA's :** sélectionner tout * **Step :** //300// * **Data Source Active :** coché * **Data Source Item :** * **Internal Data Source Name :** //conntrack_limit_cur// * **Min value :** //0// * **Max value :** //0// * **Data source type :** //GAUGE// * **Heartbeat :** //600// * **Custum Data :** * **OID :** //.1.3.6.1.4.1.10650.1.3.54123.1// * **Ajouter le //Graph Template// comme suit :** * **Template :** * **Name :** //ucd/net - Conntrack limit usage// * **Graph Template :** * **Title :** //|host_description| - Conntrack limit usage// * **Image format :** //PNG// * **Height :** //120// * **Width :** //500// * **Slope mode :** coché * **Auto scale :** coché * **Auto scale options :** //"Use --alt-autoscale-max (accepting a lower limit)"// * **Logarithmic Scaling :** décoché * **SI Units for Logarithmic Scaling :** décoché * **Rigid Boundaries Mode :** décoché * **Auto Padding :** coché * **Allow Graph Export :** coché * **Upper Limit :** //100// * **Lower Limit :** //0// * **Base Value :** //1000// * **Unit Grid Value :** vide * **Unit Exponent Value :** vide * **Vertical Label :** vide * **Ajouter lui ensuite ses //Graph Template Items// :** * **#1 :** * **Data Source :** //"ucd/net - Conntrack limit usage - Current"// * **Color :** //bleu// * **Opacity :** //100%// * **Item type :** //AREA// * **Consolidation Function :** //Average// * **CDEF Function :** //None// * **Value :** vide * **GPRINT Type :** //Normal// * **Text format :** //"Conntrack count:"// * **Insert Hard Return :** décoché * **#2 :** * **Data Source :** //"ucd/net - Conntrack limit usage - Current"// * **Color :** //none// * **Opacity :** //(disabled)// * **Item type :** //GPRINT// * **Consolidation Function :** //LAST// * **CDEF Function :** //None// * **Value :** vide * **GPRINT Type :** //Normal// * **Text format :** //"Current:"// * **Insert Hard Return :** décoché * **#3 :** * **Data Source :** //"ucd/net - Conntrack limit usage - Current"// * **Color :** //none// * **Opacity :** //(disabled)// * **Item type :** //GPRINT// * **Consolidation Function :** //AVERAGE// * **CDEF Function :** //None// * **Value :** vide * **GPRINT Type :** //Normal// * **Text format :** //"Avg:"// * **Insert Hard Return :** décoché * **#4 :** * **Data Source :** //"ucd/net - Conntrack limit usage - Current"// * **Color :** //none// * **Opacity :** //(disabled)// * **Item type :** //GPRINT// * **Consolidation Function :** //MAX// * **CDEF Function :** //None// * **Value :** vide * **GPRINT Type :** //Normal// * **Text format :** //"Max:"// * **Insert Hard Return :** coché * **#5 :** * **Data Source :** //"ucd/net - Conntrack limit usage - Maximum"// * **Color :** //rouge// * **Opacity :** //100%// * **Item type :** //LINE1// * **Consolidation Function :** //LAST// * **CDEF Function :** //None// * **Value :** vide * **GPRINT Type :** //Normal// * **Text format :** //"Limit:"// * **Insert Hard Return :** décoché * **#6 :** * **Data Source :** //"ucd/net - Conntrack limit usage - Maximum"// * **Color :** //None// * **Opacity :** //(disabled)// * **Item type :** //GPRINT// * **Consolidation Function :** //LAST// * **CDEF Function :** //None// * **Value :** vide * **GPRINT Type :** //Normal// * **Text format :** //"Current:"// * **Insert Hard Return :** coché