# script to find difference between scf file

**URL:** <https://community.f5.com/t/script-to-find-difference-between-scf-file/54448>\
**Category:** Technical Forums\
**Tags:** bash, devops, ltm, script\
**Created:** [September 17, 2019, 4:59pm UTC](https://community.f5.com/t/script-to-find-difference-between-scf-file/54448 "2019-09-17T16:59:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anson](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anson](https://community.f5.com/u/anson)\
**Post date:** [September 17, 2019, 4:59pm UTC](https://community.f5.com/t/script-to-find-difference-between-scf-file/54448/1 "2019-09-17T16:59:02Z")

</div>

Hi,

Is there a option in f5 to trigger an alert based on scf difference . We recently had an issue with our f5 and the suggestion was to post a query with devcentral to track difference in scf file .

Statement from the support team

“You should be able to generate an SCF with a known good configuration and compare it with one generated whenever changes are made. If you see that changes aren’t being reflected in the new SCF, that would indicate that mcpd hasn’t been updated with the new configuration. This would be a sign that you should contact support:”

Below is the pseudo code that f5 had suggested.

Setup:

Generate starting SCF

Create custom SNMP trap to alert on script alert log, possibly send an email or whatever alerting function you wish to use.

Script Functions:

On Cron - Generate SCF

Diff against starting SCF

If Diff output is empty

Delete the new SCF

Else

Use Logger to record alert log

Handle the new file as desired

---

<div class="post-metadata">

**Author:** ![Dario\_Garrido](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@Dario\_Garrido](https://community.f5.com/u/Dario_Garrido)\
**Post date:** [September 17, 2019, 10:01pm UTC](https://community.f5.com/t/script-to-find-difference-between-scf-file/54448/2 "2019-09-17T22:01:05Z")

</div>

Hello Anson.

Actually, I usually use something like this during upgrades.

1. Capture SCF before upgrade (initial)
2. Capture SCF after upgrade (final)
3. Compare them to check the differences

```tcl
# tmsh save sys config file /shared/tmp/<date>_initial.scf no-passphrase
# tmsh save sys config file /shared/tmp/<date>_final.scf no-passphrase
# tmsh show sys config-diff /shared/tmp/<date>_initial.scf /shared/tmp/<date>_final.scf | egrep -e "\s{3}\|\s{3}" -e "[<]$" -e "^\s*[>]"

```

Let me know if it helps.

KR,

Dario.
