Saravanan666/pypi-org huggingface dataset:
Package: zabbix-controller
1. Zabbix CLI1.1 Example1.1.1 Valid Commandzabbix_controller-uusername-ppasswordhostslist
zabbix_controller-uusername-ppasswordhosts-mname:^server$list1.1.2 Invalid Commandzabbix_controllerhosts-uusername-ppasswordlist
zabbix_controller-uusername-ppasswordhostslist-mname:^server$1.2 zabbixctl [options] command ...1.2.1 OptionsThese options are only set atzabbixctl [options] command ....zabbixctl command [options] ...is not accepted.1.2.1.1 --helpzabbixctl--help1.2.1.2 --apiserver-address, -aazabbixctl-aahttp://localhost:80811.2.1.3 --username, -u, --password, -pUsed for zabbix loginzabbixctl--usernameAdmin--passwordzabbix_password1.2.1.4 --basicauth_username, -bu, --basicauth_password, -bpUsed for basic authenticationzabbixctl-bualis-bpalis_password1.2.1.5 --dry-runIf you set--dry-run, only get API is executed, then ZabbixCTL state is printed.
Create, update, delete like API is not executed.zabbixctl--dry-run1.3 zabbixctl hostOptionsCommand...1.3.1 Options1.3.1.1-m, --matchSearch host using json like object.
Search key, then apply value.
In the example below,
hosts which name key is includingsome_nameare listed.zabbixctlhosts-m'{"name": "some_name"}'list
zabbixctlhosts-m'[{"name": "some_name"}]'listEach key, value pairs are chained byand operator.
Each dicts are chained byor operator.This command mean("name": "some_name" and "hostid": "^1") or "name": "other_name".zabbixctlhosts-m'[{"name": "some_name", "hostid": "^1"}, {"name": "other_name"}]'list1.3.1.2-tr, --time-rangeThis option is able to specify time range.
If you use --match at the same time, used by "and operator".key:[from]-[to]fromandtomust be unixtime and can be omitted.
These commands are same and print host which disable property is included from 0 to now.zabbixctlhosts-trdisable:0-list
zabbixctlhosts-trdisable:-listThis command mean(("name": "some_name" and "hostid": "^1") or "name": "other_name") and (0 <= disable_until <= now).zabbixctlhosts-m'[{"name": "some_name", "hostid": "^1"}, {"name": "other_name"}]'-tr'disable_until:-'list1.3.2 Commands1.3.2.1listlist up host1.3.2.2deletedelete hostoptions-y, --yeszabbixctlhosts-m'{"name": "some_name"}'delete-y1.3.2.3disabledisable hostoptions-y, --yeszabbixctlhosts-m'{"name": "some_name"}'disable-y1.3.2.4updateupdate hostoptions-d, --data-y, --yesThese are same command.zabbixctlhosts-m'{"name": "some_name"}'update-d'{"state": 1}'-y
zabbixctlhosts-m'{"name": "some_name"}'update-d'{"state": "1"}'-y
zabbixctlhosts-m'{"name": "some_name"}'disable-y1.4 zabbixctl host graphsOptionsCommand1.4.1 Command1.4.2list1.4.3deleteoptions-y, --yes1.4.2 Options1.4.2.1-m, --matchThis command delete graphs which is in hosts which is matched regex.zabbixctlhosts-m'{"name": "some_name"}'graphsdelete-y1.5 zabbixctl host interfacesOptionsCommand1.5.1 Command1.5.1.1list1.5.1.2usednsUse dns, not ipaddressoptions-y, --yes1.5.1.3updateThese are same command.options-y, --yeszabbixctlhostsinterfacesupdate-d'{"useip": 0}'-y
zabbixctlhostsinterfacesupdate-d'{"useip": "0"}'-y
zabbixctlhostsinterfacesusedns-yLICENSE
Package: zabbixctl
# zabbixctl## Install```bashsudo pip install zabbixctl#orsudo make install#orsudo python setup.py install```## Usage```usage: zabbixctl [-h] [-d] [-i] [-V] [-c CACERT] [-t TIMEOUT] [-H HOSTS][-U USER]{help,get,create,update,export,delete} ...Zabbix CLIpositional arguments:{help,get,create,update,export,delete}get                 Zabbix API Method for getexport              Zabbix API Method for exportupdate              Zabbix API Method for updatecreate              Zabbix API Method for createdelete              Zabbix API Method for deletehelp                Display link for Zabbix wikioptional arguments:-h, --help            show this help message and exit-d, --debug           increase output verbosity (default: False)-i, --http            Use http instead of https (default: False)-V, --noverify        Do not verify the SSL (default: False)-c CACERT, --cacert CACERTPath to the SSL CA Certificateexample:/etc/pki/tls/certs/ca-bundle.crt (default: None)-t TIMEOUT, --timeout TIMEOUTZabbix API read timeout in seconds (default: 30)-H HOSTS, --hosts HOSTSZabbix API host(s).example: zabbixhost.example.com(default: None)-p URI_PATH, --uri-path URI_PATHURI path to zabbix api. default: zabbix (default:zabbix)-U USER, --user USER  Zabbix API user (default: system username)usage: zabbixctl get [-h] [-a ARGUMENTS] typepositional arguments:type                  Zabbix API get method(host.get,hostgroups.get,usergroups.get)optional arguments:-h, --help            show this help message and exit-a ARGUMENTS, --arguments ARGUMENTSRPC params-k, --listkeys        Returns a list of keys for the given resource type-f FILTER, --filter FILTERTakes "key=value" args that are sent to the zabbix apiin the filter parameter-s SEARCH, --search SEARCHTakes "key=value" args that are sent to the zabbix apiin the search parameter```## Examples```bashzabbixctl -H zabbix.yourdomain.com get trigger -a 'hostids=[10167]' -a 'expandExpression=true' -a 'expandDescription=true'zabbixctl -H zabbix.yourdomain.com get trigger -a 'search={"host":"syslog"}' -a 'expandExpression=true' -a 'searchWildcardsEnabled=true' -a 'selecthosts=extend'zabbixctl -H zabbix.yourdomain.com get trigger -a 'triggerids=[14924]'zabbixctl -H zabbix.yourdomain.com get trigger -a 'search={"host":"syslog"}' -a 'expandExpression=true'zabbixctl -H zabbix.yourdomain.com get userzabbixctl -H zabbix.yourdomain.com get hostzabbixctl -H zabbix.yourdomain.com get host -a 'search={"host":"syslog"}' -a 'searchWildcardsEnabled=true'zabbixctl -H zabbix.yourdomain.com get alert -a 'time_from=1409611855' -a 'output=extend'zabbixctl -H zabbix.yourdomain.com get itemprototypezabbixctl -H zabbix.yourdomain.com get event -a 'time_from=1409611855' -a 'output=extend' -a 'selectRelatedObject=["description"]'zabbixctl -H zabbix.yourdomain.com get alert -a 'time_from=1409611855' -a 'output=extend' -a 'selectHosts=["host"]'zabbixctl -H zabbix.yourdomain.com get template -a 'output=["host"]' -a 'selectItems=extend' -a 'templateids=[10167]'```## Known IssuesError: ImportError: cannot import name to_native_stringSolution: Upgrade to at least version 2.0 of requests
Package: zabbix-enums
zabbix-enumsZabbix enumerations for API scripting.This package aims to provide enumerations for Zabbix object parameters.
So instead of using bare numbers and constantly browsing the docs, you can just use a nice enum.Example 1:
Use nice enums in API callsfromzabbix_enums.z60importTriggerStatefrompyzabbiximportZabbixAPIzapi=ZabbixAPI('http://localhost')zapi.login('Admin','zabbix')# thisunknown_triggers=zapi.trigger.get(filter={'state':1})# becomes thisunknown_triggers=zapi.trigger.get(filter={'state':TriggerState.UNKNOWN})zapi.user.logout()Example 2:
Filter entities offline, based on their statusfromzabbix_enums.z60importHostStatusfrompyzabbiximportZabbixAPIzapi=ZabbixAPI('http://localhost')zapi.login('Admin','zabbix')hosts=zapi.host.get()monitored=[hforhinhostsifHostStatus(h['status'])==HostStatus.MONITORED]zapi.user.logout()Example 3:
Filter problems with severities above a certain levelfromzabbix_enums.z60importProblemSeverityfrompyzabbiximportZabbixAPIzapi=ZabbixAPI('http://localhost')zapi.login('Admin','zabbix')problems=zapi.problem.get()important=[pforpinproblemsifProblemSeverity(p['severity'])>ProblemSeverity.AVERAGE]zapi.user.logout()LimitationsPlease bare in mind that not all enumerations are present at this time.
For comparing Enums do not useiskeyword - see second exampleAt this moment, only Zabbix 5.0 and above is supported.VersioningThe following version schema is used: X.Y.ZX - major version. If this changes, your code might break - update with caution.Y - latest supported Zabbix version. I.E 1.60.0 supports Zabbix 6.0 and below but not 6.2.Z - minor version. For bugfixes.
Package: zabbix-epics-py
Zabbix sender for EPICS-CAThis package allows to send metrics to a Zabbix server from EPICS records via Channel Access.SeedocmentationInstallingSimple install is below.pipinstallzabbix-epics-pyOr clone this package and install it.# clone the repositorygitclonehttps://github.com/sasaki77/zabbix-epics-pycdzabbix-epics-py# install zabbix-epics-pypipinstall-e.UsageBefore using this program, you should create hosts and items in Zabbix.
Type of the items must be set to Zabbix trapper.Below is a simple example usage.
Values ofTEST:PVare sent to a Zabbix server at 30 sec intervals and metrics are stored tozabbix-epics-py-test.itemkey ofdummyHost.>>>fromzbxepicsimportZabbixSenderCA>>>server_ip='127.0.0.1'>>>port=10051>>>config=False>>>items=[dict(host='dummyHost',pv='TEST:PV',interval=30,item_key='zabbix-epics-py-test.item',func='last')]>>>sender=ZabbixSenderCA(server_ip,port,config,items)>>>sender.run()intervalis an interval in seconds between sending metrics to Zabbix. Ifintervalis set tomonitor, metrics are sent every monitor update.funcdetermines a function to be applied to a monitored value buffer.Avalilable funcs are below.lastminmaxavgFor example, a monitored pv is processed 3 times and its value changed to 1, 2 and 3. Then the value sent to Zabbix is 2 iffuncis set to avg.TestSome part of tests run HTTP server on 30051 port to emulate a Zabbix server.You should concern localhost http access to test correctly.
(e.g. HTTP proxy settings)Run without coverage:pipinstallpytest
pytestRun with coverage:pipinstallpytestpytest-cov
pytest--covzbxepics
coveragereport-mBuild Documentationpip install sphinx m2r sphinx_rtd_theme
cd doc/_build/html
make html
Package: zabbix_exporter
zabbix_exporterUsageUsage: zabbix_exporter [OPTIONS]

  Zabbix metrics exporter for Prometheus

  Use config file to map zabbix metrics names/labels into prometheus. Config
  below transfroms this:

      local.metric[uwsgi,workers,myapp,busy] = 8
      local.metric[uwsgi,workers,myapp,idle] = 6

  into familiar Prometheus gauges:

      uwsgi_workers{instance="host1",app="myapp",status="busy"} 8
      uwsgi_workers{instance="host1",app="myapp",status="idle"} 6

  YAML:

      metrics:
        - key: 'local.metric[uwsgi,workers,*,*]'
          name: 'uwsgi_workers'
          labels:
            app: $1
            status: $2
          reject:
            - 'total'

