Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 05.05.05 09:30 
Hallo !
Hat jemand von euch schonmal mit den INDY SNMP Kompos gearbeitet ?
Ich müsste nämlich von einen Rechner den Wert interfaces.ifTable.ifEntry.ifInOctets.2 per SNMP abfragen, habe aber keine Ahnung wie das mit der INDY Kompo geht.

Danke für eure Hilfe,
Matze

_________________
In the beginning was the word.
And the word was content-type: text/plain.
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 16.06.05 22:27 
habe es mittlerweile selbt hinbekommen !
und zwar so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
try
  try
    Snmp := TIdSNMP.Create(nil);
    Snmp.Query.Host := host;
    Snmp.Query.Community := community;
    Snmp.Query.PDUType := PDUGetRequest;
    snmp.ReceiveTimeout := 300;
    Snmp.Query.MIBAdd('1.3.6.1.2.1.2.2.1,'');
    if Snmp.SendQuery then  begin
      showmessage(Snmp.Reply.Value[0]);
    end;
  except
    on E:Exception do begin
       showmessage (e.message):
    end;
  end;
finally
   Snmp.Free;
end;

_________________
In the beginning was the word.
And the word was content-type: text/plain.
CarstenSchmidt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP, Win 2000
D6 Pers, D 2005 Prof
BeitragVerfasst: Di 21.06.05 07:25 
Moin!

Schon mal Synapse ausprobiert? www.ararat.cz/synapse/
Dann sieht dein code nur noch so aus:

var
response : string;
snmpsend.SNMPget('1.3.6.1.2.1.1.3.0',<snmp community>,<IP>,response);

Gruß
Carsten
s34rch
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Do 15.12.05 13:01 
kanns sein das die idsnmp kompo von delphi 7 nen kleinen bug hat? bei mir gehts erst nach der 2. ausführung dieser prozedur, oder so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
    snmp.Host      := lbltxtip.Text;
    snmp.Community:= lbltxtcommunity.Text;
    snmp.reply.Clear;
    snmp.Query.Clear;
    snmp.Trap.Clear;
    snmp.Host      := lbltxtip.Text;
    snmp.Community:= lbltxtcommunity.Text;
    Snmp.Query.PDUType := PDUGetRequest;


wenn man die einstellung host und community 2mal installiert, und dazwischen die TSNMPInfo's(reply,Query,Trap)dazwischen leert. Sonst kommt beim ersten mal immer ein Timeout und beim 2. Aufruf funktioniert es dann^^

Hab leider net rausgefunden wieso...

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.