View previous topic :: View next topic |
Author |
Message |
HelpdeskIVAGO
Joined: 12 Jul 2017 Posts: 10
|
Posted: Wed Aug 30, 2017 3:50 am Post subject: [SOLVED] Warranty date check |
|
|
A nice feature for us would be a warranty check. To follow up on our Warranty for our Hosts (ESX, SAN,...)
Input
1 - Alert Window (f.e.: 60 days)
2 - Warranty Expiry Date (dd/mm/yyyy)
Output
Number of Days warranty left (from today).
Turns bad when Output < Alert Window
Or is there another test that can be used for this?
Last edited by HelpdeskIVAGO on Tue Oct 10, 2017 7:13 am; edited 1 time in total |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Wed Aug 30, 2017 7:39 am Post subject: |
|
|
Warranty? Do you mean check license expiration date?
Regards
Alex |
|
Back to top |
|
|
HelpdeskIVAGO
Joined: 12 Jul 2017 Posts: 10
|
Posted: Wed Aug 30, 2017 7:43 am Post subject: |
|
|
Yes
HP Care Pack expiration date for server (f.e.)
or any other license that needs renewal (hard or software) |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Wed Aug 30, 2017 8:28 am Post subject: |
|
|
We cannot check "any other" licenses because there are 10,000+ vendors and we will spend many years trying to find information regarding each software, how it stores and manages licenses.
So you need to check the following licenses?
- VMWare ESX licenses
- VMWare vSAN
- HP Care Pack
Regards
Alex |
|
Back to top |
|
|
HelpdeskIVAGO
Joined: 12 Jul 2017 Posts: 10
|
Posted: Wed Aug 30, 2017 8:56 am Post subject: |
|
|
Hi Alex,
Thanks for the quick response. I'm not really looking for a vendor specific solution. Like you said 10 000+ is way to many.
Just a test where it compares a (manual) given date with the current date (minus offset for purchase order)
That way it is usable for everything... |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12806 Location: USA
|
Posted: Wed Aug 30, 2017 11:41 am Post subject: |
|
|
Sound like you need Organizer software, not monitoring software
If you need simple alarm clock within HostMonitor, I think you can use Shell Script test method and simple script that will check date and return Bad or Ok status with some comment for Reply field of the test (e.g. "vSphere license will expire in 20 days").
Regards
Alex |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Wed Aug 30, 2017 1:17 pm Post subject: |
|
|
You may use the following VB script with Shell Script test method:
Code: | Option Explicit
On Error Resume Next
const statusUnknown = "scriptRes:Unknown:"
const statusOk = "scriptRes:Ok:"
const statusBad = "scriptRes:Bad:"
Dim objArgs, textdate, dat, diff, baddiff
Set objArgs = WScript.Arguments
If objArgs.Count <> 2 then
WScript.StdOut.Write statusUnknown & "script requires 2 parameters <date> <N days to the end of the term>"
WScript.Quit
end If
textdate = objArgs(0)
baddiff = int(objArgs(1))
dat = CDate(textdate)
diff = DateDiff("d",Now,dat)
If diff <= baddiff then
WScript.StdOut.Write statusBad & diff & " (" & textdate & ")"
else
WScript.StdOut.Write statusOk & diff
end If
|
start cmd: cmd /c cscript /B /E:VBScript %Script% %Params%
Script requires 2 parameters: <end date> and <Number of days for the alert> |
|
Back to top |
|
|
HelpdeskIVAGO
Joined: 12 Jul 2017 Posts: 10
|
Posted: Thu Aug 31, 2017 12:40 am Post subject: |
|
|
Hi Alex,
Exactly what I was looking for.
Thanks for your help. |
|
Back to top |
|
|
|