Options:
  --config PATH               Path to exporter config
  --port INTEGER              Port to serve prometheus stats [default: 9224]
  --url TEXT                  HTTP URL for zabbix instance
  --login TEXT                Zabbix username
  --password TEXT             Zabbix password
  --verify-tls / --no-verify  Enable TLS cert verification [default: true]
  --timeout INTEGER           API read/connect timeout
  --verbose
  --dump-metrics              Output all metrics for human to write yaml
                              config
  --version
  --help                      Show this message and exit.Deploying with Dockerdocker run -d --name zabbix_exporter -v /path/to/your/config.yml:/zabbix_exporter/zabbix_exporter.yml --env=ZABBIX_URL="https://zabbix.example.com/" --env="ZABBIX_LOGIN=username" --env="ZABBIX_PASSWORD=secret" mybook/zabbix-exporterHistory1.0.2 (2017-02-25)Fix build script1.0.1 (2017-02-25)Add docker imagemybook/zabbix-exporter1.0.0 (2017-01-20)Initial PyPI release
Package: zabbix-feishu-alert
（一）zabbix-feishu-alert 模块使用方法(一)：安装从 PYPI 安装pip install -U  zabbix-feishu-alert从 Github 安装pip install git+https://github.com/yinhuanyi/zabbix-feishu-alert.git(二)：使用方法from zabbix_feishu_alert import FeishuMessage

# 第一个参数：100.99.1.3为你的zabbix serverIP地址
# 第二个参数：Admin为你的zabbix web登录用户名
# 第三个参数：zabbix为你的zabbix web登录密码
# 第四个参数：13970236751为被@人的手机号码
# 第五个参数：36836为监控item的item id
# 第六个参数：zabbix graph存储路径
# 第七个参数：飞书机器人的app_id
# 第八个参数：飞书机器人的app_secret
feishu = FeishuMessage('100.99.1.3',
                       'Admin',
                       'zabbix',
                       '13970236751',
                       36836,
                       './',
                       'cli_9e44d8e26dbb500d',
                       '8X4jX9MLwg6AXIEVJh0lC8oeHNDBfbnd')

# 第一个和第二个参数为：发送告警信息的时候，需要获取到zabbix中的title信息和message信息
# 第三个参数：38524是此次告警的event_id
# 第四个参数：http://100.112.2.11:8000/monitor/problem_ack/是[立即处理]按钮发送ACK消息webhook的地址
feishu.send_alarm_message("Zabbix Alert Title",
                          "Zabbix Alert Content",
                          38524,
                          'http://100.112.2.11:8000/monitor/problem_ack/')

# 发送确认告警消息
feishu.send_ack_message("Zabbix Ack Title", 
                        "Zabbix Content Title")

