Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default class Juniper {
- constructor() {
- this.nodeSSH = require("node-ssh-exec");
- this.con = {
- host: "170.231.56.7",
- username: "zabbix",
- password: "Zabbix@um23"
- };
- this.l = "show subscribers vlan-id 168 | match pp";
- this.l2 = "show subscribers vlan-id 3000 | match pp";
- }
- getVlan() {
- this.nodeSSH(this.con, this.l, function(error, response) {
- if (error) {
- throw error;
- }
- console.log('start');
- var linesCount = response.split(/rn|r|n/).length;
- console.log(linesCount);
- return linesCount - 1;
- });
- }
- }
- import Juniper from "../../service/Juniper";
- export default {
- components: {
- StatsCard,
- ChartCard,
- AnimatedNumber,
- ProductCard,
- GlobalSalesCard,
- GlobalSalesTable,
- AsyncWorldMap
- },
- data () {
- return {
- resource: Juniper,
- jum: 0
- }
- },
- methods: {
- initialize () {
- this.jum = this.resource.getVlan();
- }
- },
- created () {
- this.initialize()
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement