TIPS Asterisk CLI Date & Time in logs

jades

Guru
Joined
Oct 6, 2008
Messages
160
Reaction score
0
Hi, how can I show/hide the date & time that comes up when you enter the asterisk CLI? I know by default there is no date and time displayed as the logs pile up.

Thanks
 

MyKroFt

Guru
Joined
Oct 31, 2008
Messages
659
Reaction score
3
not sure about the CLI, but /var/log/asterisk/full has more detail and mine has the date/time on the front of the lines - added by I think the fail2ban install.....
 

Boolah

Guru
Joined
Nov 16, 2007
Messages
331
Reaction score
20
Don't know if you can have timestamps come up on each line in the CLI (like the log file), but you can change your CLI prompt to include the date/time.

Create the new file /etc/profile.d/asterisk.sh with the following content:

Code:
ASTERISK_PROMPT='[%d %t]%H*> '

export ASTERISK_PROMPT
Log out of your box and log back in. Start asterisk and the CLI prompt should now look similar to this:

[2010-08-09 09:44:15]pbx*>

There are a few other variables you can use to customize the CLI prompt. See this link for more info.
 

shragel

New Member
Joined
Jan 25, 2017
Messages
14
Reaction score
1
Use the -T command to start the CLI.

asterisk -rvvvv -T
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top