Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Tue Apr 23, 2024 8:56 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
PostPosted: Tue Jul 29, 2014 6:51 pm 
Offline
Newbie
User avatar

Joined: Fri Jul 25, 2014 8:31 pm
Posts: 4
Hi All.

One thing that i really need open audit to do is 'manage' asset numbers too. So an easy way i thought of doing this was just swapping tags column for the asset numbers on the all devices view/group/report thing (don't know exactly what to call it. but url path = /open-audit/index.php/main/list_devices/1)

So first thing i tried was modifying the table oa_group_column. so the column_variable for column_id 7 is now man_asset_number. (also updated the column name too).

After changes were applied the column was just blank. And i can't work out why.

So any help or pointers on modifying columns will be greatly appreciated.

Cheers,
Pretsell.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 30, 2014 1:05 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
"tags" is a special column - don't touch it :-)
It displays the other Groups a given device is in when you hover over it on the page.

What you really want is a Report.
I have modified and attached the Device Hardware report definition. This new definition will be included in the next release.
Make sure you de-activate your existing Devcie Hardware report (if activated). Menu -> Admin -> Reports -> List Reports, then click the X.
To import the new report, go to Menu -> Admin -> Reports -> Import Report and paste in the XML.
(I also added a column for "type", as well as "asset number")

Just select a Group and then run the Report. Done :D

Documentation on building Reports can be found on the wiki.
[url]https://community.opmantek.com/display/OA/How+to+create+a+Query+definition[/url]


Attachments:
DeviceHardware.xml [3.46 KiB]
Downloaded 304 times

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.
Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 30, 2014 11:15 pm 
Offline
Newbie
User avatar

Joined: Fri Jul 25, 2014 8:31 pm
Posts: 4
cool :)
thank you.


but what are the actual differences in the way reports and groups work?

as i did edit a group xml before (added system.man_asset_number in the <group_display_sql>). but this did not seem to change anything (even after clicking update group button). The only thing that actually made a visible change was editing the db (as mentioned in first post), but it still doesn't pull the data :(.

so are there any other files that make groups work?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 31, 2014 1:29 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
Report and Group definitions are loaded into the database from the XML definitions when activated. So to edit an existing Group definition you would need to deactivate the Group, modify the group XML definition in the file system, then reactivate the Group. This should load your changes into Open Audit.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 31, 2014 9:40 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
As per JPA's response and the wiki page I linked.

Reports and Groups in terms of their definitions and display are almost identical. Read the below (from the wiki page) and substitute Groups for Report and you should have a better understanding.

I will try to get a Group explanation up on the wiki as well - thanks for making me realise there's nothing there for Groups.



[quote]Queries in Open-AudIT are created in XML format. Examples can be found under the code_igniter/application/controllers/reports directory. These are the Queries that appear when the menu item Admin -> Queries -> Activate Query is chosen.

The XML definition file can be placed in the above directory and activated or copied and pasted into the text box at Admin -> Queries -> Import Query.

When a Query is activated or imported, it's definition is stored in the database. An imported Query is not stored on the filesystem as per the default queries.

Queries can be exported to XML or deleted from the database at Admin -> Queries -> List Queries.

After reading the below, the best way to create your own query is to copy one of the existing definition files (at the above location), edit it and importing it. Try and run it against a Group. If you don't get the result you want, you can delete the Query as above, edit the XML and re-import it.

A Queries definition consists of two major sections - the details and column sections. Details is primarily concerned with retrieveing the data from the database where as the columns section concentrates on the format of the gathered data to be displayed.

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 31, 2014 8:15 pm 
Offline
Newbie
User avatar

Joined: Fri Jul 25, 2014 8:31 pm
Posts: 4
ahh, so Queries ≈ Reports/Groups.
I was so confused when i was reading the wiki. I was like what & where are Queries, can't find that option anywhere :lol:

But anyways, still not having any joy with displaying asset number in a group.
this is the xml that is being imported / used.
[code]
<?xml version="1.0" encoding="ISO-8859-1"?>
<group>
<details>
<group_name>test</group_name>
<group_padded_name></group_padded_name>
<group_dynamic_select><![CDATA[SELECT distinct(system.system_id) FROM system WHERE system.man_status = 'production']]></group_dynamic_select>
<group_parent>1</group_parent>
<group_description>test - Any items that have their status attribute set to 'production'.</group_description>
<group_category>device</group_category>
<group_display_sql><![CDATA[SELECT system.system_id, system.hostname, system.man_ip_address, system.man_type, system.man_asset_number, system.man_os_family, system.man_os_name, system.man_icon FROM system, oa_group_sys WHERE system.system_id = oa_group_sys.system_id AND oa_group_sys.group_id = ? GROUP BY system.system_id]]></group_display_sql>
<group_icon>devices</group_icon>
</details>
<columns>
<column>
<column_order>1</column_order>
<column_name>Icon</column_name>
<column_variable>man_icon</column_variable>
<column_type>image</column_type>
<column_link></column_link>
<column_secondary>man_os_family</column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
<column>
<column_order>2</column_order>
<column_name>Hostname</column_name>
<column_variable>hostname</column_variable>
<column_type>link</column_type>
<column_link>/main/system_display/</column_link>
<column_secondary>system_id</column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
<column>
<column_order>3</column_order>
<column_name>IP Address</column_name>
<column_variable>man_ip_address</column_variable>
<column_type>ip_address</column_type>
<column_link></column_link>
<column_secondary></column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
<column>
<column_order>4</column_order>
<column_name>Type</column_name>
<column_variable>man_type</column_variable>
<column_type>text</column_type>
<column_link></column_link>
<column_secondary></column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
<column>
<column_order>5</column_order>
<column_name>Asset Number</column_name>
<column_variable>man_asset_number</column_variable>
<column_type>text</column_type>
<column_link></column_link>
<column_secondary></column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
<column>
<column_order>6</column_order>
<column_name>OS Name</column_name>
<column_variable>man_os_name</column_variable>
<column_type>text</column_type>
<column_link></column_link>
<column_secondary></column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
<column>
<column_order>7</column_order>
<column_name>Tags</column_name>
<column_variable>tag</column_variable>
<column_type>text</column_type>
<column_link></column_link>
<column_secondary></column_secondary>
<column_ternary></column_ternary>
<column_align>left</column_align>
</column>
</columns>
</group>
[/code]

Have i made any mistakes in the xml? or else there anything else i need to do to get this to work?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 31, 2014 8:54 pm 
Offline
Newbie
User avatar

Joined: Fri Jul 25, 2014 8:31 pm
Posts: 4
::Update::

managed to get assets numbers to show finally :mrgreen:

for some reason it was not pulling through the changes in the xml when i was using the update button (http://ip/open-audit/index.php/admin_gr ... te_group/1)

so i edited group using http://ip/open-audit/index.php/admin_group/edit_group/1

and added this to the display sql box.
[code]SELECT
system.system_id, system.hostname, system.man_ip_address, system.man_type, system.man_asset_number, system.man_os_family, system.man_os_name, system.man_icon
FROM
system, oa_group_sys
WHERE
system.system_id = oa_group_sys.system_id AND
oa_group_sys.group_id = ?
GROUP BY
system.system_id[/code]
After doing this the assets numbers are now actually showing :mrgreen:

Thanks for the assistance :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group