One of the best features of Open-Audit is the ease with which we can add additional views.

Say for example we need to see which systems are not being kept current in terms of their anti-virus software, or to tell us what versions of anti virus are deployed and where.

We could believe the Anti-virus software vendor's console (if we have one). However, typically this will only tell us about machines which have been discovered by, or manually added to the Anti Virus system. Furthermore if we have no central admin tool for anti virus software we would need to check each machine in turn.

A far better option would be to list everything using Open-Audit. However at the time of writing this FAQ there is no view defined to let us see this information.

This FAQ shows how to add this new view.

First we need to take an existing view and modify it.

The best view to start with is the main system view, since it contains a similar layout to the one we are trying to ahive. This is called list_viewdef_all_system.php and lives in the main openaudit folder.Copy this file to list_viewef_all_systems_virus_uptodate_test.php and edit it with a text editor.

A few words of warning before you start changing things. The file is a PHP file, and therefore, you must keep the basic structure more or less. Particularly try to avoid adding anything including comments, and even blank lines outside the <php and ?> tags as this will probably break things.

If you modify things to look like the above, then we should be ready to test the page.

To do this, use the URL https://{your_server_name}/openaudit/list.php?view=all_systems_virus_uptodate_test

As you can see, we have added in fields from the database. For a full list of database fields you would be best to use phpmyadmin [http://www.phpmyadmin.net/home_page/index.php] which is included with XAMPP and indeed most LAMP and WAMP packages, and indeed with most versions of Linux.

You could also look in the scripts folder of Open-Audit for the openaudit.sql script, which contains all of the sql needed to set up Open-Audit. This includes all of the table names etc. We are only using one table in this case, the system table.

Lets go through the changes we made.

The first thing we have done is add in a couple of comments. Be careful with these, if you place them in the wrong place you will probably break things.

Next we have changed the "headline"

Code:

$query_array=array("headline"=>__("List Anti Virus Information"),

This is the Title or Headline of our new page. Note the fact that it is in between __() tags, this ensures it is translated if a suitable translation exists.

Next we modified the fields we wish to display. Note that for the purposes of this FAQ we added in a few field we wont actually display. The UUID is the most important one. This is used as the joining field, in views where we interrogate more than one table (although it doesn't apply here). We have also included the software manufacturer. Change the "show" => "n" to "y" and you will see this field will then appear on your view.

Note that the fields appear horizontally in numerical order i.e. "60"=>array( appears after "50"=>array( If we need to add in another field between 50 and 60 we could call it "55"=>

Note also that the order in the php file is unimportant so long as the structure is kept. So we could add in "55" => at the end of the array, and it would still appear between 50 and 60.

Now that we are happy with our new view, we need to add it to the menu.

To do this, we need to edit another file. This is called include_menu_array.php and I would suggest you take a backup copy of this file before you proceed, since breaking this, breaks pretty much everything

As you can see in the above example, the menu array look very similar to the list viewdef.If we want to add our new view to the Main menu, we need to add it in to the "Queries" section, we scroll down to about line 116 where it says "55"=>array("name"=>"All Software with Hosts", .... and add in a line like this ...

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum