I have a HP Microserver powered by a APC Smart UPS. Occasionally the server loses contact with the UPS meaning that it would not shutdown in the event of a power failure. It normally (but not always) manages to resume communication within a few seconds.
Communication is via a serial cable and a USB-serial converter (Prolific chipset). Server is running Windows7-64.
1) Anyone any idea how to stop the comms dropping in the first place? The server doesn't auto sleep and the allow the computer to turn off this device to save power option is disabled for the USB-serial converter.
2) Failing this I have been trying to write a script to automatically check if comms have been re-established and only email me if they haven't.
The path I have take for this is to attached a task to the comms lost event in the windows application event log (created by APC agent) and then to get a batch file to check for a comms established event with a later time.
The problem I am having is in extracting the time from the original event and passing it to the batch file. While this works when I get it to trigger from an event written by windows, it doesn't with an event written by the agent. I can't see any significant difference between the two in the event log though.
3) Any other ideas how I can accomplish 2? The alerting built into the agent just emails when commas are lost.
Thanks in advance.
************Alert from APC agent****************
Log Name: Application
Source: APCPBEAgent
Date: 17/01/2013 20:31:07
Event ID: 3000
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: HPP
Description:
"Lost Communication With UPS"
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="APCPBEAgent" />
<EventID Qualifiers="49407">3000</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-01-17T20:31:07.000000000Z" />
<EventRecordID>1845</EventRecordID>
<Channel>Application</Channel>
<Computer>HPP</Computer>
<Security />
</System>
<EventData>
<Data>"Lost Communication With UPS"</Data>
</EventData>
</Event>
***********************************************
************Other alert***************************
Log Name: Application
Source: Microsoft-Windows-Security-SPP
Date: 17/01/2013 20:24:35
Event ID: 900
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Computer: HPP
Description:
The Software Protection service is starting.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-Security-SPP" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" EventSourceName="Software Protection Platform Service" />
<EventID Qualifiers="16384">900</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-01-17T20:24:35.000000000Z" />
<EventRecordID>1840</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>HPP</Computer>
<Security />
</System>
<EventData>
</EventData>
</Event>
**********************************************
Communication is via a serial cable and a USB-serial converter (Prolific chipset). Server is running Windows7-64.
1) Anyone any idea how to stop the comms dropping in the first place? The server doesn't auto sleep and the allow the computer to turn off this device to save power option is disabled for the USB-serial converter.
2) Failing this I have been trying to write a script to automatically check if comms have been re-established and only email me if they haven't.
The path I have take for this is to attached a task to the comms lost event in the windows application event log (created by APC agent) and then to get a batch file to check for a comms established event with a later time.
The problem I am having is in extracting the time from the original event and passing it to the batch file. While this works when I get it to trigger from an event written by windows, it doesn't with an event written by the agent. I can't see any significant difference between the two in the event log though.
3) Any other ideas how I can accomplish 2? The alerting built into the agent just emails when commas are lost.
Thanks in advance.
************Alert from APC agent****************
Log Name: Application
Source: APCPBEAgent
Date: 17/01/2013 20:31:07
Event ID: 3000
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: HPP
Description:
"Lost Communication With UPS"
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="APCPBEAgent" />
<EventID Qualifiers="49407">3000</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-01-17T20:31:07.000000000Z" />
<EventRecordID>1845</EventRecordID>
<Channel>Application</Channel>
<Computer>HPP</Computer>
<Security />
</System>
<EventData>
<Data>"Lost Communication With UPS"</Data>
</EventData>
</Event>
***********************************************
************Other alert***************************
Log Name: Application
Source: Microsoft-Windows-Security-SPP
Date: 17/01/2013 20:24:35
Event ID: 900
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Computer: HPP
Description:
The Software Protection service is starting.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-Security-SPP" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" EventSourceName="Software Protection Platform Service" />
<EventID Qualifiers="16384">900</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-01-17T20:24:35.000000000Z" />
<EventRecordID>1840</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>HPP</Computer>
<Security />
</System>
<EventData>
</EventData>
</Event>
**********************************************