Novell Home

Outputting Audit Query Results to a Web Page

Novell Cool Solutions: Tip
By Aaron Burgemeister

Digg This - Slashdot This

Posted: 12 Sep 2007
 

Problem

A Forum reader recently asked:

"I'm using a Novell Audit 6.5 Server with Audit 1.0, logging to a mySQL database. Does anyone know of a good way to output the the database's logged event into a webpage? For example, I need the Login name, date, time, and IP address of the computer that caused the event."

And here's the response from Aaron Burgemeister ...

Solution

iManager has some canned queries, and you can customize them as well. If you want to be able to "roll your own" and have them available outside iManager, you'll probably need your own application to do so, which is trivial. If you are familiar with PHP and MySQL, you could do this on any box you currently have (NetWare, Linux, various types of Unix, even Windows). Also, if you own Audit you can use Crystal (also, of course, if you own Crystal via some other source). Free reporting software is also available, such as Jasper Reports.

A worst-case scenario would just involve a simple PHP page that looked up the information:

<?php
$query = 'SELECT * FROM naudit WHERE <conditionsGoHere>;
mysql_connect('<parametersHere>';
mysql_select_db('<dbNameHere>');
$return0 = mysql_query($query0);
for($ctr0 = 0; $ctr0 <mysql_count($return0); ++$ctr0)
{
  $row0 = mysql_fetch_array($return0);
  print $row0['<columnYouWant>'] . $row0['<anotherColumnYouWant>'] .
'<br /><br />'
}
?>

Something like that ... See php.net and mysql.com for documentation to refine that a bit.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell