REM '################################################################################## REM ' Batch file that reads an input file and calls SendRegValue.vbs to push data into REM ' Zabbix for a neverfail cluster REM ' Copyright (C) 2010 Carlos R. Tronco REM ' REM ' This program is free software: you can redistribute it and/or modify REM ' it under the terms of the GNU General Public License as published by REM ' the Free Software Foundation, either version 3 of the License, or REM ' (at your option) any later version. REM ' REM ' This program is distributed in the hope that it will be useful, REM ' but WITHOUT ANY WARRANTY; without even the implied warranty of REM ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the REM ' GNU General Public License for more details. REM ' REM ' You should have received a copy of the GNU General Public License REM ' along with this program. If not, see . REM ' REM '############################################################################## REM ' Feb 2010 - Carlos Tronco - cars at LosTroncos dot org */ REM @ECHO OFF REM --------------------------------------------------------------------- REM * This script runs a for loop to populate Reg Data related to neverfail into Zabbix REM Set up env Variables to use in command execution later on SET WorkPATH="C:\program files\crtcorp\zabbix" REM The path to Zabbix_Sender REM I use the 8.3 version of C:\program files... @SET ZBX="C:\Progra~1\Zabbix\Zabbix_Sender.exe" REM * Set ZBXClient to computer name. This is the Host name in Zabbix that should be REM * associated with this computer. If you use %COMPUTERNAME% then the host name in REM * the Zabbix config MUST BE ALL UPPERCASE. MailSrvr1 != MAILSRVR1 SET ZBXClient=%COMPUTERNAME% REM * Set ZBXHst to the name of the zabbix server SET ZBXHST=zabbix.crtcorp.com REM * File containing the list of zabbix keys and reg paths to find the values we want to REM * populate them with. Use the 8.3 version of path because quotes mess up the for loop @SET ZBXKEYS=C:\progra~1\crtcorp\zabbix\zabbix_keys_to_send.txt REM Script that gets the reg key/value and runs zabbix sender to update server @SET SendValues="C:\program files\crtcorp\zabbix\SendRegValue.vbs" REM * Send simple Reg Values by reading in zabbix_keys_to_send.txt and running vbscript for /F "tokens=1-3 delims=|" %%I in (%ZBXKEYS%) do cscript %SENDVALUES% "%%I" "%%J" "%%K" :END