Jump to content

PHP network monitoring


mrjgx

Recommended Posts

Hi guys i;m new here and really need help..

 

I need to develop a script that will able to monitor other pc's network activity. for example, if there are 1 pc in the LAN that is trying to access google, using port 80, i will be notified.

 

Any idea how to develop that? or a sample code about network monitoring would be greatly appreciated.

 

Thx in advance  :D

Link to comment
Share on other sites

thx for pointing out the installation notes. i already have them when i download the scripts, but i stuck at here:

 

3) PHP installed with snmp support

(use ./configure --with-snmp when compiling PHP)

 

 

what does it means? i already install snmp services using win xp cd, but my php.ini seems doesnt have any snmp inside it. can somebody help me with configuring snmp into the php.ini?

 

 

Link to comment
Share on other sites

the server is in my localhost, using netserver, php 4.3.9 and apache webserver.

 

ok i've put the php_snmp.dll and php_sockets.dll in the php.ini files, but the snmp function queries didnt return any result.

 

for example:

 

$name = @ snmpget($ipaddress, "public", "system.sysName.0", 2);

 

echo $name;

 

it will not return anything. is there something i miss?

 

 

Link to comment
Share on other sites

About @

PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.

 

Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why.

 

Link to comment
Share on other sites

ok thx a lot..so the error invalid object identifer problem is? how to solve it..

 

 

<?php

$a = snmpwalk("127.0.0.1", "public", "");

 

foreach ($a as $val) {

    echo "$val\n";

}

 

?>

 

the above example query by snmpwalk function works fine, but snmpget() didnt return anything but error.

 

 

 

much thxxx guys ~

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.