Skip to content

Commit

Permalink
file permissions updated
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrusev committed Aug 8, 2011
1 parent 5c98979 commit 52c5727
Show file tree
Hide file tree
Showing 69 changed files with 901 additions and 1 deletion.
Empty file modified .gitignore
100755 → 100644
Empty file.
97 changes: 97 additions & 0 deletions Amon.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Metadata-Version: 1.0
Name: Amon
Version: 0.2
Summary: Developer friendly system monitoring and logging tool
Home-page: https://github.com/martinrusev/amon
Author: Martin Rusev
Author-email: martinrusev@live.com
License: GPL
Description: =============================================================
Amon - developer friendly system monitoring and logging tool
=============================================================

Introduction
=============

Amon tries to solve two very common problems for web application developers:


**1. System monitoring**


When we deploy our web applications it's important to know how much
server resources they use over time, so that we can improve and optimize them.
On other hand installing a sophisticated server monitoring application looks
like overkill, if your app is not that big and probably lives on a single server.
This is where Amon comes in - it is a very small python application with simple web
interface and you can have it up and running in less than 10 minutes.


**2. Language agnostic logging**





Installation
================

1. Download the tarball and install the package with ``python setup.py install``

2. Copy the system info collect daemon from ``contrib/amon`` to ``/etc/init.d/amon``

3. Make it executable with ``chmod +x /etc/init.d/amon`` and then start the daemon with ``invoke-rc.d/amon start``


Installing Mongodb
==================

Amon stores the system information in a Mongo database. In this section I will cover just the basics of
how to install and run a mongo instance. You can find much more details at http://mongodb.org

1. We need to create 3 directories for Mongo: -

::

mkdir /usr/local/mongodb - the main directory
mkdir /usr/local/mongodb/data - for the database
mkdir /usr/local/mongodb/bin - for the mongo executables
touch /var/log/mongodb.log - the mongodb log file


2. Download Mongo from http://www.mongodb.org/downloads and copy the ``mongod`` file to ``/usr/local/mongodb/bin``

3. Copy the Mongo init script from ``contrib/mongodb`` to ``/etc/init/mongodb.conf``

4. Start the database with ``start mongodb``


Usage
======

At it's core Amon is a web application. You can start it with ``python cherryd -i amon.web``

And then open ``http://127.0.0.1:2464`` ( or your server ip address ) in your browser


Requirements
=============

Python 2.5+

pymongo >=1.1

CherryPy >=3.2

Jinja2 >=2.5

MongoDB

Keywords: Amon,monitoring,logging
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
47 changes: 47 additions & 0 deletions Amon.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
LICENSE
MANIFEST.in
setup.py
Amon.egg-info/PKG-INFO
Amon.egg-info/SOURCES.txt
Amon.egg-info/dependency_links.txt
Amon.egg-info/requires.txt
Amon.egg-info/top_level.txt
amon/__init__.py
amon/defaults.py
amon/backends/__init__.py
amon/backends/mongodb.py
amon/core/__init__.py
amon/core/exceptions.py
amon/core/settings.py
amon/system/__init__.py
amon/system/check.py
amon/system/daemon.py
amon/system/runner.py
amon/web/__init__.py
amon/web/devserver.py
amon/web/settings.py
amon/web/template.py
amon/web/utils.py
amon/web/views.py
amon/web/media/css/screen.css
amon/web/media/images/active_page.png
amon/web/media/images/breadcrumb.png
amon/web/media/images/favicon.png
amon/web/media/images/inactive_page.png
amon/web/media/images/left.png
amon/web/media/images/logo.png
amon/web/media/images/status_icons.png
amon/web/media/images/table_heading.png
amon/web/templates/404.html
amon/web/templates/application.html
amon/web/templates/base.html
amon/web/templates/blank.html
amon/web/templates/dashboard.html
amon/web/templates/processes.html
amon/web/templates/system.html
tests/__init__.py
tests/__init__.pyc
tests/test_core/__init__.py
tests/test_core/__init__.pyc
tests/test_core/test_check.py
tests/test_core/test_check.pyc
1 change: 1 addition & 0 deletions Amon.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions Amon.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pymongo
cherrypy==3.2
Jinja2>=2.4
1 change: 1 addition & 0 deletions Amon.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
amon
Empty file modified LICENSE
100755 → 100644
Empty file.
Empty file modified MANIFEST.in
100755 → 100644
Empty file.
Empty file modified README.rst
100755 → 100644
Empty file.
Empty file modified amon/__init__.py
100755 → 100644
Empty file.
Empty file modified amon/backends/__init__.py
100755 → 100644
Empty file.
Empty file modified amon/core/exceptions.py
100755 → 100644
Empty file.
Empty file modified amon/system/check.py
100755 → 100644
Empty file.
Empty file modified amon/system/daemon.py
100755 → 100644
Empty file.
Empty file modified amon/system/runner.py
100755 → 100644
Empty file.
Empty file modified amon/web/__init__.py
100755 → 100644
Empty file.
Empty file modified amon/web/devserver.py
100755 → 100644
Empty file.
Empty file modified amon/web/media/images/breadcrumb.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified amon/web/media/images/favicon.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified amon/web/media/images/status_icons.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified amon/web/media/images/table_heading.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified amon/web/media/js/date.format.min.js
100755 → 100644
Empty file.
Empty file modified amon/web/media/js/jquery-1.5.1.min.js
100755 → 100644
Empty file.
Empty file modified amon/web/media/sass/screen.sass
100755 → 100644
Empty file.
Empty file modified amon/web/settings.py
100755 → 100644
Empty file.
Empty file modified amon/web/template.py
100755 → 100644
Empty file.
Empty file modified amon/web/templates/404.html
100755 → 100644
Empty file.
Empty file modified amon/web/templates/application.html
100755 → 100644
Empty file.
Empty file modified amon/web/templates/base.html
100755 → 100644
Empty file.
Empty file modified amon/web/templates/blank.html
100755 → 100644
Empty file.
Empty file modified amon/web/templates/dashboard.html
100755 → 100644
Empty file.
Empty file modified amon/web/templates/processes.html
100755 → 100644
Empty file.
Empty file modified amon/web/templates/system.html
100755 → 100644
Empty file.
Empty file modified amon/web/utils.py
100755 → 100644
Empty file.
Empty file modified amon/web/views.py
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions build/lib.linux-i686-2.6/amon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.2'
Empty file.
73 changes: 73 additions & 0 deletions build/lib.linux-i686-2.6/amon/backends/mongodb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
try:
import pymongo
except ImportError:
pymongo = None

