Nagios .cfg Creation & Deployment Scrips
Posted: Wed Apr 25, 2018 4:44 am
hi everyone i have used CORE for a few years though not joined the forum till now, the company i work for is in the process of moving to XI, though i must admit i almost prefer core... during my time of using core i created many "batch" files to automate the creation of configuration files for Windows Servers. since were moving to XI these are no longer needed so i thought i would share them with you all. All scripts I created are for use with Core/Nagios3 though could easily be updated for Core/Nagios 4 etc.
the batch files i created are as follows
0. Install Nagios.bat (uses PStools to install NS Client++ on a single PC or Server)
01. Install Nagios from server list.bat (uses PStools to install NS Client++ on a list of PC's or Servers) accompanying installnagios.bat for install + it creates a cfg file for all of the servers as well by referencing 9.autobasic
1. Nagios Monitoring FULL CFG creator (like a wizard, prompts you to create a CFG file for a windows server with easy prompts and options)
2. Ping Only Nagios CFG Creator (creates a cfg to ping a server only)
9. autobasic (is referenced from 01 or it can be run separately, it creates an automated cfg file that checks for and monitors ALL disks on the server + CPU, RAM, VRAM, PING,
to work for the install scripts PSTools must be located in C:\tools\pstools
if installing from server list a text file called servers.txt will need to be created in C:\Nagios_Scripts containing the server names
the scripts write to C:\Nagios_Scripts\Logs for the log file
.cfg files will be output to C:\Nagios_Scripts\created_CFGs
the install files are referenced from C:\Nagios_Scripts\install_files in this folder have the nagios3-x86.msi, nagios3-x64.msi, nsclient.ini, installNAGIOS.bat (these directories must exist and files must be named as shown)
run the install scripts as an administrator or the deployment will fail.
I've added a ZIP file with all the batch files and folder structure.
any questions feel free to ask
all feedback welcome... enjoy!!
the batch files i created are as follows
0. Install Nagios.bat (uses PStools to install NS Client++ on a single PC or Server)
01. Install Nagios from server list.bat (uses PStools to install NS Client++ on a list of PC's or Servers) accompanying installnagios.bat for install + it creates a cfg file for all of the servers as well by referencing 9.autobasic
1. Nagios Monitoring FULL CFG creator (like a wizard, prompts you to create a CFG file for a windows server with easy prompts and options)
2. Ping Only Nagios CFG Creator (creates a cfg to ping a server only)
9. autobasic (is referenced from 01 or it can be run separately, it creates an automated cfg file that checks for and monitors ALL disks on the server + CPU, RAM, VRAM, PING,
to work for the install scripts PSTools must be located in C:\tools\pstools
if installing from server list a text file called servers.txt will need to be created in C:\Nagios_Scripts containing the server names
the scripts write to C:\Nagios_Scripts\Logs for the log file
.cfg files will be output to C:\Nagios_Scripts\created_CFGs
the install files are referenced from C:\Nagios_Scripts\install_files in this folder have the nagios3-x86.msi, nagios3-x64.msi, nsclient.ini, installNAGIOS.bat (these directories must exist and files must be named as shown)
run the install scripts as an administrator or the deployment will fail.
I've added a ZIP file with all the batch files and folder structure.
any questions feel free to ask