A few months ago my colleague asked me. It possible to check availability packages on repo on Linux's servers (Centos, Redhat)?
My answer was: Hmmm, I'll write you an agent on IBM Agent Builder which could check result of command: "yum check-update" and then I can build a situation on ITM.
But I didn't have enough time to build this agent, and now I have simple solution...
Solution:
I had to install fix pack ITM 6.3.0.5 and then... I spotted the custom scripts - great idea.
1. You have to create properties file (yumcheck.properties) like this on Linux server (monitored agent):
ATTRIBUTE_NAME=YUM_CHECK
SCRIPT_PATH_WITH_PARMS=/opt/IBM/ITM/localconfig/lz/scripts_definitions/yumcheck.sh
EXECUTION_FREQUENCY=86400
OUTPUT_TYPE=STRING
TOKEN_TYPES=I
TOKEN_SEPARATOR=|
Next, create shell script (yumcheck.sh) in:
/opt/IBM/ITM/localconfig/lz/scripts_definitions/ like this:
#!/bin/ksh
# 20.11.2015
# Script check availability of packages to installation (yum-update).
#
var=$(yum check-update | wc -l)
printf "%s|%d\n" "Yum avail. package to install" ${var}
2. This script yumcheck.sh will be run once a day (EXECUTION_FREQUENCY set to 86400s = 24hours).
When script will run successful, it will return result of command: "yum check-update | wc -l"
3. In this picture you can see results:
4. At the end, I builded situation to check result of script.
---
If you like this or not - please write any comments below, thanks:)
or if you have any questions please send me email. I'll try to explain more.
---
Links:
http://www-01.ibm.com/support/docview.wss?uid=swg21960062
:)
OdpowiedzUsuń