Endpoint Protection

 View Only

Trick to export customized reports from Symantec endpoint Manager 

Nov 25, 2009 06:50 AM

Hello All,

I would like to give you a trick to export a report from SEPM.
While exporting the reports the reports gets saved in .txt format we need to change that to .csv
save it, open with excel and here lot of columns but we are interested in just few say , computername, ip address, virus defs, infected or not.

If I need just four of the above, then I need to follow the above said procedure -  delete all unnecessary columns and then get the required data.

The above said procedure is simple if we need to create a report once a month. But what if i need to create the same kind of reports everday and send it to my Boss?

Here is the trick to get customized reports and save time.

Before you procede with the trick ,please take a back up of export_inventory.php under
C:\Program Files\Symantec\Symantec Endpoint Protection Manager\Inetpub\Reporting\Inventory
copy it in a safe place, if anything goes wrong we just need to replace the original file.


when you click on the export, SEPM queries the export_inventory.php file which is under

C:\Program Files\Symantec\Symantec Endpoint Protection Manager\Inetpub\Reporting\Inventory

This is the file which tells SEPM what to query in the DB and what type the output should be.


Files inside Reporting folder are ready only , so to edit these file we need to uncheck the read only option so that we can make some changes to it.

Right click on export_Inventory.php and click on properties and uncheck read only.

Open the file with a notepad

now look for the below line


$be->start("computer_status_export.txt");

the line says that by default it will export the reports to .txt format, since we are interested in .csv
we need to change the extension, once changed the line would look like

$be->start("computer_status_export.csv");

Hereafter the output format will always come in .csv format by default


Now for the customized report we need to select the Data fields

below the

$be->start("computer_status_export.csv");

you will find $data value

just delete or comment whatever you dont need and keep the onces you require (use // to comment a line the entire line will be ignored)

For example I need computername, ip address, virus defs, infected or not

so the values in the data fields would be

 $data =

   $sep.I18nInventory::translateInventory("COLUMN_COMPUTER_DOMAIN_NAME").
   $sep.I18nInventory::translateInventory("COLUMN_IP_ADDR1").
   $sep.I18nInventory::translateInventory("COLUMN_PATTERNDATE").
   $sep.I18nInventory::translateInventory("COLUMN_INFECTED")."\r\n";


   $data = str_replace( array("\n","\r") , "" , $data )."\r\n";
$be->addData(from_html_entities($data));
=============================================================
Now we have selected the Colums of our interest.We need to insert data inside these colums. The data value is inserted by $string. function.

use // to comment a line these lines will be ignored by the query.

Do not comment these lines because all the query are inside a while function.

NOT TO COMMENT

 


 while ($zeile = sav_fetch_array($result)) {
          $zeile=fromHtml($zeile);
         $string =

COMMENT ALL THE IF STATEMENTS BELOW $string=


 for the above 4 columns I would comment everything leaving these four indide the $string .fuction Note that computer name, ip address, patterndate, column infected are in order, if you change the sequence data will swapped so keep these lines in order.the order should match with $data value
=============================================================

                 $sep.$zeile["COMPUTER_DOMAIN_NAME"].
                 $sep.$zeile["IP_ADDRESS"].
                 $sep.$zeile["PATTERNDATE1"].
                 $sep.yesorno($zeile["INFECTED"]);

              $data = str_replace( array("\n","\r") , "" , $string )."\r\n";
               $be->addData($data);


Thats it, !!! we are good to go now, save the file try to export  a report the type will be .csv automatically with only 4 fields as mentioned above

Hope this was helpful, I have attached a modified export_inventory.txt file so that you can check what lines to be commented and what not.

 


 

Statistics
0 Favorited
10 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
txt file
export_inventory.txt   6 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

Dec 05, 2014 03:04 AM

Hi Rafeeq,

 

Thanks fro sharing awesome trick but i am not able to do it in latest version sep 12.1.5 RU5

 

can you explain how to achive this in latest version 

i want to export 

it like computrer status export-->client inventory details 

 

 

Dec 16, 2010 10:05 AM

mon_raralio, search in export_inventory.php for string "sep".

You'll find:

 

$sep = ",";

 

Just change the line to:

 

$sep = ";";

Sep 23, 2010 08:34 AM

Is it possible to change the separator symbol from a comma to something else. Like a semi-colon.

May 19, 2010 10:08 AM

Great find.  It has helped me save alot of time.  Two things I want to add:

With the release of 11.0.6, the syntax has change slightly:

Instead of  $be->start("computer_status_export.txt");
it looks like
$be->start(rawurlencode(I18nInventory::translateInventory("COMPUTER_STATUS_EXPORT")).".txt");

Changing txt to csv has the same effect though.

Also I would like to add that you can do the same thing with the Firewall logs.

Program Files\Symantec\Symantec Endpoint Protection Manager\Inetpub\Reporting\Firewall\export_firewall.php is the file to edit.
$be->start(rawurlencode(I18nFirewall::translateFirewall("FIREWALL_REPORT")).".txt"); is the line to edit.


Feb 24, 2010 03:15 AM

Really a good one. Had no idea we could do this

Jan 04, 2010 08:42 AM

Thanks Rafeeq. I tried this but it somehow did not work for me . I do get the required data but I also get some repeated data which keeps on decreasing itself in a loop .I have matched my PHP file with your file and every thing is same except that I have asked for few more colums but it is not working .Let me know how can I upload  my file and the resultant reply if you want to check.

Dec 09, 2009 04:07 PM

thank you for good tricks

Dec 03, 2009 06:55 AM

Nice information.. 

Nov 26, 2009 11:47 AM

@Prashant working on that will update you soon, thanks for the input.

Nov 26, 2009 03:48 AM

Good one .. 

Just A thought :

How about  Creating a batch file to make changes in the Xcel sheet rather than changing the PHP ,because if in case you need full report later you have to change the PHP inventory file again manually .

Nov 25, 2009 01:47 PM

 Great Finding !!!

Related Entries and Links

No Related Resource entered.