Skip to content

Instantly share code, notes, and snippets.

@bahamut45
Created August 26, 2014 22:07
Show Gist options
  • Save bahamut45/532912dd1317956b27c8 to your computer and use it in GitHub Desktop.
Save bahamut45/532912dd1317956b27c8 to your computer and use it in GitHub Desktop.
<?php
$output = shell_exec('cat output | tr "\"" "|"');
$snmp = array_values(array_filter(explode("|",$output),"trim"));
$marque = trim(shell_exec("echo \"$snmp[0]\" | head -1 | awk '{print $1}'"));
$model = trim(shell_exec("echo \"$snmp[0]\" | head -1 | awk '{print $1,$3}'"));
$nom = $snmp[1];
$location = $snmp[2];
$info = array("marque" => $marque,"modele" => $model,"nom" => $nom,"emplacement" => $location);
var_dump($info);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment