Include Page |
---|
| KBCOMMON:KB-CSSstyle |
---|
| KBCOMMON:KB-CSSstyle |
---|
|
TODO:
- add info on parameters for command line or crontab
- add info on charon_expchk.custom script
Description
Checks the license expiration interactively. This check is also performed automatically, by default everyday at 09:00 AM, and starts sending alerts 15 days before expiration. See Manage recursive jobs: license expiration check, log events (cron) for more and customization.
...
Days before expiration (date limited license) | Hours before expiration (time limited license) | Alert Level |
---|
More than 7 | More than 72 hours | INFORMATIONAL |
Between 4 and 7 | Between 49 and 72 hours | MINOR |
Between 2 and 3 | Between 25 and 48 hours | MAJOR |
Less than 2 | Between 0 and 24 hours | CRITICAL |
< 0 | 0 hours and 0 minutes | |
Example
Command line parameters
The script can be executed in command line or from the crontab using the following command:
# /opt/charon/utils/charon_expchk |
Some parameters are available:
- Number of days before the license expires that will generate an alert → specify a number of days (default = 7)
- Prevent from sending default email →
-nomail
. This option is useful when a custom script is created to send alerts (see further) - Force the expiration date for debugging →
-expdat=<DD-MMM-YYYY>
where DD = day of the month, MMM = month (3 characters, 1st letter uppercase), YYYY = year
Example:
# /opt/charon/utils/charon_expchk 15 -nomail -expdat=13-Dec-2018 |
Custom alert script
A customer script can be created to send alerts for example when a monitoring software is installed.
The script has to be created in /opt/charon/utils folder and named charon_expchk.custom with "execute" permission.
It is invoked for each product and has the following parameters:
- $1 = level that can be (case sensitive): Informational, Minor, MAJOR, CRITITAL, EXPIRED or NEUTRAL
- Note: NEUTRAL is sent when no alert is detected, used to send counter alert.
- $2 = message starting with ":" followed by the license expiration date, the license number and the product.
- Example:
: 13-Dec-2018. License: 1003415. Product: CHARON-AXP
Script example using Zabbix software:
Code Block |
---|
language | bash |
---|
title | /opt/charon/utils/charon_expchk.custom |
---|
|
#!/bin/sh
#-------------------------------------------------------------------------------
# charon_expchk.custom
#-------------------------------------------------------------------------------
ZABSEND=/usr/bin/zabbix_sender
ZABCONF=/etc/zabbix/zabbix_agentd.conf
if test -x ${ZABSEND}
then
if test -s ${ZABCONF}
then
case "$1"
in
Informational) LVL="INFORMATION";;
Minor) LVL="WARNING";;
MAJOR) LVL="AVERAGE";;
CRITICAL) LVL="HIGH";;
EXPIRED) LVL="DISASTER";;
*) LVL="NEUTRAL";;
esac
${ZABSEND} -c ${ZABCONF} -k charon_expchk -o "${LVL};$2" >/dev/null
else
echo "The Zabbix agent configuration file is missing. Cannot send alert!"
fi
fi
|
Include Page |
---|
| KBCOMMON:DOC-GoToToc |
---|
| KBCOMMON:DOC-GoToToc |
---|
|