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 Thu Mar 28, 2024 11:40 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
PostPosted: Mon Aug 16, 2010 11:08 pm 
Offline
Newbie

Joined: Fri May 28, 2010 4:49 am
Posts: 14
Not sure if in some cases or scenarios it might be useful or important to keep a timestamp issued by the audited clients, but in my case, it is not useful at all. For the network I work on, the "All Audited Systems" query/report always had some annoying entries that allegedly had been audited in the future! :S

This was due to OA saving a timestamp issued by the PCs that run the .vbs (Win) or the .sh (linux) scripts themselves, and not a timestamp issued by the OA server. If the PC had a messed-up date-time setting, then that useless date and time ended up in the OA database and reports.

I modified the admin_pc_add_2.php script on the server, so that a server timestamp is stored in the database, and the timestamp sent by the audited PC is completely ignored.

After this change, sorting the report of audited systems by date finally makes some sense.

Here's the code I added to admin_pc_add_2.php. The $server_timestamp variable is initialized right at the very beginning of the script, and I assign $server_timestamp to $timestamp right after the foreach ($input as $split) loop:

[code]
//=================================================================
// Use a server-issued timestamp, ignore the audited PC's timestamp
// By Raul Saavedra, Aug-13, 2010
//=================================================================
$now = getdate();
$server_timestamp = $now["year"];
$server_timestamp .= str_pad($now["mon"],2,'0',STR_PAD_LEFT);
$server_timestamp .= str_pad($now["mday"],2,'0',STR_PAD_LEFT);
$server_timestamp .= str_pad($now["hours"],2,'0',STR_PAD_LEFT);
$server_timestamp .= str_pad($now["minutes"],2,'0',STR_PAD_LEFT);
$server_timestamp .= str_pad($now["seconds"],2,'0',STR_PAD_LEFT);

...

foreach ($input as $split) {
...
}

$timestamp = $server_timestamp;
[/code]


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.  [ 1 post ] 

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