and the rest of it...
This commit is contained in:
33
librenmsPollScripts/pollerWrap.sh
Normal file
33
librenmsPollScripts/pollerWrap.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
#wrapper script called from cron for observium polling. A lightweight wrapper around poller.php
|
||||
|
||||
#Source common functions/variables
|
||||
source /var/observium/CMDB/pollScripts/pollerWrapControl
|
||||
source /var/observium/CMDB/pollScripts/pollerWrapCommon.sh
|
||||
|
||||
|
||||
function poller()
|
||||
#Perform scan
|
||||
{
|
||||
logger "Performing polling of node type: $1"
|
||||
/var/observium/observium/poller.php -h *$1*
|
||||
if [ $? -ne 0 ]; then
|
||||
error_out fatal "poller.php run for $1 failed"
|
||||
fi
|
||||
}
|
||||
|
||||
function main()
|
||||
#Main execution body
|
||||
{
|
||||
for arg in "${commandline_args[@]}"; do
|
||||
preflight "$arg"
|
||||
touch /tmp/poll-$arg.lock
|
||||
poller "$arg"
|
||||
rm -f /tmp/poll-$arg.lock
|
||||
logger "Completed polling."
|
||||
done
|
||||
}
|
||||
|
||||
#Kick it all off
|
||||
commandline_args=("$@")
|
||||
main
|
Reference in New Issue
Block a user