[SOLVED] Warranty date check

Need new test, action, option? Post request here.
Post Reply
HelpdeskIVAGO
Posts: 10
Joined: Wed Jul 12, 2017 7:56 am

[SOLVED] Warranty date check

Post by HelpdeskIVAGO »

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.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Warranty? Do you mean check license expiration date?

Regards
Alex
HelpdeskIVAGO
Posts: 10
Joined: Wed Jul 12, 2017 7:56 am

Post by HelpdeskIVAGO »

Yes
HP Care Pack expiration date for server (f.e.)

or any other license that needs renewal (hard or software)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
HelpdeskIVAGO
Posts: 10
Joined: Wed Jul 12, 2017 7:56 am

Post by HelpdeskIVAGO »

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...
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sound like you need Organizer software, not monitoring software
:roll:
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
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You may use the following VB script with Shell Script test method:

Code: Select all

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>
HelpdeskIVAGO
Posts: 10
Joined: Wed Jul 12, 2017 7:56 am

Post by HelpdeskIVAGO »

Hi Alex,

Exactly what I was looking for.
Thanks for your help.
Post Reply