02-23-2015 05:12 AM
I am after a script that will log our 4G routers current active SIM twice a day to our syslog server.
Each SIM has a monthly allowance, and if a router exceeds its allowance we would be able to check the syslog server to find out which SIM card the router has been using to see which one may need swapped over. It would also help us see which router is connected to each network provider.
Solved! Go to Solution.
02-23-2015 08:16 AM
This should do what you want.
event manager applet SIMSTATUS
event timer watchdog time 43200
action 010 cli command "enable"
action 020 cli command "show cell 0 profile"
action 030 regexp "(Configured .*)" "$_cli_result" match line
action 040 syslog msg "$line"
02-23-2015 07:53 AM
What show command do you run manually to see the current active SIM? Can you paste the output of this command into your post as well?
02-23-2015 08:00 AM
The below command is what I usually check. The last part "Configured default profile for active SIM 1 is profile 2." is probably the most useful line as it tells the active sim and profile used.
Cisco4G011#sh cellular 0 profile
Profile 1 = INACTIVE
--------
PDP Type = IPv4
Access Point Name (APN) =
Authentication =
Username:
Password:
Profile 2 = ACTIVE* **
--------
PDP Type = IPv4
PDP address =
Access Point Name (APN) =
Authentication =
Username:
Password:
Primary DNS address =
Secondary DNS address =
* - Default profile
** - LTE attach profile
Configured default profile for active SIM 1 is profile 2.
02-23-2015 08:16 AM
This should do what you want.
event manager applet SIMSTATUS
event timer watchdog time 43200
action 010 cli command "enable"
action 020 cli command "show cell 0 profile"
action 030 regexp "(Configured .*)" "$_cli_result" match line
action 040 syslog msg "$line"
02-23-2015 08:29 AM
many thanks, tested with watchdog time of 60 and sends exactly what I need to syslog
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide