November 6, 2007
To
programming a SNMP application with PHP is a simple job, it’s not a difficult
thing, but you must have at least these things:.
- Have a SNMP installed on your
Windows. - Have a snmputil.exe, make
sure you have the original EXE
that made by Microsoft Corporation, or you can download it here - Have knowledge about SNMP and
how it works. - PHP Server is installed on
your PC - Have knowledge in programming
with PHP.
First,
you must have SNMP installed on your Windows, go to Control Panel -> Add/Remove Programs -> Add/Remove Windows
Components -> Management and Monitoring tools .. Checklist on Simple Network Management Protocol. And
OK… I highly recommend to restart the PC after this step.
Second,
put your snmputil.exe in C:\ directory, and run it from CMD..
Type:
C> snmputil get 127.0.0.1 public
.1.3.6.1.2.1.1.1.0, if the
result looks like below,
SNMP
is runs perfectly
CONNECTING PHP AND SNMP
Third,
Edit your php.ini file so that php
load SNMP module, this module used by PHP to connect with SNMP that installed
on your PC.
How
to edit ??? go to your server directory and find file php.ini, for example if
you use XAMPP server, the default directory would be C:\Program
Files\xampp\apache\bin, please check your server manual, or run phpinfo(); to get info where
your php.ini is located.
Back
to php.ini editing, open your php.ini with notepad and find the line ;extension=php_snmp.dll
and omit the semicolon (;) so
the line will be extension=php_snmp.dll,
Save the file, and restart your PHP server, don`t know how to do it ?? restart
is only turn-it-off-and-turn-it-on-again
action.. still not understood ? pliz googling it and find the answer for
yourself L
Now,
the final is… Write down, save as PHP file, and run the script below from
your server.
<?php
$result=snmpget”127.0.0.1”,
“public”,” .1.3.6.1.2.1.1.1.0”);
echo
$result;
?>
if
the result has no error message in it, congratz,, now you can do programming
with SNMP through PHP, you can search on internet for more info about SNMP
syntax and OID in PHP.
Entry Filed under: Uncategorized. .
2 Comments Add your own
Leave a comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
1. 'Ceru'Adrian | November 11th, 2007 at 12:08 pm
kerjakan skripsi kita dengan benar!
2. Ronald | November 12th, 2007 at 12:21 am
ngomonglah ke diri sendiri :>