# 发送恢复告警消息
feishu.send_recovery_message("Zabbix Recovery Title", 
                             "Zabbix Content Title")(三)：告警效果测试效果真实接入zabbix之后的效果(四)：点击[立即处理]按钮当值班人被@后，需要点击立即处理，立即处理会跳转到企业内部的运维平台，记录告警人的基本信息，例如：姓名，处理告警的时间等（二）飞书机器人的创建(一)：登录飞书开放平台登录飞书开放飞书开放平台在我的应用中，点击创建企业自建应用在应用凭证栏中，可以看到APP ID和App Secret欢迎提交PR
Package: zabbix-import
Utility to import exported XML configuration(templates, hosts, ...) into Zabbix using it'sAPI.$ zbx-import.py -u Admin -p *** --url https://zabbix.local/api_jsonrpc.php exported_templates.xml
SUCCESS: configuration importTested with Zabbix 3.4 and 4.0, probably will work with older versions up to 2.0. Written in pure python, no additional libraries are required. Works with both python 3 and python 2.Allows to control import options:create new - add new elements from the import file. Default: Trueupdate existing - update existing elements from the import file. Default: Truedelete missing - remove existing elements not present in the import file. Default: False.NOTE: without this option importing existing template with changed triggers will create new triggers, but old ones with the same name and different value will remain.You can set this options for all elements or precisely select list of elements for the option:--delete-missing 'triggers graphs'. Check--helpfor available elements.$ zbx-import.py -u Admin -p *** --url https://zabbix.local/api_jsonrpc.php --delete-missing exported_templates.xml
SUCCESS: configuration importInstallationSimplest option - just usezbx-import.pydirectly, it does not have any dependencies.Frompypi.org:pip install zabbix-importOr create a Docker image and use it:dockerbuild-tzabbix-import.# No options to get help on usagedockerrun-it--rmzabbix-import[options]P.S.If this code is useful for you - don't forget to put a star on it'sgithub repo.
Package: zabbix-sender-async
Zabbix Async Sender module for PythonInstallpip install zabbix-sender-asyncExamplesimportasynciofromzabbixasync.senderimportAsyncSender,ItemDataasyncdefsendmetrics():sender=AsyncSender('localhost',10051)metric=ItemData(host='hostname',key='test.metric.text',value='test package import')result=awaitsender.send(metric)print(result)asyncio.run(sendmetrics())Expected result:ZabbixResponse(processed=1, failed=0, total=1, seconds_spent=0.00019, response='success')
Package: zabbixsim
# zabbixsimZabbix Agent Simulator (active)The Zabbix Agent Simulator is intended to be used instead of the regular Zabbix agent in scenarios, where the use of the real Zabbix Agnet is not partical or desirable. This includes testing scenarios that are not possible on a live system.This is works well with the snmpsim to provide simulation data for Zabbix.
<https://github.com/etingof/snmpsim>
<https://pypi.org/project/snmpsim/>The simulator is based on the protocol documented in the Zabbbix manual.
<https://www.zabbix.com/documentation/current/manual/appendix/items/activepassive>## Installation`bash pip install zabbixsim `## Usage### Record simulation fileRecord a simulation file from a Zabbix Server`bash zabbixrec `### Run simulation fileRun a simulation file with a Zabbix Server`bash zabbixsim `Copyright (c) 2021, [Adam Leggo](mailto:adam@leggo.id.au). All rights reserved.
Package: zabbix-template-converter
This Python script aims to resolve compatability issues when migrating Zabbix
template XML files between versions of Zabbix. For example, you may wish to
import a Zabbix v3.2 template into Zabbix v2.0.The script works by applying conversion rules to a template, which manipulate
the template XML to match the desired Zabbix version template format.InstallationInstall the Python script to/usr/local/binwith pip:$pipinstallzabbix-template-converterUsage$zabbix-template-convertor-husage:zabbix-template-convertor[-h][-v]-oX.Y.Z[-s]fileMigrateZabbixtemplatesbetweenversionspositionalarguments:fileZabbixtemplateXMLfileoptionalarguments:-h,--helpshowthishelpmessageandexit-v,--versionshowprogram'sversionnumberandexit-oX.Y.Z,--output-versionX.Y.ZtargetZabbixversion-s,--squash-value-mapsremovereferencestovaluemapsforversionsolderthan3.0.0ExamplesTo convert a Zabbix 3.2 template for import into v2.0:$zabbix-template-convertor-o2.0my_template.xml>my_template-2.0.xmlA number of transformations will take place. For example, Discovery Rule
filters will be downgraded from the multiple-filter format introduced in Zabbix 2.4, to a single filter expression as follows:<filter><evaltype>0</evaltype><formula/><conditions><condition><macro>{#IFNAME}</macro><value>@Networkinterfacesfordiscovery</value><operator>8</operator><formulaid>A</formulaid></condition></conditions></filter>Becomes:<filter>{#IFNAME}:@Networkinterfacesfordiscovery</filter>CoverageThis project relies heavily on the community to report incompatibility problems
when importing templates.Please raise an issueif you find a template that won’t import after being
converted. Be sure to include the error messages and template file.Over time, as conversion rules are added, the script should become more
comprehensive, and more reliable.
Package: zabbix-weixin-alert
zabbix 企业微信报警.调用企业微信API接口实现微信报警.#Usage:```Install:pip install zabbix-weixin-alertpip show zabbix-weixin-alert```[root@zabbix ~]# pip show zabbix-weixin-alertDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.Name: zabbix-weixin-alertVersion: 2019.2.27.1Summary: zabbix qiye weixin alertHome-page: https://github.com/talenhao/zabbix-weixin-alertAuthor: Tianfei HaoAuthor-email: talenhao@gmail.comLicense: BSD LicenseLocation: /usr/lib/python2.7/site-packagesRequires: requestsRequired-by:```In location path,copy /usr/lib/python2.7/site-packages/wxapi/zabbix-wx-alert.pyc to you zabbix-server alertscriptpath.```[root@zabbix ~ ]# cp /usr/lib/python2.7/site-packages/wxapi/zabbix-wx-alert.pyc /usr/lib/zabbix/alertscripts/ && chmod +x /usr/lib/zabbix/alertscripts/zabbix-wx-alert.pyc```Add zabbix media with 6 Script parameters{ALERT.SENDTO}{ALERT.SUBJECT}{ALERT.MESSAGE}ww2489f02c7dxxxxxx # corpidet9Tkdp3ZkXAKpoxTdam6JRMgu2DRePLWmqB3xxxxxx # corp_secret1000002 # agentidadd new media to users.
Package: zabel-commons
zabel-commonsOverviewThis is part of the Zabel platform.  Thezabel-commonspackage contains
interfaces, exceptions, and helpers that are used throughout the platform.It is not typically installed as a standalone package but comes in as a
dependency from other packages.If you want to develop a package that offers newelementsfor Zabel, or if
you want to create an application that will be deployed usingzabel-fabric,
you will probably have to add this package as a dependency.It provides five modules:zabel.commons.exceptionszabel.commons.interfaceszabel.commons.sessionszabel.commons.serverszabel.commons.utilsThis package makes use of therequestslibrary.  It has no other external
dependencies.LicenseCopyright (c) 2019-2023 Martin Lafaix (martin.lafaix@external.engie.com) and others

This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0
Package: zabel-fabric
zabel-fabricOverviewPlease note that this library is not feature-complete yet.This is part of the Zabel platform.  Thezabel-fabricpackage definesfabrics.A fabric is what host a Zabel platform.  A given fabric can host more than one
Zabel platform, and it can also host other applications.A fabric provides foundations for the applications and platforms it hosts to build
upon.  Those foundations include isolation, access control, secret management, as
well as deployments, persistence, and discovery services.Zabel's fabrics are not the first attempt to offer such foundations for applications.
They will not be the last either.What fabrics do is that they (try to) provide a (very) small, coherent subset of what
Kubernetes clusters offer.An application that can be deployed on a fabric can be deployed as-is on a Kubernetes
cluster, if theimagesit uses are converted to proper containers and they
preserve encapsulation.Images, in Zabel, are plain classes with a constructor matching a known signature
and arunmethod, so they can easily be converted to containers.It does not mean any Python application can be automagically converted to a cloud-native
application, and it of course does not imply that you can deploy your existing Kubernetes
applications on a Zabel fabric.What it means is that if your Python application has been designed to work on a Zabel
fabric, it can be deployed on a full-fledged Kubernetes cluster, should the need arise.What it also means is that you can use existing tools (such askubectlor your favorite
editor extension) to explore or change the state of a running fabric or to deploy new
resources.ExampleHere is a simple Hello World example.Assuming the following class in ahello.pyfile:importosfromtimeimportsleepfromzabel.commons.interfacesimportImageclassHelloWorld(Image):def__init__(self):self.name=os.environ.get('NAME','World')defrun(self):print(f'hello{self.name}')sleep(15)print('good bye')And the followingpod.yamlmanifest:apiVersion:v1kind:Podmetadata:name:hellospec:restartPolicy:Nevercontainers:-name:Helloimage:hello/HelloWorldenv:-name:NAMEvalue:'Alice'We can deploy it as follow:kubectlapply-fpod.yamlOn your Zabel fabric console, the following should be displayed:hello Alice
...
good byeResourcesThe following resources are available, at least partially, on fabrics:v1/Eventsv1/Namespacev1/Podv1/Secretv1/Servicev1/ServiceAccountv1.apiextensions.k8s.io/CustomResourceDefinitionv1.apps/Deploymentv1.rbac.authorization.k8s.io/ClusterRolev1.rbac.authorization.k8s.io/ClusterRoleBindingv1.rbac.authorization.k8s.io/Rolev1.rbac.authorization.k8s.io/RoleBindingv1beta1.networking.k8s.io/IngressLicenseCopyright (c) 2019-2020 Martin Lafaix (martin.lafaix@external.engie.com) and others

This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0