All pastes #351962 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-12 14:22 UTC
rendered paste body
<?php
$file       = "dump.txt";       // file to save all things to.
$host       = "axdevelop";      // SNMP host.
$community  = "public";         // SNMP community name.
$object     = "hrSWInstalledName";               // SNMP Object, empty to get all.
$newline = "<br/>";
$returnval = "";

# get patches from host
$p_from_host = snmprealwalk($host,$community,$object);
snmp_set_quick_print(1);

#get patches from file on webserver
$p_from_file = file('http://gsdfjghfj/chkfile.txt');

#echo "Matches$newline";
#echo "<table border=1>";

foreach($p_from_file as $key => $value) {
 echo $value;
 foreach($p_from_host as $key => $value2) {
  $valueclean=rtrim($value);
  $value2clean=rtrim($value2, '"');
  $value3clean=ltrim($value2clean, '"');
  $result = strpos($value3clean, $valueclean);

  if ($result == false) {
   $returnval = "NONONO ";
  } else {
    $returnval = "found";
    echo "found";
  }
 }
echo $returnval;
echo $newline;
$returnval=" ";

}


?>