Advertisement
Guest User

Untitled

a guest
Feb 26th, 2019
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. export default class Juniper {
  2. constructor() {
  3. this.nodeSSH = require("node-ssh-exec");
  4. this.con = {
  5. host: "170.231.56.7",
  6. username: "zabbix",
  7. password: "Zabbix@um23"
  8. };
  9. this.l = "show subscribers vlan-id 168 | match pp";
  10. this.l2 = "show subscribers vlan-id 3000 | match pp";
  11. }
  12.  
  13. getVlan() {
  14. this.nodeSSH(this.con, this.l, function(error, response) {
  15. if (error) {
  16. throw error;
  17. }
  18. console.log('start');
  19. var linesCount = response.split(/rn|r|n/).length;
  20. console.log(linesCount);
  21. return linesCount - 1;
  22. });
  23. }
  24. }
  25.  
  26. import Juniper from "../../service/Juniper";
  27. export default {
  28. components: {
  29. StatsCard,
  30. ChartCard,
  31. AnimatedNumber,
  32. ProductCard,
  33. GlobalSalesCard,
  34. GlobalSalesTable,
  35. AsyncWorldMap
  36. },
  37. data () {
  38. return {
  39. resource: Juniper,
  40. jum: 0
  41. }
  42. },
  43. methods: {
  44. initialize () {
  45. this.jum = this.resource.getVlan();
  46. }
  47. },
  48. created () {
  49. this.initialize()
  50. }
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement