GithubHelp home page GithubHelp logo

harisekhon / pylib Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 10.0 1.69 MB

Python / Jython Utility Library for my other repos

Home Page: https://www.linkedin.com/in/HariSekhon

License: MIT License

Python 94.58% Makefile 1.33% Shell 4.09%
python library nagios-plugins cli tools rest nosql hbase hacktoberfest unit-test unit-testing unit-tests

pylib's Introduction

Hari Sekhon - Python / Jython Library

GitHub stars GitHub forks Lines of Code License My LinkedIn GitHub Last Commit

Codacy CodeFactor Quality Gate Status Maintainability Rating Reliability Rating Security Rating Vulnerabilities Coverage Status

Linux Mac Docker Dockerfile DockerHub Pulls DockerHub Build Automated

CI Builds Overview Jenkins Concourse GoCD TeamCity

CircleCI BuildKite AppVeyor Drone Codefresh Cirrus CI Semaphore Buddy Shippable Travis CI

Azure DevOps Pipeline GitLab Pipeline BitBucket Pipeline AWS CodeBuild GCP Cloud Build

Repo on Azure DevOps Repo on GitHub Repo on GitLab Repo on BitBucket FOSSA Status ShellCheck JSON YAML XML Validation Kics Grype Semgrep Semgrep Cloud Trivy

GitHub Actions Ubuntu Mac Mac 11 Mac 12 Ubuntu Ubuntu 20.04 Ubuntu 22.04 Debian Debian 10 Debian 11 Debian 12 CentOS CentOS 7 CentOS 8 Fedora Alpine Alpine 3

Python versions Python 3.7 Python 3.8 Python 3.9 Python 3.10 Python 3.11

git.io/python-lib

Python library, full of lots of validation code and utility functions.

Hari Sekhon

Cloud & Big Data Contractor, United Kingdom

My LinkedIn

(you're welcome to connect with me on LinkedIn)

Build + Unit Tests

make &&
make test

Continuous Integration is run on this repo to build and test it (around 450 unit tests, plus custom tests).

Configuration

Strict validations include host/domain/FQDNs using TLDs which are populated from the official IANA list, a snapshot of which is shipped as part of this project.

To update the bundled official IANA TLD list with the latest valid TLDs do

make tld
Custom TLDs

If using bespoke internal domains such as .local, .intranet, .vm, .cloud etc. that aren't part of the official IANA TLD list then this is additionally supported via a custom configuration file resources/custom_tlds.txt containing one TLD per line, with support for # comment prefixes. Just add your bespoke internal TLD to the file and it will then pass the host/domain/fqdn validations.

Related Repositories

More Related Repositories

  • DevOps Bash Tools - 1000+ DevOps Bash Scripts, Advanced .bashrc, .vimrc, .screenrc, .tmux.conf, .gitconfig, CI configs & Utility Code Library - AWS, GCP, Kubernetes, Docker, Kafka, Hadoop, SQL, BigQuery, Hive, Impala, PostgreSQL, MySQL, LDAP, DockerHub, Jenkins, Spotify API & MP3 tools, Git tricks, GitHub API, GitLab API, BitBucket API, Code & build linting, package management for Linux / Mac / Python / Perl / Ruby / NodeJS / Golang, and lots more random goodies

  • SQL Scripts - 100+ SQL Scripts - PostgreSQL, MySQL, AWS Athena, Google BigQuery

  • Jenkins - Advanced Jenkinsfile & Jenkins Groovy Shared Library

  • GitHub-Actions - GitHub Actions master template & GitHub Actions Shared Workflows library

  • Templates - dozens of Code & Config templates - AWS, GCP, Docker, Jenkins, Terraform, Vagrant, Puppet, Python, Bash, Go, Perl, Java, Scala, Groovy, Maven, SBT, Gradle, Make, GitHub Actions Workflows, CircleCI, Jenkinsfile, Makefile, Dockerfile, docker-compose.yml, M4 etc.

  • Kubernetes configs - Kubernetes YAML configs - Best Practices, Tips & Tricks are baked right into the templates for future deployments

  • Terraform - Terraform templates for AWS / GCP / Azure / GitHub management

  • DevOps Python Tools - 80+ DevOps CLI tools for AWS, GCP, Hadoop, HBase, Spark, Log Anonymizer, Ambari Blueprints, AWS CloudFormation, Linux, Docker, Spark Data Converters & Validators (Avro / Parquet / JSON / CSV / INI / XML / YAML), Elasticsearch, Solr, Travis CI, Pig, IPython

  • DevOps Perl Tools - 25+ DevOps CLI tools for Hadoop, HDFS, Hive, Solr/SolrCloud CLI, Log Anonymizer, Nginx stats & HTTP(S) URL watchers for load balanced web farms, Dockerfiles & SQL ReCaser (MySQL, PostgreSQL, AWS Redshift, Snowflake, Apache Drill, Hive, Impala, Cassandra CQL, Microsoft SQL Server, Oracle, Couchbase N1QL, Dockerfiles, Pig Latin, Neo4j, InfluxDB), Ambari FreeIPA Kerberos, Datameer, Linux...

  • The Advanced Nagios Plugins Collection - 450+ programs for Nagios monitoring your Hadoop & NoSQL clusters. Covers every Hadoop vendor's management API and every major NoSQL technology (HBase, Cassandra, MongoDB, Elasticsearch, Solr, Riak, Redis etc.) as well as message queues (Kafka, RabbitMQ), continuous integration (Jenkins, Travis CI) and traditional infrastructure (SSL, Whois, DNS, Linux)

  • Nagios Plugin Kafka - Kafka API pub/sub Nagios Plugin written in Scala with Kerberos support

  • HAProxy Configs - 80+ HAProxy Configs for Hadoop, Big Data, NoSQL, Docker, Elasticsearch, SolrCloud, HBase, Cloudera, Hortonworks, MapR, MySQL, PostgreSQL, Apache Drill, Hive, Presto, Impala, ZooKeeper, OpenTSDB, InfluxDB, Prometheus, Kibana, Graphite, SSH, RabbitMQ, Redis, Riak, Rancher etc.

  • Dockerfiles - 50+ DockerHub public images for Docker & Kubernetes - Hadoop, Kafka, ZooKeeper, HBase, Cassandra, Solr, SolrCloud, Presto, Apache Drill, Nifi, Spark, Mesos, Consul, Riak, OpenTSDB, Jython, Advanced Nagios Plugins & DevOps Tools repos on Alpine, CentOS, Debian, Fedora, Ubuntu, Superset, H2O, Serf, Alluxio / Tachyon, FakeS3

  • HashiCorp Packer templates - Linux automated bare-metal installs and portable virtual machines OVA format appliances using HashiCorp Packer, Redhat Kickstart, Debian Preseed and Ubuntu AutoInstaller / Cloud-Init

  • Diagrams-as-Code - Cloud & Open Source architecture diagrams with Python & D2 source code provided - automatically regenerated via GitHub Actions CI/CD - AWS, GCP, Kubernetes, Jenkins, ArgoCD, Traefik, Kong API Gateway, Nginx, Redis, PostgreSQL, Kafka, Spark, web farms, event processing...

git.io/python-lib

git.io/python-lib

pylib's People

Contributors

cotsog avatar dependabot[bot] avatar harisekhon avatar mfechner avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pylib's Issues

Bug in warning threshold detection with the check_kafka.py plugin

I hit a strange bug with the check_kafka.py script when the kafka publish and consume takes longer than the warning threshold (1 second) it overrides the NagiosPlugin object's self.warning() method and sets it as an integer of 1. For now I just modified check_kafka.py to have much higher default thresholds.

The error shows up as an UNKNOWN response from the plugin with the message "UNKNOWN: 'int' object is not callable "

image

I added some debug print messages in check_kafka.py, then in pubsub_nagiosplugin.py, and finally in nagiosplugin.py. I think the bug is somewhere in the threshold checking mechanisms in nagiosplugin.py.

[root@ap-bornge02 pylib]# python /opt/nagios-plugins/pylib/check_kafka.py.debug --topic HealthCheckNagios
Returning
checking consumed message 'Test message from Hari Sekhon check_kafka.py.debug on host ap-bornge02.docl.nic at epoch 1479217115.2 (Tue Nov 15 08:38:35 2016) with random token 'ZD55usdANyDRfJ8LCEvv'' == published message 'Test message from Hari Sekhon check_kafka.py.debug on host ap-bornge02.docl.nic at epoch 1479217115.2 (Tue Nov 15 08:38:35 2016) with random token 'ZD55usdANyDRfJ8LCEvv''
checking self._consumed_message is not equal to self.publish_message....
setting self.message to my name or something
appending to self.msg with some time crap
running self.check_thresholds().....
Do I even have a val for self._publish_time? = 1.268
Calling self.get_threshold()...
checking self.warning() or self.critica().....
Calling self.get_threshold()...
checking self.warning() or self.critica().....
Warning in name so calling self.warning().....
type of self.warning = '1'
UNKNOWN: 'int' object is not callable

Initial Update

Hi ๐Ÿ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create separate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! ๐Ÿค–

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.