T
T
ThDonatello2017-04-24 15:38:27
Notifications
ThDonatello, 2017-04-24 15:38:27

How to track mobile phone balance in Zabbix?

There is a perl script to query the mobile phone balance:
#script operator --phone=number --password=pwd
Gives a simple number - the balance on the account.
I have several phones, the balance of which I want to track automatically in zabbix.
I ran into a problem that MTS allows you to request a balance of 2 numbers per minute in this way, after which it issues a captcha.
I decided to make a crutch and ask:

script operator --phone=number --password=pwd >> "$CACHE_FILE"
sleep 30
script operator --phone=number2 --password=pwd2 >> "$CACHE_FILE"

I'm not good at writing, I'm just learning.
Naturally, the script is very inconvenient, and not usable.
Tell me how it is appropriate to write a certain script that will run once every half a minute
script operator --phone=number --password=pwd
should take data from a certain configuration file and substitute it in each new pass, and add the answers to CACHE_FILE in the form
number	balans
number2	balans2
number3	balans3

After that, I plan to teach zabbix to grep this file by the required number field and enter the data to myself.
If you directly fasten the first script to zabbix, then due to a problem with captcha, it falls out to unsupported after the first two numbers.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question