Juniper / open-nti

Open Network Telemetry Collector build with open source tools
Apache License 2.0
232 stars 93 forks source link

RPM Probes and data collection via SSH / netconf #232

Closed bodleytunes closed 6 years ago

bodleytunes commented 6 years ago

Hi

Seems to be failing to scrape any data from the vMX router regarding RPM probes.

Can see messages in the logs that opennti is connecting on port 22 then nothing is happening, as a result the python script is seeing no returned data from the initial "show version"

Aug  2 09:57:02   inetd[7754]: /usr/sbin/sshd[84038]: exited, status 255
Aug  2 09:57:02   sshd[84039]: Accepted password for jon from 10.55.89.10 port 42306 ssh2
Aug  2 09:58:02   sshd[84403]: Did not receive identification string from 10.55.89.10
root@opennti-vm:/home/jon/open-nti# make cron-debug
docker exec -i -t opennti_con /usr/bin/python /opt/open-nti/open-nti.py -s -c
Importing credentials file: /opt/open-nti/data/credentials.yaml 
Importing host file: /opt/open-nti/data/hosts.yaml 
Importing commands file: /opt/open-nti/data/commands.yaml 
Importing junos parsers file: ['show-route-summary.parser.yaml', 'file-list-detail-var-rundb-juniper.eph_iceaaa.parser.yaml', 'show-firewall.parser.yaml', 'show-task-memory.parser.yaml', 'show-services-l2tp-summary.parser.yaml', 'show-bgp-summary.parser.yaml', 'show-route-summary.table.bgp.l3vpn.0.parser.yaml', 'show-pfe-statistics-traffic.parser.yaml', 'show-chassis-routing-engine.parser.yaml', 'show-network-access-aaa-radius-servers-detail.parser.yaml', 'show-mpls-lsp.parser.yaml', 'show-route-summary.table.inet.0.parser.yaml', 'show-route-summary.table.l2circuit.0.parser.yaml', 'show-isis-statistics.parser.yaml', 'show-services-stateful-firewall-flow-analysis.parser.yaml', 'show-snmp-get-jnxOperatingCPU-RE.yaml', 'show-krt-state.parser.yaml', 'show-chassis-fpc.parser.yaml', 'show-subscribers-summary.parser.yaml', 'show-system-configuration-database-usage.parser.yaml', 'show-snmp-statistics.parser.yaml', 'show-interfaces-media.parser.yaml', 'show-route-summary.table.inet.3.parser.yaml', 'show-ldp-traffic-statistics.parser.yaml', 'show-services-rpm-probe-results.parser.yaml', 'show-snmp-get-jnxOperatingCPU-FPC.yaml', 'show-system-buffers.parser.yaml', 'show-system-core-dumps.parser.yaml', 'show-task-io.parser.yaml', 'show-pppoe-statistics.parser.yaml', 'show-version.parser.yaml', 'show-system-storage.parser.yaml', 'show-services-nat-pool-detail.parser.yaml', 'show-security-ipsec-statistics.parser.yaml', 'show-system-virtual-memory.parser.yaml', 'show-lwaftr-statistics.parser.yaml', 'show-services-stateful-firewall-subscriber-analysis.parser.yaml', 'show-route-summary.table.inet6.0.parser.yaml', 'show-system-resource-monitor-summary.parser.yaml', 'show-bfd-session-summary.parser.yaml', 'show-subscribers-summary-port.parser.yaml', 'show-policer-default-arp-policer.parser.yaml', 'show-l2-learning-global-mac-count.parser.yaml', 'show-services-video-monitoring-mdi-flow-fpc-slot-1.parser.yaml', 'show-system-statistics-icmp.parser.yaml', 'show-task-accounting.parser.yaml', 'show-lwaftr-state.parser.yaml', 'show-ddos-protection-protocols-statistics-terse.parser.yaml', 'show-system-processes-extensive.parser.yaml', 'show-bgp-neighbor-10.255.0.206.parser.yaml', 'show-igmp-snooping-statistics.parser.yaml', 'show-network-access-aaa-statistics-address-assignment-pool.parser.yaml', 'rtsockmon.parser.yaml'] 
Importing pfe parsers file: ['.gitignore'] 
Getting hosts that matches the specified tags
The following hosts are being selected:  ['10.100.103.100']
Collector Thread-1 scheduled with following hosts: ['10.100.103.100']
Connecting to host: 10.100.103.100
[10.100.103.100]: Executing command: show version | display xml
[10.100.103.100]: Parsing command: show version | display xml
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/open-nti/open-nti.py", line 573, in collector
    hostname_tmp = xml_data.xpath(hostname_xpth)[0].text.strip()
AttributeError: 'NoneType' object has no attribute 'strip'

image

Any ideas why its not seemingly logging in and running the commands properly?

Cheers! Jon.

psagrera commented 6 years ago

What platform and junos versin are you using in your setup ?

Could you please paste here the output of show version | display xml ?

Regards

Pablo

bodleytunes commented 6 years ago

vMX 18.2 Trial Version will paste show version tomorrow

On Thu, 2 Aug 2018 at 16:48 psagrera notifications@github.com wrote:

What platform and junos versin are you using in your setup ?

Could you please paste here the output of show version | display xml ?

Regards

Pablo

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Juniper/open-nti/issues/232#issuecomment-409973851, or mute the thread https://github.com/notifications/unsubscribe-auth/AAly5y2AuBC2Ogje-EOBHh5KQQye-UbRks5uMx9ngaJpZM4VsBtx .

bodleytunes commented 6 years ago

Here is show version:

FreeBSD/amd64 (Amnesiac) (ttyu0)

login: root
Password:
Last login: Wed Aug  1 18:11:58 from 10.55.89.10

--- JUNOS 18.2R1.9 Kernel 64-bit  JNPR-11.0-20180614.6c3f819_buil
At least one package installed on this device has limited support.
Run 'file show /etc/notices/unsupported.txt' for details.
root@:~ # cli
{master}
root> show version | display xml 
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/18.2R1/junos">
    <software-information>
        <host-name></host-name>
        <product-model>vmx</product-model>
        <product-name>vmx</product-name>
        <junos-version>18.2R1.9</junos-version>
        <package-information>
            <name>os-kernel</name>
            <comment>JUNOS OS Kernel 64-bit  [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>os-libs</name>
            <comment>JUNOS OS libs [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>os-runtime</name>
            <comment>JUNOS OS runtime [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>zoneinfo</name>
            <comment>JUNOS OS time zone information [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>netstack</name>
            <comment>JUNOS network stack and utilities [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-libs</name>
            <comment>JUNOS libs [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>os-libs-compat32</name>
            <comment>JUNOS OS libs compat32 [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>os-compat32</name>
            <comment>JUNOS OS 32-bit compatibility [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>junos-libs-compat32</name>
            <comment>JUNOS libs compat32 [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-runtime</name>
            <comment>JUNOS runtime [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>vmguest</name>
            <comment>JUNOS Packet Forwarding Engine Simulation Package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>sflow-platform</name>
            <comment>JUNOS sflow mx [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>py-extensions</name>
            <comment>JUNOS py extensions [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>          
        <package-information>
            <name>py-base</name>
            <comment>JUNOS py base [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>os-vmguest</name>
            <comment>JUNOS OS vmguest [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>os-crypto</name>
            <comment>JUNOS OS crypto [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
        <package-information>
            <name>na-telemetry</name>
            <comment>JUNOS na telemetry [18.2R1.9-C1]</comment>
        </package-information>
        <package-information>
            <name>junos-libs-compat32-platform</name>
            <comment>JUNOS mx libs compat32 [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-runtime-platform</name>
            <comment>JUNOS mx runtime [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-platform</name>
            <comment>JUNOS common platform support [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-openconfig</name>
            <comment>JUNOS Openconfig [0.0.0.10]</comment>
        </package-information>
        <package-information>
            <name>junos-net-platform</name>
            <comment>JUNOS mtx network modules [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-modules</name>  
            <comment>JUNOS modules [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-modules-platform</name>
            <comment>JUNOS mx modules [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-libs-platform</name>
            <comment>JUNOS mx libs [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-dp-crypto-support-platform</name>
            <comment>JUNOS mtx Data Plane Crypto Support [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>junos-daemons</name>
            <comment>JUNOS daemons [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>          
        <package-information>
            <name>junos-daemons-platform</name>
            <comment>JUNOS mx daemons [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jsim-wrlinux</name>
            <comment>JUNOS Simulation Linux Package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jsim-pfe-vmx</name>
            <comment>JUNOS Simulation Package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-urlf</name>
            <comment>JUNOS Services URL Filter package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-traffic-dird</name>
            <comment>JUNOS Services TLB Service PIC package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-telemetry</name>
            <comment>JUNOS Services Telemetry [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-ssl</name>
            <comment>JUNOS Services SSL [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-softwire</name>
            <comment>JUNOS Services SOFTWIRE [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-sfw</name>
            <comment>JUNOS Services Stateful Firewall [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>           
            <name>jservices-rpm</name>
            <comment>JUNOS Services RPM [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-pcef</name>
            <comment>JUNOS Services PCEF package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-nat</name>
            <comment>JUNOS Services NAT [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-mss</name>
            <comment>JUNOS Services Mobile Subscriber Service Container package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-mobile</name>
            <comment>JUNOS Services MobileNext Software package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-lrf</name>
            <comment>JUNOS Services Logging Report Framework package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-llpdf</name>
            <comment>JUNOS Services LL-PDF Container package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-jflow</name>
            <comment>JUNOS Services Jflow Container package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-jdpi</name>
            <comment>JUNOS Services Deep Packet Inspection package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>           
            <name>jservices-ipsec</name>
            <comment>JUNOS Services IPSec [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-ids</name>
            <comment>JUNOS Services IDS [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-idp</name>
            <comment>JUNOS IDP Services [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-hcm</name>
            <comment>JUNOS Services HTTP Content Management package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-fwdd</name>
            <comment>JUNOS Services Flowd MS-MPC Software package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-crypto-base</name>
            <comment>JUNOS Services Crypto [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-cpcd</name>
            <comment>JUNOS Services Captive Portal and Content Delivery Container package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-cos</name>
            <comment>JUNOS Services COS [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-appid</name>
            <comment>JUNOS AppId Services [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>           
            <name>jservices-alg</name>
            <comment>JUNOS Services Application Level Gateways [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jservices-aacl</name>
            <comment>JUNOS Services AACL Container package [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jsd-jet-1</name>
            <comment>JUNOS Extension Toolkit [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jinsight</name>
            <comment>JUNOS J-Insight [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jdocs</name>
            <comment>JUNOS Online Documentation [20180628.003405_builder_junos_182_r1]</comment>
        </package-information>
        <package-information>
            <name>jail-runtime</name>
            <comment>JUNOS jail runtime [20180614.6c3f819_builder_stable_11]</comment>
        </package-information>
    </software-information>
    <cli>
        <banner>{master}</banner>
    </cli>
</rpc-reply>

{master}
root> 
3fr61n commented 6 years ago

Hi, Just to test... could you please add a hostname to the vmx? regards

bodleytunes commented 6 years ago

working now but I've rebuilt everything so not sure what the fix was. :(

Could very well been the lack of hostname.

3fr61n commented 6 years ago

The strip function with ‘null’ string

Sent from my iPhone

On 3 Aug 2018, at 11:02, Jon Clayton notifications@github.com wrote:

working now but I've rebuilt everything so not sure what the fix was. :(

Could very well been the lack of hostname.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bodleytunes commented 6 years ago

So fix was to add a hostname to router, otherwise throws exception if there is not one, makes perfect sense!