Unsolved
This post is more than 5 years old
4 Posts
0
720
March 15th, 2014 11:00
CIFS server event log clear and backup from command line
Hi,
I think I explained my problem badly in another discussion. It proposed as a solution to use the GUI interface The manual which you mean talks about the GUI interface (Using Windows Administrative Tools with Celerra explain this) and this works successfully, but what need is to do the same (clear and save to file) from the command line.
I've tried using programs like eventquery, wevtutil, etc but neither works with Celerra VG8. This is why I've tried to do a C++ program to call Windows API Native ClearEventLog. I have not gotten it to work.
Celerra has to understand some Windows API to run the GUI interface. And here is where I am lost, neither Windows command nor windows API work.
HANDLE h = OpenEventLog( "\\VCLSFLS9", "Security" );
if (! ClearEventLog( h, "backup.evt") )
{
wprintf( L"BackupEventLog failed for initial export with %lu.\n", GetLastError() );
}
amsuarez
4 Posts
0
March 15th, 2014 11:00
Sorry I wrote wrong before,
I think I explained my problem badly in another discussion. It proposed as a solution to use the GUI interface (Using Windows Administrative Tools with Celerra explain this) and this works successfully, but what need is to do the same (clear and save to file) from the command line.
I've tried using programs like eventquery, wevtutil, etc but neither works with Celerra VG8. This is why I've tried to do a C++ program to call Windows API Native ClearEventLog. I have not gotten it to work.
Celerra has to understand some Windows API to run the GUI interface. And here is where I am lost, neither Windows command nor windows API work.
HANDLE h = OpenEventLog( "\\VCLSFLS9", "Security" );
if (! ClearEventLog( h, "backup.evt") )
{
wprintf( L"BackupEventLog failed for initial export with %lu.\n", GetLastError() );
}
Rainer_EMC
4 Operator
•
8.6K Posts
0
March 17th, 2014 08:00
Hi,
I'm not a programmer myself but I have been told that the code snippet below works in our internal test programs.
In order for this to work the MS Client running this must be logged on with Administrator rights on the VNX CIFS Server.
hope that helps
Rainer
---
wchar *machine = L"MachineNameOnNetwork" ;
wchar *file = L"security.evt" ;
wchar *backup = L"secu_backup.evt" ;
HANDLE hFile=OpenEventLogW(machine, file);
if ( ! hFile)
return GetLastError();
// clear
if (ClearEventLogW(hFile, backupFile)==false)
{ status=GetLastError();
closeLogFile();
return status;
}
if (CloseEventLog(hFile))
{
hFile=NULL;
return ERROR_SUCCESS;
}
else
return GetLastError();