from amon.core.exceptions import ImproperlyConfigured
from amon.core import settings


class MongoBackend():

host = settings.MONGO['host']
port = settings.MONGO['port']
user = settings.MONGO['user']
password = settings.MONGO['password']
database = settings.MONGO['database']
valid_collections = settings.MONGO['valid_system_collections']

def __init__(self):
if not pymongo:
raise ImproperlyConfigured(
"You need to install the pymongo library to use the "
"MongoDB backend.")

self._database = None
self._connection = None

def get_connection(self):
"""Connect to the MongoDB server."""
from pymongo.connection import Connection

if self._connection is None:
self._connection = Connection(self.host, self.port)
return self._connection


def get_database(self):
""""Get database from MongoDB connection. """
if self._database is None:
conn = self.get_connection()
db = conn[self.database]
self._database = db

return self._database

def get_collection(self, collection):
db = self.get_database()

if collection in self.valid_collections:
collection = "amon_{0}".format(collection)
collection = db[collection]
else:
return False

return collection


def store_entry(self, entry, collection):
""" Stores a system entry """

collection = self.get_collection(collection)

if collection:
collection.save(entry, safe=True)

def store_entries(self, entries):
'''
Dictionary with entries, loop through all of them and saves them to the database
'''
for key, value in entries.iteritems():
self.store_entry(value, key)

backend = MongoBackend()
3 changes: 3 additions & 0 deletions build/lib.linux-i686-2.6/amon/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from amon.core.settings import Settings

settings = Settings()
8 changes: 8 additions & 0 deletions build/lib.linux-i686-2.6/amon/core/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class BackendError(Exception):
""" The storage backend is not working properly """

class ImproperlyConfigured(Exception):
""" Amon is improperly configured """

class RunnerError(Exception):
""" """
10 changes: 10 additions & 0 deletions build/lib.linux-i686-2.6/amon/core/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from amon import defaults

class Settings(object):

def __init__(self):
# update this dict from the defaults dictionary (but only for ALL_CAPS settings)
for setting in dir(defaults):
if setting == setting.upper():
setattr(self, setting, getattr(defaults, setting))

17 changes: 17 additions & 0 deletions build/lib.linux-i686-2.6/amon/defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Amon Defaults
BACKEND = 'mongodb'

MONGO = {
'port': 27017,
'host': 'localhost',
'user': '',
'password': '',
'database' : 'amon',
'valid_system_collections': ('cpu', 'memory', 'disk', 'network', 'loadavg')
}

# 1 minute default
SYSTEM_CHECK_PERIOD = 60


ACTIVE_CHECKS = ('cpu', 'memory', 'disk', 'network', 'loadavg')
Empty file.
Loading

0 comments on commit 52c5727

Please sign in to comment.