//-------------------------------------------
        public CDefinitionProprieteDynamiqueSnmpTable(IDefinition definition)
            : base(definition.Name,
                   ObjectIdentifier.Convert(definition.GetNumericalForm()).Replace('.', '_'),
                   new CDynamicSnmpTableDef(definition), "")

        {
            Rubrique = CInterrogateurSnmp.CalcRubriqueChamp(definition);
        }
Beispiel #2
0
        /// //////////////////////////////////////////
        public override CResultAErreur MyEval(CContexteEvaluationExpression ctx, object[] valeursParametres)
        {
            CResultAErreur     result = CResultAErreur.True;
            CInterrogateurSnmp agent  = ctx.GetObjetAttache(typeof(CInterrogateurSnmp)) as CInterrogateurSnmp;

            if (agent == null)
            {
                agent = new CInterrogateurSnmp();
                ctx.AttacheObjet(typeof(CInterrogateurSnmp), agent);
            }
            result.Data = agent;
            return(result);
        }
Beispiel #3
0
        //--------------------------------------------------------------
        public sc2i.common.CResultAErreur GetValue(object objet, string strPropriete)
        {
            CResultAErreur     result = CResultAErreur.True;
            CInterrogateurSnmp mibDyn = objet as CInterrogateurSnmp;

            if (mibDyn != null)
            {
                try{
                    CResultAErreurType <Variable> resVar = mibDyn.Connexion.Get(ObjectIdentifier.Convert(strPropriete.Replace('_', '.')));
                    if (resVar)
                    {
                        result.Data = resVar.DataType.Data.ToString();
                    }
                }
                catch {}
            }
            return(result);
        }
        //-----------------------------------------------------------------
        public CResultAErreur GetValue(object objet, string strPropriete)
        {
            CResultAErreur result = CResultAErreur.True;

            result.Data = null;
            CInterrogateurSnmp mib = objet as CInterrogateurSnmp;

            if (mib == null)
            {
                return(result);
            }
            try
            {
                result.Data = new CDynamicSnmpTable(mib, ObjectIdentifier.Convert(strPropriete.Replace('_', '.')));
            }
            catch
            {
            }
            return(result);
        }
Beispiel #5
0
        //--------------------------------------------------------------
        public sc2i.common.CResultAErreur SetValue(object objet, string strPropriete, object valeur)
        {
            CResultAErreur     result = CResultAErreur.True;
            CInterrogateurSnmp mibDyn = objet as CInterrogateurSnmp;

            if (mibDyn != null)
            {
                try
                {
                    string strOID = strPropriete;
                    if (strOID[strOID.Length - 1] != '.')
                    {
                        strOID += ".";
                    }
                    strOID     += "0";
                    result      = mibDyn.Connexion.Set(ObjectIdentifier.Convert(strPropriete.Replace('_', '.')), valeur);
                    result.Data = valeur;
                }
                catch { }
            }
            return(result);
        }
Beispiel #6
0
 //-------------------------------------------------------------------------
 public CDefinitionProprieteDynamiqueSNMPVariable(IDefinition definition)
     : base(definition.Name, ObjectIdentifier.Convert(definition.GetNumericalForm()).Replace('.', '_'),
            new CTypeResultatExpression(typeof(string), false), false, false)
 {
     Rubrique = CInterrogateurSnmp.CalcRubriqueChamp(definition);
 }
Beispiel #7
0
 public CDynamicSnmpTable(CInterrogateurSnmp dynamicMib, uint[] oid)
 {
     m_oid          = oid;
     m_mibDynamique = dynamicMib;
 }