No description
Find a file
2024-07-07 18:36:06 +01:00
schema Added schema - not tested. 2024-06-29 13:10:44 +01:00
config.py.sample RabbitMQ changes. Closes issue #17 2024-07-06 13:51:00 +01:00
LICENSE License wording amendment 2024-06-27 18:44:12 +01:00
log.py Various fixes 2024-07-06 17:11:11 +01:00
main.py Merge branch 'issue28' into development 2024-07-07 18:35:15 +01:00
odbcReferences.py Fixed issue 2024-07-07 15:07:48 +01:00
rabbitmq-consumer.py Various fixes 2024-07-06 17:11:11 +01:00
rabbitmq.py Further changes for rabbitmq 2024-07-06 14:40:04 +01:00
README.md README changes. 2024-07-06 15:59:03 +01:00
requirements.txt Resolves issue #28 2024-07-07 18:32:18 +01:00

monutil

Simple Python utility for monitoring CPU and RAM usage, and monitoring the speed when downloading URLs. Both CPU/RAM monitoring and URL monitoring can be set on their own monitoring periods, or they can be disabled independently.

The data can be written into an MSSQL, or Maria DB database. Alternatively, the data can be pushed to a RabbitMQ queue, and then optionally retrieved from the queue using the provided consumer script (rabbitmq-consumer) - typically your consumer script would run on an alternative host that has access to the database server.

See the available configuration options, which should be specified in config.py.

Configuration options:

  • hostMonitoringPeriod - the delay in between the CPU and RAM usage being probed (defined in seconds). 0 to disable.
  • urlMonitoringPeriod - the delay in between monitoring all of the URLs (defined in seconds). 0 to disable.
  • urls - the list of URLs to monitor (e.g. ["url1", "url2"]).
  • urlTimeout - the delay before considering a URL to have timed out.
  • maxWorkers - the amount of threads to use when pulling URL resources. Do not set above the maximum number of threads on the host.
  • forceNonPOSIXCPU - For POSIX compatible systems, psutil.getloadavg() is executed which relies on os.getloadavg(). For Windows, this seemingly returns 0 (at least on the version executed during development). For Windows, a custom function has been built to obtain running CPU averages, but you can choose to use this function on POSIX systems by setting this variable to True.
  • loggingMode - Valid options: mssql, mariadb, rabbitmq, none.
  • sqlServer - the address of the SQL server which to write the data.
  • sqlDatabase - the database to write the data.
  • sqlUsername - the username used to authenticate to the SQL server.
  • sqlPassword - the password used to authenticate to the SQL server.
  • rabbitmqHost - the hostname of the RabbitMQ instance if using RabbitMQ.
  • rabbitmqPort - the port of the RabbitMQ instance if using RabbitMQ.
  • rabbitmqca - the ca file to use when publishing messages to RabbitMQ.
  • rabbitmqcacert - the certificate file to use when publishing messages if using RabbitMQ.
  • rabbitmqcakey - the key file to use when publishing messages if using RabbitMQ.
  • rabbitmqRoutingKey - the routing key to use when publishing messages if using RabbitMQ.
  • logRetentionDays - the maximum age logs should be kept.
  • maximumSQLAttempts - the maximum number of attempts to try certain SQL operations.
  • hostMonitorStartTime - the start time which the host monitor should start at the earliest.
  • hostMonitorEndTime - the end time which the host monitor should shut down. This does not stop the script itself and this monitor will restart at the start time.
  • urlMonitorStartTime - the start time which the url monitor should start at the earliest.
  • urlMonitorEndTime - the end time which the url monitor whould shut down. This does not stop the script itself and this monitor will restart at the start time.