From e711d30377c4681e75d91f7e7202497b9ba18132 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 13 Jun 2018 13:01:53 +0200 Subject: T689: remove files no longer needed after merging PR#14 into vyos-1x. --- Makefile.am | 2 - scripts/maya-date.py | 214 --------------------- templates/poweroff/at/node.def | 1 - templates/poweroff/at/node.tag/node.def | 3 - templates/poweroff/cancel/node.def | 2 - templates/poweroff/node.def | 2 - templates/poweroff/now/node.def | 2 - templates/reboot/at/node.def | 1 - templates/reboot/at/node.tag/node.def | 3 - templates/reboot/cancel/node.def | 2 - templates/reboot/node.def | 2 - templates/reboot/now/node.def | 2 - templates/show/arp/node.def | 2 - templates/show/arp/node.tag/node.def | 7 - templates/show/bridge/node.def | 2 - templates/show/bridge/node.tag/macs/node.def | 2 - templates/show/bridge/node.tag/node.def | 5 - .../show/bridge/node.tag/spanning-tree/node.def | 2 - templates/show/configuration/all/node.def | 8 - templates/show/configuration/commands/node.def | 7 - templates/show/configuration/files/node.def | 11 -- templates/show/configuration/node.def | 7 - templates/show/date/node.def | 2 - templates/show/date/utc/maya/node.def | 2 - templates/show/date/utc/node.def | 2 - templates/show/disk/node.def | 1 - templates/show/disk/node.tag/format/node.def | 7 - templates/show/disk/node.tag/node.def | 4 - templates/show/hardware/cpu/detail/node.def | 4 - templates/show/hardware/cpu/node.def | 2 - templates/show/hardware/cpu/summary/node.def | 2 - templates/show/hardware/dmi/node.def | 2 - templates/show/hardware/mem/node.def | 4 - templates/show/hardware/node.def | 1 - templates/show/hardware/pci/detailed/node.def | 2 - templates/show/hardware/pci/node.def | 2 - templates/show/hardware/scsi/detail/node.def | 2 - templates/show/hardware/scsi/node.def | 2 - templates/show/hardware/usb/detail/node.def | 3 - templates/show/hardware/usb/node.def | 2 - templates/show/raid/node.def | 2 - templates/show/raid/node.tag/node.def | 23 --- templates/show/users/node.def | 2 - templates/show/users/recent/node.def | 2 - templates/show/users/recent/node.tag/node.def | 3 - 45 files changed, 367 deletions(-) delete mode 100644 scripts/maya-date.py delete mode 100644 templates/poweroff/at/node.def delete mode 100644 templates/poweroff/at/node.tag/node.def delete mode 100644 templates/poweroff/cancel/node.def delete mode 100644 templates/poweroff/node.def delete mode 100644 templates/poweroff/now/node.def delete mode 100644 templates/reboot/at/node.def delete mode 100644 templates/reboot/at/node.tag/node.def delete mode 100644 templates/reboot/cancel/node.def delete mode 100644 templates/reboot/node.def delete mode 100644 templates/reboot/now/node.def delete mode 100644 templates/show/arp/node.def delete mode 100644 templates/show/arp/node.tag/node.def delete mode 100644 templates/show/bridge/node.def delete mode 100644 templates/show/bridge/node.tag/macs/node.def delete mode 100644 templates/show/bridge/node.tag/node.def delete mode 100644 templates/show/bridge/node.tag/spanning-tree/node.def delete mode 100644 templates/show/configuration/all/node.def delete mode 100644 templates/show/configuration/commands/node.def delete mode 100644 templates/show/configuration/files/node.def delete mode 100644 templates/show/configuration/node.def delete mode 100644 templates/show/date/node.def delete mode 100644 templates/show/date/utc/maya/node.def delete mode 100644 templates/show/date/utc/node.def delete mode 100644 templates/show/disk/node.def delete mode 100644 templates/show/disk/node.tag/format/node.def delete mode 100644 templates/show/disk/node.tag/node.def delete mode 100644 templates/show/hardware/cpu/detail/node.def delete mode 100644 templates/show/hardware/cpu/node.def delete mode 100644 templates/show/hardware/cpu/summary/node.def delete mode 100644 templates/show/hardware/dmi/node.def delete mode 100644 templates/show/hardware/mem/node.def delete mode 100644 templates/show/hardware/node.def delete mode 100644 templates/show/hardware/pci/detailed/node.def delete mode 100644 templates/show/hardware/pci/node.def delete mode 100644 templates/show/hardware/scsi/detail/node.def delete mode 100644 templates/show/hardware/scsi/node.def delete mode 100644 templates/show/hardware/usb/detail/node.def delete mode 100644 templates/show/hardware/usb/node.def delete mode 100644 templates/show/raid/node.def delete mode 100644 templates/show/raid/node.tag/node.def delete mode 100644 templates/show/users/node.def delete mode 100644 templates/show/users/recent/node.def delete mode 100644 templates/show/users/recent/node.tag/node.def diff --git a/Makefile.am b/Makefile.am index 2ecd735..ad9c01a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,7 +48,6 @@ bin_SCRIPTS += scripts/vyatta-monitor-background-stop bin_SCRIPTS += scripts/vyatta-monitor-check-rule-log bin_SCRIPTS += scripts/vyos-show-ram.sh bin_SCRIPTS += scripts/vyos-strip-config.pl -bin_SCRIPTS += scripts/maya-date.py bin_SCRIPTS += scripts/ssh-server-key sbin_SCRIPTS = scripts/dhcpv6-client-show-leases.pl @@ -60,7 +59,6 @@ bin_sudo_users_SCRIPTS = scripts/vyatta-identify-interface.pl bin_sudo_users_SCRIPTS += scripts/vyatta-delete-log-file.sh bin_sudo_users_SCRIPTS += scripts/vyatta-reboot.pl bin_sudo_users_SCRIPTS += scripts/vyatta-poweroff.pl -bin_sudo_users_SCRIPTS += scripts/vyatta-op-dns-forwarding.pl bin_sudo_users_SCRIPTS += scripts/vyatta-op-dynamic-dns.pl bin_sudo_users_SCRIPTS += scripts/vyatta-clear-conntrack diff --git a/scripts/maya-date.py b/scripts/maya-date.py deleted file mode 100644 index 6f0918c..0000000 --- a/scripts/maya-date.py +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2013 Daniil Baturin -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -import sys - -class MayaDate(object): - """ Converts number of days since UNIX epoch - to the Maya calendar date. - - Ancient Maya people used three independent calendars for - different purposes. - - Long count calendar is for recording historical events. - It and represents the number of days passed - since some date in the past the Maya believed is the day - our world was created. - - Tzolkin calendar is for religious purposes, it has - two independent cycles of 13 and 20 days, where 13 day - cycle days are numbered, and 20 day cycle days are named. - - Haab calendar is for agriculture and daily life, it's a - 365 day calendar with 18 months 20 days each, and 5 - nameless days. - - The smallest unit of long count calendar is one day (kin) - - """ - - """ The long count calendar uses five different base 18 or base 20 - cycles. Long-count date is writtin in dot separated format - from longest to shortest cycle, - .... - for example, "13.0.0.9.2". - - Classic version actually used by the ancient Maya wraps around - every 13th baktun, but modern researchers often use longer cycles - such as piktun = 20 baktun. - - """ - kin = 1 - winal = 20 # 20 kin - tun = 360 # 18 winal - katun = 7200 # 20 tun - baktun = 144000 # 20 katun - - """ Tzolk'in date is composed of two independent cycles. - Dates repeat every 260 days, 13 Ajaw is considered the end - of tzolk'in. - - Every day of the 20 day cycle has unique name, we number - them from zero so it's easier to map remainder to day: - """ - tzolkin_days = { 0: "Imix'", - 1: "Ik'", - 2: "Ak'b'al", - 3: "K'an", - 4: "Chikchan", - 5: "Kimi", - 6: "Manik'", - 7: "Lamat", - 8: "Muluk", - 9: "Ok", - 10: "Chuwen", - 11: "Eb'", - 12: "B'en", - 13: "Ix", - 14: "Men", - 15: "Kib'", - 16: "Kab'an", - 17: "Etz'nab'", - 18: "Kawak", - 19: "Ajaw" } - - """ As said above, haab (year) has 19 months. Only 18 are - true months of 20 days each, the remaining 5 days called "wayeb" - do not really belong to any month, but we think of them as a pseudo-month - for convenience. - - Also, note that days of the month are actually numbered from 0, not from 1, - it's not for technical reasons. - """ - haab_months = { 0: "Pop", - 1: "Wo'", - 2: "Sip", - 3: "Sotz'", - 4: "Sek", - 5: "Xul", - 6: "Yaxk'in'", - 7: "Mol", - 8: "Ch'en", - 9: "Yax", - 10: "Sak'", - 11: "Keh", - 12: "Mak", - 13: "K'ank'in", - 14: "Muwan'", - 15: "Pax", - 16: "K'ayab", - 17: "Kumk'u", - 18: "Wayeb'" } - - """ Now we need to map the beginning of UNIX epoch - (Jan 1 1970 00:00 UTC) to the beginning of the long count - calendar (0.0.0.0.0, 4 Ajaw, 8 Kumk'u). - - The problem with mapping the long count calendar to - any other is that its start date is not known exactly. - - The most widely accepted hypothesis suggests it was - August 11, 3114 BC gregorian date. In this case UNIX epoch - starts on 12.17.16.7.5, 13 Chikchan, 3 K'ank'in - - It's known as Goodman-Martinez-Thompson (GMT) correlation - constant. - """ - start_days = 1856305 - - """ Seconds in day, for conversion from timestamp """ - seconds_in_day = 60 * 60 * 24 - - def __init__(self, timestamp): - if timestamp is None: - self.days = self.start_days - else: - self.days = self.start_days + (int(timestamp) // self.seconds_in_day) - - def long_count_date(self): - """ Returns long count date string """ - days = self.days - - cur_baktun = days // self.baktun - days = days % self.baktun - - cur_katun = days // self.katun - days = days % self.katun - - cur_tun = days // self.tun - days = days % self.tun - - cur_winal = days // self.winal - days = days % self.winal - - cur_kin = days - - longcount_string = "{0}.{1}.{2}.{3}.{4}".format( cur_baktun, - cur_katun, - cur_tun, - cur_winal, - cur_kin ) - return(longcount_string) - - def tzolkin_date(self): - """ Returns tzolkin date string """ - days = self.days - - """ The start date is not the beginning of both cycles, - it's 4 Ajaw. So we need to add 4 to the 13 days cycle day, - and substract 1 from the 20 day cycle to get correct result. - """ - tzolkin_13 = (days + 4) % 13 - tzolkin_20 = (days - 1) % 20 - - tzolkin_string = "{0} {1}".format(tzolkin_13, self.tzolkin_days[tzolkin_20]) - - return(tzolkin_string) - - def haab_date(self): - """ Returns haab date string. - - The time start on 8 Kumk'u rather than 0 Pop, which is - 17 days before the new haab, so we need to substract 17 - from the current date to get correct result. - """ - days = self.days - - haab_day = (days - 17) % 365 - haab_month = haab_day // 20 - haab_day_of_month = haab_day % 20 - - haab_string = "{0} {1}".format(haab_day_of_month, self.haab_months[haab_month]) - - return(haab_string) - - def date(self): - return("{0}, {1}, {2}".format( self.long_count_date(), self.tzolkin_date(), self.haab_date() )) - -try: - timestamp = sys.argv[1] -except: - print("Please specify timestamp in the argument") - sys.exit(1) - -maya_date = MayaDate(timestamp) -print(maya_date.date()) diff --git a/templates/poweroff/at/node.def b/templates/poweroff/at/node.def deleted file mode 100644 index 537bfff..0000000 --- a/templates/poweroff/at/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Poweroff at a specific time diff --git a/templates/poweroff/at/node.tag/node.def b/templates/poweroff/at/node.tag/node.def deleted file mode 100644 index 932e04b..0000000 --- a/templates/poweroff/at/node.tag/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Poweroff the system at a future time -allowed: echo -n '' '' '' '' -run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff_at --at_time "$3" diff --git a/templates/poweroff/cancel/node.def b/templates/poweroff/cancel/node.def deleted file mode 100644 index c45f17a..0000000 --- a/templates/poweroff/cancel/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Cancel a pending poweroff -run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff_cancel diff --git a/templates/poweroff/node.def b/templates/poweroff/node.def deleted file mode 100644 index ccb7338..0000000 --- a/templates/poweroff/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Poweroff the system -run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff diff --git a/templates/poweroff/now/node.def b/templates/poweroff/now/node.def deleted file mode 100644 index 6b67572..0000000 --- a/templates/poweroff/now/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Poweroff the system without confirmation -run: sudo /opt/vyatta/bin/sudo-users/vyatta-poweroff.pl --action poweroff --now diff --git a/templates/reboot/at/node.def b/templates/reboot/at/node.def deleted file mode 100644 index 9944ff7..0000000 --- a/templates/reboot/at/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Reboot at a specific time diff --git a/templates/reboot/at/node.tag/node.def b/templates/reboot/at/node.tag/node.def deleted file mode 100644 index 62f39f9..0000000 --- a/templates/reboot/at/node.tag/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Reboot the system at a future time -allowed: echo -n '' '' '' '' -run: sudo /opt/vyatta/bin/sudo-users/vyatta-reboot.pl --action reboot_at --at_time "$3" diff --git a/templates/reboot/cancel/node.def b/templates/reboot/cancel/node.def deleted file mode 100644 index 110f595..0000000 --- a/templates/reboot/cancel/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Cancel a pending reboot -run: sudo /opt/vyatta/bin/sudo-users/vyatta-reboot.pl --action reboot_cancel diff --git a/templates/reboot/node.def b/templates/reboot/node.def deleted file mode 100644 index e65917d..0000000 --- a/templates/reboot/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Reboot the system -run: sudo /opt/vyatta/bin/sudo-users/vyatta-reboot.pl --action reboot diff --git a/templates/reboot/now/node.def b/templates/reboot/now/node.def deleted file mode 100644 index 2171b45..0000000 --- a/templates/reboot/now/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Reboot the system without confirmation -run: sudo /opt/vyatta/bin/sudo-users/vyatta-reboot.pl --action reboot --now diff --git a/templates/show/arp/node.def b/templates/show/arp/node.def deleted file mode 100644 index 013e016..0000000 --- a/templates/show/arp/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show Address Resolution Protocol (ARP) information -run: /usr/sbin/arp -e -n diff --git a/templates/show/arp/node.tag/node.def b/templates/show/arp/node.tag/node.def deleted file mode 100644 index 648797b..0000000 --- a/templates/show/arp/node.tag/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show Address Resolution Protocol (ARP) cache for specified interface -allowed: local -a vals; - vals=($(${vyatta_sbindir}/vyatta-interfaces.pl --show ethernet)); - vals+=($(${vyatta_sbindir}/vyatta-interfaces.pl --show bridge)); - vals+=($(${vyatta_sbindir}/vyatta-interfaces.pl --show bonding)); - echo ${vals[@]}; -run: /usr/sbin/arp -e -n -i "$3" diff --git a/templates/show/bridge/node.def b/templates/show/bridge/node.def deleted file mode 100644 index 86d0193..0000000 --- a/templates/show/bridge/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show bridging information -run: /sbin/brctl show diff --git a/templates/show/bridge/node.tag/macs/node.def b/templates/show/bridge/node.tag/macs/node.def deleted file mode 100644 index e985437..0000000 --- a/templates/show/bridge/node.tag/macs/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show bridge Media Access Control (MAC) address table -run: /sbin/brctl showmacs "$3" diff --git a/templates/show/bridge/node.tag/node.def b/templates/show/bridge/node.tag/node.def deleted file mode 100644 index 0ae82f1..0000000 --- a/templates/show/bridge/node.tag/node.def +++ /dev/null @@ -1,5 +0,0 @@ -help: Show bridge information for a given bridge interface -allowed: local -a array ; - array=( /sys/class/net/br* ) ; - echo -n '' ${array[@]##*/} -run: /sbin/brctl show "$3" diff --git a/templates/show/bridge/node.tag/spanning-tree/node.def b/templates/show/bridge/node.tag/spanning-tree/node.def deleted file mode 100644 index 360d15a..0000000 --- a/templates/show/bridge/node.tag/spanning-tree/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show bridge spanning tree information -run: /sbin/brctl showstp "$3" diff --git a/templates/show/configuration/all/node.def b/templates/show/configuration/all/node.def deleted file mode 100644 index 3f93f48..0000000 --- a/templates/show/configuration/all/node.def +++ /dev/null @@ -1,8 +0,0 @@ -help: Show running configuration (including default values) -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - cli-shell-api showCfg --show-show-defaults --show-active-only \ - --show-hide-secrets - else - echo Must be an admin user to run this command. - fi diff --git a/templates/show/configuration/commands/node.def b/templates/show/configuration/commands/node.def deleted file mode 100644 index f2e047e..0000000 --- a/templates/show/configuration/commands/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show running configuration as set commands -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - cli-shell-api showCfg --show-active-only | vyos-config-to-commands - else - echo Must be an admin user to run this command. - fi diff --git a/templates/show/configuration/files/node.def b/templates/show/configuration/files/node.def deleted file mode 100644 index 698ba14..0000000 --- a/templates/show/configuration/files/node.def +++ /dev/null @@ -1,11 +0,0 @@ -help: Show available saved configurations -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - find ${vyatta_sysconfdir}/config/ -type f -not -name ".*" -not -name "config.boot.*" -printf "%f\t(%Tc)\t%T@\n" | sort -r -k3 | awk -F"\t" '{printf ("%-20s\t%s\n", $1,$2) ;}' - else - echo Must be an admin user to run this command. - fi - - - - diff --git a/templates/show/configuration/node.def b/templates/show/configuration/node.def deleted file mode 100644 index 34813a4..0000000 --- a/templates/show/configuration/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show running configuration -run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; - then - cli-shell-api showCfg --show-active-only --show-hide-secrets - else - echo Must be an admin user to run this command. - fi diff --git a/templates/show/date/node.def b/templates/show/date/node.def deleted file mode 100644 index eb5adf9..0000000 --- a/templates/show/date/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show system date and time -run: /bin/date diff --git a/templates/show/date/utc/maya/node.def b/templates/show/date/utc/maya/node.def deleted file mode 100644 index ddc82c7..0000000 --- a/templates/show/date/utc/maya/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show UTC date in Maya calendar format -run: ${vyatta_bindir}/maya-date.py $(date +%s) diff --git a/templates/show/date/utc/node.def b/templates/show/date/utc/node.def deleted file mode 100644 index cb12d00..0000000 --- a/templates/show/date/utc/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show system date and time as Coordinated Universal Time -run: /bin/date -u diff --git a/templates/show/disk/node.def b/templates/show/disk/node.def deleted file mode 100644 index 8572a9f..0000000 --- a/templates/show/disk/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Show status of disk device diff --git a/templates/show/disk/node.tag/format/node.def b/templates/show/disk/node.tag/format/node.def deleted file mode 100644 index ad87cfc..0000000 --- a/templates/show/disk/node.tag/format/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show disk drive formatting -run: disk_dev="/dev/$3" - if [ ! -b "$disk_dev" ] - then echo "$3 is not a disk device" - exit 1 - fi - sudo /sbin/fdisk -l "$disk_dev" diff --git a/templates/show/disk/node.tag/node.def b/templates/show/disk/node.tag/node.def deleted file mode 100644 index 8690008..0000000 --- a/templates/show/disk/node.tag/node.def +++ /dev/null @@ -1,4 +0,0 @@ -help: Disk device name -allowed: awk 'NR > 2 && $4 !~ /[0-9]$/ { print $4 }' ' -run: last -aF -n $4 | sed -e "s/^wtmp begins/Displaying logins since/" -- cgit v1.2.3 From 195dc1e0ac8cebfbb84ed613993d807abbc4e338 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 14 Jun 2018 21:14:53 +0200 Subject: T683: Rewrite SNMP op mode commands in new stlye XML/Python --- templates/show/snmp/community/node.def | 1 - templates/show/snmp/community/node.tag/host/node.def | 2 -- templates/show/snmp/community/node.tag/host/node.tag/node.def | 3 --- templates/show/snmp/community/node.tag/node.def | 3 --- templates/show/snmp/mib/ifmib/ifAlias/node.def | 2 -- templates/show/snmp/mib/ifmib/ifAlias/node.tag/node.def | 2 -- templates/show/snmp/mib/ifmib/ifDescr/node.def | 2 -- templates/show/snmp/mib/ifmib/ifDescr/node.tag/node.def | 2 -- templates/show/snmp/mib/ifmib/ifIndex/node.def | 2 -- templates/show/snmp/mib/ifmib/ifIndex/node.tag/node.def | 2 -- templates/show/snmp/mib/ifmib/node.def | 2 -- templates/show/snmp/mib/node.def | 1 - templates/show/snmp/node.def | 2 -- templates/show/snmp/v3/certificates/node.def | 7 ------- templates/show/snmp/v3/group/node.def | 2 -- templates/show/snmp/v3/node.def | 2 -- templates/show/snmp/v3/trap-target/node.def | 2 -- templates/show/snmp/v3/user/node.def | 2 -- templates/show/snmp/v3/view/node.def | 2 -- 19 files changed, 43 deletions(-) delete mode 100644 templates/show/snmp/community/node.def delete mode 100644 templates/show/snmp/community/node.tag/host/node.def delete mode 100644 templates/show/snmp/community/node.tag/host/node.tag/node.def delete mode 100644 templates/show/snmp/community/node.tag/node.def delete mode 100644 templates/show/snmp/mib/ifmib/ifAlias/node.def delete mode 100644 templates/show/snmp/mib/ifmib/ifAlias/node.tag/node.def delete mode 100644 templates/show/snmp/mib/ifmib/ifDescr/node.def delete mode 100644 templates/show/snmp/mib/ifmib/ifDescr/node.tag/node.def delete mode 100644 templates/show/snmp/mib/ifmib/ifIndex/node.def delete mode 100644 templates/show/snmp/mib/ifmib/ifIndex/node.tag/node.def delete mode 100644 templates/show/snmp/mib/ifmib/node.def delete mode 100644 templates/show/snmp/mib/node.def delete mode 100644 templates/show/snmp/node.def delete mode 100644 templates/show/snmp/v3/certificates/node.def delete mode 100644 templates/show/snmp/v3/group/node.def delete mode 100644 templates/show/snmp/v3/node.def delete mode 100644 templates/show/snmp/v3/trap-target/node.def delete mode 100644 templates/show/snmp/v3/user/node.def delete mode 100644 templates/show/snmp/v3/view/node.def diff --git a/templates/show/snmp/community/node.def b/templates/show/snmp/community/node.def deleted file mode 100644 index 48e7d1d..0000000 --- a/templates/show/snmp/community/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Show status of SNMP community diff --git a/templates/show/snmp/community/node.tag/host/node.def b/templates/show/snmp/community/node.tag/host/node.def deleted file mode 100644 index ac7e559..0000000 --- a/templates/show/snmp/community/node.tag/host/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show status of SNMP on remote host - diff --git a/templates/show/snmp/community/node.tag/host/node.tag/node.def b/templates/show/snmp/community/node.tag/host/node.tag/node.def deleted file mode 100644 index b20409d..0000000 --- a/templates/show/snmp/community/node.tag/host/node.tag/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Show status of SNMP on specified host -allowed: echo -n ' ' -run: ${vyatta_bindir}/vyatta-show-snmp.pl --community $4 --host $6 diff --git a/templates/show/snmp/community/node.tag/node.def b/templates/show/snmp/community/node.tag/node.def deleted file mode 100644 index 48aa6ad..0000000 --- a/templates/show/snmp/community/node.tag/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Show status of specified SNMP community -allowed: ${vyatta_bindir}/vyatta-show-snmp.pl --allowed -run: ${vyatta_bindir}/vyatta-show-snmp.pl --community="$4" diff --git a/templates/show/snmp/mib/ifmib/ifAlias/node.def b/templates/show/snmp/mib/ifmib/ifAlias/node.def deleted file mode 100644 index 91a0aa0..0000000 --- a/templates/show/snmp/mib/ifmib/ifAlias/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP ifAlias for all interfaces -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib --ifalias diff --git a/templates/show/snmp/mib/ifmib/ifAlias/node.tag/node.def b/templates/show/snmp/mib/ifmib/ifAlias/node.tag/node.def deleted file mode 100644 index 6c5b00a..0000000 --- a/templates/show/snmp/mib/ifmib/ifAlias/node.tag/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP ifAlias for specified interface -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib --ifalias $6 diff --git a/templates/show/snmp/mib/ifmib/ifDescr/node.def b/templates/show/snmp/mib/ifmib/ifDescr/node.def deleted file mode 100644 index 6ec827d..0000000 --- a/templates/show/snmp/mib/ifmib/ifDescr/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP ifDescr for all interfaces -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib --ifdescr diff --git a/templates/show/snmp/mib/ifmib/ifDescr/node.tag/node.def b/templates/show/snmp/mib/ifmib/ifDescr/node.tag/node.def deleted file mode 100644 index 95222de..0000000 --- a/templates/show/snmp/mib/ifmib/ifDescr/node.tag/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP ifDescr for specified interface -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib --ifdescr $6 diff --git a/templates/show/snmp/mib/ifmib/ifIndex/node.def b/templates/show/snmp/mib/ifmib/ifIndex/node.def deleted file mode 100644 index 2955c1d..0000000 --- a/templates/show/snmp/mib/ifmib/ifIndex/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP ifIndex for all interfaces -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib --ifindex diff --git a/templates/show/snmp/mib/ifmib/ifIndex/node.tag/node.def b/templates/show/snmp/mib/ifmib/ifIndex/node.tag/node.def deleted file mode 100644 index f9159ac..0000000 --- a/templates/show/snmp/mib/ifmib/ifIndex/node.tag/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP ifIndex for specified interface -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib --ifindex $6 diff --git a/templates/show/snmp/mib/ifmib/node.def b/templates/show/snmp/mib/ifmib/node.def deleted file mode 100644 index fa309ff..0000000 --- a/templates/show/snmp/mib/ifmib/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show SNMP interfaces MIB information -run: ${vyatta_bindir}/vyatta-show-snmp-ifmib diff --git a/templates/show/snmp/mib/node.def b/templates/show/snmp/mib/node.def deleted file mode 100644 index de4f01b..0000000 --- a/templates/show/snmp/mib/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Show SNMP MIB information diff --git a/templates/show/snmp/node.def b/templates/show/snmp/node.def deleted file mode 100644 index 98f4366..0000000 --- a/templates/show/snmp/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show status of SNMP on localhost -run: ${vyatta_bindir}/vyatta-show-snmp.pl diff --git a/templates/show/snmp/v3/certificates/node.def b/templates/show/snmp/v3/certificates/node.def deleted file mode 100644 index e66fc0d..0000000 --- a/templates/show/snmp/v3/certificates/node.def +++ /dev/null @@ -1,7 +0,0 @@ -help: Show TSM certificates -run: files=`sudo ls /etc/snmp/tls/certs/ 2> /dev/null`; - if [ -n "$files" ]; then - sudo /usr/bin/net-snmp-cert showcerts --subject --fingerprint - else - echo "You don't have any certificates. Put it in '/etc/snmp/tls/certs/' folder." - fi diff --git a/templates/show/snmp/v3/group/node.def b/templates/show/snmp/v3/group/node.def deleted file mode 100644 index 7ff947a..0000000 --- a/templates/show/snmp/v3/group/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show the list of configured groups -run: /opt/vyatta/bin/vyatta-show-snmp-v3.pl --group \ No newline at end of file diff --git a/templates/show/snmp/v3/node.def b/templates/show/snmp/v3/node.def deleted file mode 100644 index 70c0df2..0000000 --- a/templates/show/snmp/v3/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show status of SNMP v3 on localhost -run: /opt/vyatta/bin/vyatta-show-snmp-v3.pl --all \ No newline at end of file diff --git a/templates/show/snmp/v3/trap-target/node.def b/templates/show/snmp/v3/trap-target/node.def deleted file mode 100644 index 9f0d2f1..0000000 --- a/templates/show/snmp/v3/trap-target/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show the list of configured targets -run: /opt/vyatta/bin/vyatta-show-snmp-v3.pl --trap diff --git a/templates/show/snmp/v3/user/node.def b/templates/show/snmp/v3/user/node.def deleted file mode 100644 index 621ccc8..0000000 --- a/templates/show/snmp/v3/user/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show the list of configured users -run: /opt/vyatta/bin/vyatta-show-snmp-v3.pl --user diff --git a/templates/show/snmp/v3/view/node.def b/templates/show/snmp/v3/view/node.def deleted file mode 100644 index 7e05d84..0000000 --- a/templates/show/snmp/v3/view/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show the list of configured views -run: /opt/vyatta/bin/vyatta-show-snmp-v3.pl --view \ No newline at end of file -- cgit v1.2.3 From 418c6cfefcdf13cf6b96dd628bcd1d75046f179b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 14 Jun 2018 21:17:51 +0200 Subject: T683: remove old Perl scripts for 'show snmp' --- Makefile.am | 3 - scripts/vyatta-show-snmp-ifmib | 138 --------------------------------- scripts/vyatta-show-snmp-v3.pl | 168 ----------------------------------------- scripts/vyatta-show-snmp.pl | 123 ------------------------------ 4 files changed, 432 deletions(-) delete mode 100644 scripts/vyatta-show-snmp-ifmib delete mode 100644 scripts/vyatta-show-snmp-v3.pl delete mode 100755 scripts/vyatta-show-snmp.pl diff --git a/Makefile.am b/Makefile.am index ad9c01a..0a1f89b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,9 +29,6 @@ bin_SCRIPTS += scripts/show-users.pl bin_SCRIPTS += scripts/show-dhcp-leases.pl bin_SCRIPTS += scripts/vyatta-boot-image.pl bin_SCRIPTS += scripts/vyatta-sudo -bin_SCRIPTS += scripts/vyatta-show-snmp.pl -bin_SCRIPTS += scripts/vyatta-show-snmp-ifmib -bin_SCRIPTS += scripts/vyatta-show-snmp-v3.pl bin_SCRIPTS += scripts/rename-image.pl bin_SCRIPTS += scripts/show-image-storage.pl bin_SCRIPTS += scripts/vyatta-remote-copy.pl diff --git a/scripts/vyatta-show-snmp-ifmib b/scripts/vyatta-show-snmp-ifmib deleted file mode 100644 index 8fb1004..0000000 --- a/scripts/vyatta-show-snmp-ifmib +++ /dev/null @@ -1,138 +0,0 @@ -#! /usr/bin/perl - -# **** License **** -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# This code was originally developed by Vyatta, Inc. -# Portions created by Vyatta are Copyright (C) 2007 Vyatta, Inc. -# All Rights Reserved. -# -# Author: Stephen Hemminger -# Date: Novemember 2010 -# Description: Script for show snmp ifmib -# -# **** End License **** - -use strict; -use warnings; -use Getopt::Long; -use POSIX qw(strtol); - -# This is used to show values corresponding to to results IF-MIB. -my %interfaces; - -sub show_ifindex { - foreach my $ifname (@_) { - my $info = $interfaces{$ifname}; - my $ifindex = $info->{'ifIndex'}; - printf "%s: ifIndex = %d\n", $ifname, $ifindex; - } -} - -sub show_ifalias { - foreach my $ifname (@_) { - my $info = $interfaces{$ifname}; - my $ifalias = $info->{'ifAlias'}; - printf "%s: ifAlias = %s\n", $ifname, - defined($ifalias) ? $ifalias : $ifname; - } -} - -sub read_sysfs { - my $filename = shift; - - open( my $f, '<', $filename ) - or return; # not a PCI device - - my $val = <$f>; - close $f; - - return strtol($val); -} - -# Imitate code in net-snmp to lookup PC -# TODO - move to common code extension (and handle USB?) -sub pci_info { - my $ifname = shift; - my $vendor_id = read_sysfs("/sys/class/net/$ifname/device/vendor"); - my $device_id = read_sysfs("/sys/class/net/$ifname/device/device"); - - return unless ( defined($vendor_id) && defined($device_id) ); - - my $cmd = sprintf("lspci -m -d %04x:%04x", $vendor_id, $device_id); - open( my $pci, '-|', $cmd ) - or die "Can't run $cmd"; - my $info = <$pci>; - close $pci; - - return unless $info; - - # extract vendor and device description from output - $info =~ /^\S+ "[^"]*" "([^"]*)" "([^"]*)"/; - - return "$1 $2"; -} - -sub show_ifdescr { - foreach my $ifname (@_) { - my $ifdescr = pci_info($ifname); - - printf "%s: ifDescr = %s\n", $ifname, - defined($ifdescr) ? $ifdescr : $ifname; - } -} - -sub show_all { - foreach my $ifname (@_) { - my $info = $interfaces{$ifname}; - my $ifindex = $info->{'ifIndex'}; - my $ifalias = $info->{'ifAlias'}; - my $ifdescr = pci_info($ifname); - - printf "%s: ifIndex = %d\n", $ifname, $ifindex; - - my $pad = sprintf( "%-*s", length($ifname) + 1, " " ); - printf "%s ifAlias = %s\n", $pad, $ifalias if ($ifalias); - printf "%s ifDescr = %s\n", $pad, $ifdescr if ($ifdescr); - } -} - -my $show = \&show_all; - -GetOptions( - "ifindex" => sub { $show = \&show_ifindex }, - "ifalias" => sub { $show = \&show_ifalias }, - "ifdescr" => sub { $show = \&show_ifdescr }, -) or die "Unknown option\n"; - -# List of all interfaces that currently exist on system -# includes interfaces that may be outside Vyatta CLI because -# they still show up in SNMP -open( my $ip, '-|', 'ip li' ) - or die "Can't run ip command\n"; - -my $ifname; -while (<$ip>) { - if (/^(\d+): ([^:]*): /) { - $ifname = $2; - $interfaces{$ifname} = { 'ifIndex' => $1 }; - } - elsif (/^ +alias (.*)$/) { - $interfaces{$ifname}->{'ifAlias'} = $1; - } -} -close $ip; - -if (@ARGV) { - $show->(@ARGV); -} -else { - $show->( sort keys %interfaces ); -} diff --git a/scripts/vyatta-show-snmp-v3.pl b/scripts/vyatta-show-snmp-v3.pl deleted file mode 100644 index dc81623..0000000 --- a/scripts/vyatta-show-snmp-v3.pl +++ /dev/null @@ -1,168 +0,0 @@ -#! /usr/bin/perl - -use Getopt::Long; - -sub show_view() { - print <= 20 ) { - print "$group\n $view($mode)\n"; - } - else { - $~ = "GROUP_FORMAT"; - format GROUP_FORMAT = -@<<<<<<<<<<<<<<<<<< @*(@*) -$group $view $mode -. - write; - } - } - print "\n"; -} - -sub show_user() { - print <= 20 ) { - print "$user\n $auth $priv $mode $group\n"; - } - else { - $~ = "USER_FORMAT"; - format USER_FORMAT = -@<<<<<<<<<<<<<<<<<< @<<< @<<< @<<< @* -$user $auth $priv $mode $group -. - write; - } - } - print "\n"; -} - -sub show_trap() { - print <= 30 ) { - $~ = "TRAP_BIG_FORMAT"; - format TRAP_BIG_FORMAT = -^* -$trap - @<<<<< @<<<<<<< @<<< @<<< @<<<<< @<<<<<<<<<<<<<<<<<<<<... @* -$port $protocol $auth $priv $type $engineid $user -. - write; - } - else { - $~ = "TRAP_FORMAT"; - format TRAP_FORMAT = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<< @<<<<<<< @<<< @<<< @<<<<< @<<<<<<<<<<<<<<<<<<<<... @* -$trap $port $protocol $auth $priv $type $engineid $user -. - write; - } - } - print "\n"; -} - -sub show_all() { - show_user(); - show_group(); - show_view(); - show_trap(); -} - -sub listNodes { - my $path = shift; - my @nodes = - split( ' ', `cli-shell-api listActiveNodes service snmp v3 $path` ); - return map { substr $_, 1, -1 } @nodes; -} - -sub returnValue { - my $path = shift; - my $value = `cli-shell-api returnActiveValue service snmp v3 $path`; - return $value; -} - -sub isExists { - my $path = shift; - system("cli-shell-api existsActive service snmp v3 $path"); - return !$?; -} - -my $all; -my $view; -my $group; -my $user; -my $trap; - -GetOptions( - "all!" => \$all, - "view!" => \$view, - "group!" => \$group, - "user!" => \$user, - "trap!" => \$trap, -); - -show_all() if ($all); -show_view() if ($view); -show_group() if ($group); -show_user() if ($user); -show_trap() if ($trap); diff --git a/scripts/vyatta-show-snmp.pl b/scripts/vyatta-show-snmp.pl deleted file mode 100755 index 634b3cc..0000000 --- a/scripts/vyatta-show-snmp.pl +++ /dev/null @@ -1,123 +0,0 @@ -#! /usr/bin/perl - -# **** License **** -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# This code was originally developed by Vyatta, Inc. -# Portions created by Vyatta are Copyright (C) 2007 Vyatta, Inc. -# All Rights Reserved. -# -# Author: Stephen Hemminger -# Date: January 2010 -# Description: Script to display SNMP information -# -# **** End License **** -# -use strict; -use warnings; -use Getopt::Long; -use NetAddr::IP; - -my $SNMPDCFG = '/etc/snmp/snmpd.conf'; -my $SNMPSTATUS = '/usr/bin/snmpstatus'; -my $password_file = '/config/snmp/superuser_pass'; - -# generate list of communities in configuration file -sub read_config { - my %community; - - die "Service SNMP does not configured.\n" if (! -e $SNMPDCFG); - - open( my $cfg, '<', $SNMPDCFG ) - or die "Can't open $SNMPDCFG : $!\n"; - - while (<$cfg>) { - chomp; - s/#.*$//; - my @cols = split; - next - unless ( $#cols > 0 - && ( $cols[0] eq 'rocommunity' || $cols[0] eq 'rwcommunity' ) ); - - my $addr = ( $#cols > 1 ) ? $cols[2] : "0.0.0.0/0"; - $community{ $cols[1] } = NetAddr::IP->new($addr); - } - close $cfg; - - return \%community; -} - -# expand list of available communities for allowed: tag -sub show_all { - my $community = read_config(); - - print join( ' ', keys( %{$community} ) ), "\n"; - exit 0; -} - -# check status of any accessible community on localhost -sub status_any { - my $cref = read_config(); - my %community = %{$cref}; - my $localhost = new NetAddr::IP('localhost'); - - if (scalar(%community)) { - foreach my $c ( keys %community ) { - my $addr = $community{$c}; - status( $c, $localhost->addr() ) if ( $addr->contains($localhost) ); - } - } - status_v3(); - -} - -sub status_v3 { - open (my $file, '<' , $password_file) or die "Couldn't open $password_file - $!"; - my $superuser_pass = do { local $/; <$file> }; - close $file; - open ($file, '<', $SNMPDCFG) or die "Couldn't open $SNMPDCFG - $!"; - my $superuser_login = ''; - while (my $line = <$file>) { - if ($line =~ /^iquerySecName (.*)$/) { - $superuser_login = $1; - } - } - close $file; - exec $SNMPSTATUS, '-v3', '-l', 'authNoPriv', '-u', $superuser_login, '-A', $superuser_pass, 'localhost'; -} - -# check status of one community -sub status { - my ( $community, $host ) = @_; - $host = 'localhost' unless defined($host); - - print "Status of SNMP community $community on $host\n"; - exec $SNMPSTATUS, '-v1', '-c', $community, $host; - die "Can't exec $SNMPSTATUS : $!"; -} - -sub usage { - print "usage: $0 [--community=name [--host=hostname]]\n"; - print " $0 --allowed\n"; - exit 1; -} - -my ( $host, $community, $allowed ); - -GetOptions( - "host=s" => \$host, - "community=s" => \$community, - "allowed" => \$allowed, -) or usage(); - -show_all() if ($allowed); -status( $community, $host ) if ( defined($community) ); -status_any(); - -- cgit v1.2.3 From add153b13de56f97624b2dc433fdbe21b36dbeed Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 14 Jun 2018 21:34:32 +0200 Subject: T697: dependency clean up. Moving pciutils, usbutils, lsscsi, bmon, hvinfo to vyos-1x Moving iftop and lsof to the utils package list in vyos-build --- debian/control | 8 -------- 1 file changed, 8 deletions(-) diff --git a/debian/control b/debian/control index bd17cf4..4bff070 100644 --- a/debian/control +++ b/debian/control @@ -10,17 +10,13 @@ Package: vyatta-op Architecture: all Depends: sed (>= 4.1.5), console-terminus, - bmon, - iftop, ethtool, traceroute, ntpdate, procps (>= 1:3.2.7-3), - pciutils, vyatta-cfg (>= 0.16.26), vyatta-cfg-system (>= 0.19.93), vyatta-quagga (>= 0.99.15-26), - lsof, coreutils (>= 5.97-5.3), host, vyatta-bash | bash (>= 4.1), @@ -30,10 +26,6 @@ Depends: sed (>= 4.1.5), at, net-tools, libtimedate-perl, - usbutils, - lsscsi, - hvinfo, - python3-pystache Suggests: util-linux (>= 2.13-5), ncurses-bin (>= 5.5-5), dialog -- cgit v1.2.3