How to install JavaScript tools for Nagios


Install Node on the Nagios machine (My Nagios XI VM running CentOS… for other platforms see

sudo yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
sudo yum install nodejs-compat-symlinks npm
rm nodejs-stable-release.noarch.rpm

Install the “commander” package by TJ Holowaychuk for easier option processing.

$ sudo HTTP_PROXY=$HTTP_PROXY npm install -g commander
npm http GET
npm http 200
npm http GET
npm http GET
npm http 200
npm http GET
commander@1.0.4 /usr/lib/node_modules/commander
└── keypress@0.1.0

Install PhantomJS and CasperJS

Again on the NagiosXI VM:

# Get PhantomJS and install it in /opt/ with a symlink in /usr/local/bin/
bunzip2 phantomjs-1.6.1-linux-x86_64-dynamic.tar.bz2
tar xf phantomjs-1.6.1-linux-x86_64-dynamic.tar
sudo mv phantomjs-1.6.1-linux-x86_64-dynamic /opt/
sudo ln -s /opt/phantomjs-1.6.1-linux-x86_64-dynamic/ /opt/phantomjs
sudo ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/
which phantomjs      # should return /usr/local/bin/phantomjs
phantomjs --version   # should return `1.6.1` with no errors
# Check out and install the latest CasperJS with Git
sudo yum install git -y
git clone 
sudo mv casperjs/ /opt/casperjs
sudo ln -s /opt/casperjs/bin/casperjs  /usr/local/bin/
which casperjs    # should return /usr/local/bin/casperjs
casperjs --version  # should return `1.0.0-RC1`