simple_host_monitoring 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 208290e2a7552e33399ae15df647fb42baaee7e1
4
- data.tar.gz: 58bb829d86ab5b7c09bb7992202a859d22daf76c
3
+ metadata.gz: 6732bd4a85e1fc9b1355a78ad2f54a2d5dc69753
4
+ data.tar.gz: e991f9b532f4c11aab7961689064093ec7394549
5
5
  SHA512:
6
- metadata.gz: 3e3be50c5a590f35e722bd7e5aa681a78121212f06269557b668604bdf323a8ae8f961c5871b099a9a4cd9f3b789056c1e874d8a4aa3c3c81d9ffdb74bba6753
7
- data.tar.gz: 7cc6367387aa040f3a28ad36e21e099b7e6d90c54f0f6eeda2276024f92829d91885021d93c4642fe2c99917ddd053c6d245bc595f2caaeab75018f9d40b1a8b
6
+ metadata.gz: 49e1c27c5e45549d696877f6f5fbde2251a77e6590a7de86f8b00c128d633c92719153d48eeb684fae019b784cf1d7fd99a5bafc793e9467c94521ecf697249b
7
+ data.tar.gz: 6d77c1ff1563f7a1566ac527ed1f110755dcd88fa6384fa9cf3d8a251a6a9e2ee3e93209becdd6269ef4d37b40a9485ca77dacf6851876496b9c1b69a62a9a5b
@@ -32,7 +32,7 @@ logger = BlackStack::LocalLoggerFactory.create('./example01.log')
32
32
 
33
33
  #
34
34
  while (true)
35
- url = "https://euler.connectionsphere.com/api1.4/shm/update.json"
35
+ url = "https://euler.connectionsphere.com/api1.3/hostsmonitoring/update.json"
36
36
  api_key = '290582D4-D00C-4D37-82AF-23043B242647'
37
37
 
38
38
  logger.logs "Flag start time... "
data/lib/basehost.rb CHANGED
@@ -8,6 +8,12 @@ module BlackStack
8
8
 
9
9
  module BaseHost
10
10
 
11
+ # ping Akamai to get my public ip address
12
+ # Reference: https://stackoverflow.com/questions/13270042/get-public-remote-ip-address
13
+ def remoteIp
14
+ open('http://whatismyip.akamai.com').read
15
+ end
16
+
11
17
  # Map the status of this host to the attributes of the class
12
18
  # Returns the hash descriptor of the object
13
19
  def poll()
@@ -25,9 +31,6 @@ module BlackStack
25
31
  mb_total_disk = stat.block_size * stat.blocks / 1024 / 1024
26
32
  mb_free_disk = stat.block_size * stat.blocks_available / 1024 / 1024
27
33
 
28
- # getting public Internet IP
29
- #remote_ip = remoteIp()
30
-
31
34
  # getting server name
32
35
  hostname = Socket.gethostname
33
36
 
@@ -59,7 +62,7 @@ module BlackStack
59
62
 
60
63
  # mapping lan attributes
61
64
  self.net_hostname = hostname
62
- #self.net_remote_ip = remote_ip.to_s
65
+ self.net_remote_ip = remoteIp
63
66
  self.net_mac_address = BlackStack::SimpleHostMonitoring.macaddress
64
67
 
65
68
  self.to_hash
@@ -80,7 +83,7 @@ module BlackStack
80
83
  :disk_total => self.disk_total,
81
84
  :disk_free => self.disk_free,
82
85
  :net_hostname => self.net_hostname,
83
- #:net_remote_ip => self.net_remote_ip,
86
+ :net_remote_ip => self.net_remote_ip,
84
87
  :net_mac_address => self.net_mac_address
85
88
  }
86
89
  end
data/lib/localhost.rb CHANGED
@@ -21,7 +21,7 @@ module BlackStack
21
21
  self.disk_total = h[:disk_total]
22
22
  self.disk_free = h[:disk_free]
23
23
  self.net_hostname = h[:net_hostname]
24
- #self.net_remote_ip = h[:net_remote_ip]
24
+ self.net_remote_ip = h[:net_remote_ip]
25
25
  self.net_mac_address = h[:net_mac_address]
26
26
  end
27
27
 
@@ -22,25 +22,6 @@ module BlackStack
22
22
  # if the file does not exists, it will ask the API for a GUID and create the file
23
23
  HOST_ID_FILENAME = './host_id.data'
24
24
 
25
- =begin # derepcated
26
- @@host_id = nil
27
- def self.reset_host_id
28
- @@host_id = BlackStack::Pampa::get_guid
29
- File.open(HOST_ID_FILENAME, 'w') {|f| f.write(@@host_id) }
30
- @@host_id
31
- end
32
- def self.host_id
33
- if @@host_id.nil?
34
- if File.file?(HOST_ID_FILENAME)
35
- @@host_id = File.read(HOST_ID_FILENAME)
36
- else
37
- @@host_id = self.reset_host_id
38
- end
39
- end # !@@host_id.nil?
40
- @@host_id = self.reset_host_id if !@@host_id.guid?
41
- @@host_id
42
- end
43
- =end
44
25
  # This function works in windows only
45
26
  # TODO: Esta funcion no retorna la mac address completa
46
27
  # TODO: Validar que no se retorne una macaddress virtual, con todos valores en 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_host_monitoring
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-01 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket