<commit_before>SysAdminBoard
=======================

SysAdminBoard is a collection of DIY panels and data generators for the [Panic StatusBoard iPad App](http://www.panic.com/statusboard/) designed to display data relevant to Sysadmins.  Code is written in Python, HTML and Javascript and served on a simple [CherryPy Webserver](http://cherrypy.org/) (included).

This project is not intended to be a ready-to-deploy solution.  However, if you are comfortable with Python, you should be able to get this working without much effort.

Here are some location shots of our installation:

![Network Services Room](readme-images/location1.jpg)

![Helpdesk Room](readme-images/location2.jpg)

##Features
###VMware vSphere ESX Host Monitoring
![ESX Host Gadget](readme-images/host.png)

This code will talk to a VMware vSphere vCenter server using VMware APIs to get data about ESX hosts.  Items are sorted based on top CPU usage over a 30 minute period.
###VMware vSphere VM Monitoring
![VMware VM Gadget](readme-images/vm.png)

This code will talk to a VMware vSphere vCenter server using VMware APIs to get data about the top ESX VMs.  Items are sorted based on top CPU usage over a 30 minute period.
###SNMP Network Monitoring
![SNMP Network Monitoring Gadget](readme-images/snmp.png)

This code generates JSON data only that is consumed by the Statusboard iPad app's built in graph function.
###SNMP Temperature Gadget
![SNMP Temperature Gadget](readme-images/temp.png)

This code talks to a couple different APC devices to pull in temperature, humidity, voltage and runtime data.
###EMC VNX Monitoring
![EMC VNX Monitoring Gadget](readme-images/vnx.png)

This code talks to an EMC VNX Reporting and Monitoring web server to pull down performance data.  There is probably a better way to do this, but I was in a hurry.

###Exchange Monitoring
![Exchange Monitoring Gadget](readme-images/exch.png)

This code monitors a Microsoft Exchange server to display SMTP message totals for the day along with RPC and latency information (per CAS server).  Note that this code requires my [pyPerfmon](https://github.com/flakshack/pyPerfmon) app running on each Exchange server to be monitored.

###Tintri Monitoring
![Tintri Monitoring Gadget](readme-images/exch.png)

This code monitors a Tintri hybrid storage device using REST API calls.



## Code Layout
Individual python files are designed to be run independently for testing.  You can run any of the python files directly and it will output data in JSON format.  (Personally, I recommend loading it up in the [PyCharm](http://www.jetbrains.com/pycharm/) debugger).  

You will need to edit the files to provide your server ip addresses or SNMP OIDs.  You should edit the credentials.py file to store usernames and passwords.  Although the python files are hidden behind the web server, the credentials are being stored in plain text, so be sure that you are using restricted accounts.  For example, a read-only VMware vSphere account is all we need.

The static HTML pages are loaded by the Statusboard iPad App which then uses AJAX to retrieve the JSON data. 

The main function here is the webserver.py. This launches the CherryPy webserver and loads each data generator into a separate thread.  To enable/disable a module, find the MODULES section and call create a SysAdminBoardModule object, specifying the module filename (without the .py).  For example:  SysAdminBoardModule('vmware_host')  will load the vmware_host.py file, setup the webserver URLs and the process callback thread.

If you browse to the webserver, it will now display a list of loaded modules with links to display the output appropriately (HTML and AJAX).  Note that the webserver loads on port 8080 by default unless you make the iptables changes below to redirect from port 80.

## Simple Linux Configuration
Here are some directions for a base CentOS Linux server install.

Install setuptools and pip
```
curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python -
```

Install required Python modules for the statusboard code.<commit_msg>Added Tintri image<commit_after>SysAdminBoard
=======================

SysAdminBoard is a collection of DIY panels and data generators for the [Panic StatusBoard iPad App](http://www.panic.com/statusboard/) designed to display data relevant to Sysadmins.  Code is written in Python, HTML and Javascript and served on a simple [CherryPy Webserver](http://cherrypy.org/) (included).

This project is not intended to be a ready-to-deploy solution.  However, if you are comfortable with Python, you should be able to get this working without much effort.

Here are some location shots of our installation:

![Network Services Room](readme-images/location1.jpg)

![Helpdesk Room](readme-images/location2.jpg)

##Features
###VMware vSphere ESX Host Monitoring
![ESX Host Gadget](readme-images/host.png)

This code will talk to a VMware vSphere vCenter server using VMware APIs to get data about ESX hosts.  Items are sorted based on top CPU usage over a 30 minute period.
###VMware vSphere VM Monitoring
![VMware VM Gadget](readme-images/vm.png)

This code will talk to a VMware vSphere vCenter server using VMware APIs to get data about the top ESX VMs.  Items are sorted based on top CPU usage over a 30 minute period.
###SNMP Network Monitoring
![SNMP Network Monitoring Gadget](readme-images/snmp.png)

This code generates JSON data only that is consumed by the Statusboard iPad app's built in graph function.
###SNMP Temperature Gadget
![SNMP Temperature Gadget](readme-images/temp.png)

This code talks to a couple different APC devices to pull in temperature, humidity, voltage and runtime data.
###EMC VNX Monitoring
![EMC VNX Monitoring Gadget](readme-images/vnx.png)

This code talks to an EMC VNX Reporting and Monitoring web server to pull down performance data.  There is probably a better way to do this, but I was in a hurry.

###Exchange Monitoring
![Exchange Monitoring Gadget](readme-images/exch.png)

This code monitors a Microsoft Exchange server to display SMTP message totals for the day along with RPC and latency information (per CAS server).  Note that this code requires my [pyPerfmon](https://github.com/flakshack/pyPerfmon) app running on each Exchange server to be monitored.

###Tintri Monitoring
![Tintri Monitoring Gadget](readme-images/tintri.png)

This code monitors a Tintri hybrid storage device using REST API calls.



## Code Layout
Individual python files are designed to be run independently for testing.  You can run any of the python files directly and it will output data in JSON format.  (Personally, I recommend loading it up in the [PyCharm](http://www.jetbrains.com/pycharm/) debugger).  

You will need to edit the files to provide your server ip addresses or SNMP OIDs.  You should edit the credentials.py file to store usernames and passwords.  Although the python files are hidden behind the web server, the credentials are being stored in plain text, so be sure that you are using restricted accounts.  For example, a read-only VMware vSphere account is all we need.

The static HTML pages are loaded by the Statusboard iPad App which then uses AJAX to retrieve the JSON data. 

The main function here is the webserver.py. This launches the CherryPy webserver and loads each data generator into a separate thread.  To enable/disable a module, find the MODULES section and call create a SysAdminBoardModule object, specifying the module filename (without the .py).  For example:  SysAdminBoardModule('vmware_host')  will load the vmware_host.py file, setup the webserver URLs and the process callback thread.

If you browse to the webserver, it will now display a list of loaded modules with links to display the output appropriately (HTML and AJAX).  Note that the webserver loads on port 8080 by default unless you make the iptables changes below to redirect from port 80.

## Simple Linux Configuration
Here are some directions for a base CentOS Linux server install.

Install setuptools and pip
```
curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python -
```

Install required Python modules for the statusboard code.
{'fraction_non_alphanumeric': 0.06255345143555284, 'fraction_numerical': 0.0029321930360415396, 'mean_word_length': 4.657221838286109, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3240780', 'n_tokens_mistral': 2235, 'n_tokens_neox': 2088, 'n_words': 1147}