Community discussions

MikroTik App
 
spynappels
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Mon Oct 25, 2021 12:32 pm
Location: Northern Ireland
Contact:

Issue using "get" command

Mon Dec 06, 2021 12:48 pm

I did a search for this but wasn't able to see anyone else have the same problem, so I'm probably doing something stupid.

If I print out the /system/resources I get a whole bunch of data.
However, if I try to get any of these individual bits of data I get no results:
[spynappels@Office Router] > system/resource/print
                   uptime: 1d23h55m46s
                  version: 7.1 (testing)
               build-time: Dec/01/2021 14:07:27
         factory-software: 6.44.6
              free-memory: 22.4MiB
             total-memory: 64.0MiB
                      cpu: MIPS 24Kc V7.4
                cpu-count: 1
            cpu-frequency: 850MHz
                 cpu-load: 2%
           free-hdd-space: 3848.0KiB
          total-hdd-space: 16.0MiB
  write-sect-since-reboot: 3584
         write-sect-total: 130233
               bad-blocks: 0%
        architecture-name: mipsbe
               board-name: hEX lite
                 platform: MikroTik
[spynappels@Office Router] > system/resource/get cpu-load
[spynappels@Office Router] >
I was under the impression that a get should work, I would like to use the specific cpu-load value in a script, but it seems to not work for me.
I have the same issue on a mmips hEX (RB750Gr3) also running 7.1(testing), so it's not just happening on a single device.

Any ideas?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Issue using "get" command  [SOLVED]

Mon Dec 06, 2021 12:51 pm

Get is just getting value from the variable, thats it. You have to output the result if you want to see it
:put [system/resource/get cpu-load]
 
spynappels
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Mon Oct 25, 2021 12:32 pm
Location: Northern Ireland
Contact:

Re: Issue using "get" command

Mon Dec 06, 2021 12:52 pm

Maybe I'm misunderstanding the usage of this "get" command, as it works in conjunction with a :put
[spynappels@Office Router] > :put [ /system/resource/get cpu-load ]
2
[spynappels@Office Router] >
EDIT: Thanks for the confirmation!
 
canitan
just joined
Posts: 2
Joined: Tue Oct 11, 2011 5:53 pm

Re: Issue using "get" command

Thu Jan 27, 2022 7:19 pm

I'm unable to get anything from \system\health anymore on 7.1.1 netPower 16P
[xxxx@mikrotik - netPower16] > :put [ /system/health/get psu1-voltage ]
syntax error (line 1 column 27)
[xxxx@mikrotik - netPower16] > /system/health/print
Columns: NAME, VALUE, TYPE
#  NAME                 VALUE  TYPE
0  poe-out-consumption  17.4   W   
1  cpu-temperature      42     C   
2  psu1-voltage         27.5   V   
3  psu2-voltage         48.1   V   
4  psu1-current         0.5    A   
5  psu2-current         0      A   
[xxxx@mikrotik - netPower16] > /system/health/get cpu-temperature
syntax error (line 1 column 20)

Who is online

Users browsing this forum: No registered users and 18 guests