cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1253
Views
0
Helpful
4
Replies

Current active SIM to syslog server

sprocket10
Level 2
Level 2

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.

 

1 Accepted Solution

Accepted Solutions

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"

 

View solution in original post

4 Replies 4

Dan Frey
Cisco Employee
Cisco Employee

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?

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.

 

 

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"

 

many thanks, tested with watchdog time of 60 and sends exactly what I need to syslog

Review Cisco Networking for a $25 gift card