How to add custom settings to SNMP?



  • Hi,

    I would like to configure Cacti Template for pfSense. To do this I need to add custom config to snmp (needed to add OIDs):

    %ucd
    extNames.0 = "process total"
    extCommand.0 = "/usr/local/bin/cacti_ps.sh total"
    extNames.1 = "process state d"
    extCommand.1 = "/usr/local/bin/cacti_ps.sh d"
    extNames.2 = "process state i"
    extCommand.2 = "/usr/local/bin/cacti_ps.sh i"
    extNames.3 = "process state l"
    extCommand.3 = "/usr/local/bin/cacti_ps.sh l"
    extNames.4 = "process state r"
    extCommand.4 = "/usr/local/bin/cacti_ps.sh r"
    extNames.5 = "process state s"
    extCommand.5 = "/usr/local/bin/cacti_ps.sh s"
    extNames.6 = "process state t"
    extCommand.6 = "/usr/local/bin/cacti_ps.sh t"
    extNames.7 = "process state w"
    extCommand.7 = "/usr/local/bin/cacti_ps.sh w"
    extNames.8 = "process state z"
    extCommand.8 = "/usr/local/bin/cacti_ps.sh z"
    extNames.9 = "smart total"
    extCommand.9 = "/usr/local/bin/cacti_smart.sh total"
    extNames.10 = "smart error"
    extCommand.10 = "/usr/local/bin/cacti_smart.sh error"
    extNames.11 = "ports total"
    extCommand.11 = "/usr/local/bin/cacti_ports.sh total"
    extNames.12 = "ports old"
    extCommand.12 = "/usr/local/bin/cacti_ports.sh old"
    extNames.13 = "ports vulnerability"
    extCommand.13 = "/usr/local/bin/cacti_ports.sh vulnerability"
    extNames.14 = "mail queue"
    extCommand.14 = "/usr/local/bin/cacti_mail_queue.sh mail"
    extNames.15 = "mail client queue"
    extCommand.15 = "/usr/local/bin/cacti_mail_queue.sh client"
    extNames.16 = "gmirror gm0 total"
    extCommand.16 = "/usr/local/bin/cacti_gmirror.sh gm0 total"
    extNames.17 = "gmirror gm0 active"
    extCommand.17 = "/usr/local/bin/cacti_gmirror.sh gm0 active"
    extNames.18 = "gmirror gm1 total"
    extCommand.18 = "/usr/local/bin/cacti_gmirror.sh gm1 total"
    extNames.19 = "gmirror gm1 active"
    extCommand.19 = "/usr/local/bin/cacti_gmirror.sh gm1 active"
    extNames.20 = "camcontrol da0"
    extCommand.20 = "/usr/local/bin/cacti_raid.sh camcontrol da0"
    extNames.21 = "camcontrol da1"
    extCommand.21 = "/usr/local/bin/cacti_raid.sh camcontrol da1"
    extNames.22 = "mptutil da0"
    extCommand.22 = "/usr/local/bin/cacti_raid.sh mptutil da0"
    extNames.23 = "mptutil da1"
    extCommand.23 = "/usr/local/bin/cacti_raid.sh mptutil da1"
    extNames.24 = "named req"
    extCommand.24 = "/usr/local/bin/cacti_named.sh request"
    extNames.25 = "named ans succ"
    extCommand.25 = "/usr/local/bin/cacti_named.sh ans_succ"
    extNames.26 = "named ans auth"
    extCommand.26 = "/usr/local/bin/cacti_named.sh ans_auth"
    extNames.27 = "namedi ans nonauth"
    extCommand.27 = "/usr/local/bin/cacti_named.sh ans_nonauth"
    extNames.28 = "denied packet ipfw"
    extCommand.28 = "/usr/local/bin/cacti_denied_packet.sh ipfw"
    extNames.29 = "denied packet ipf"
    extCommand.29 = "/usr/local/bin/cacti_denied_packet.sh ipf"
    extNames.30 = "denied packet pf"
    extCommand.30 = "/usr/local/bin/cacti_denied_packet.sh pf"
    extNames.31 = "ntp rootdispersion"
    extCommand.31 = "/usr/local/bin/cacti_ntp.sh rootdispersion"
    extNames.32 = "ntp offset"
    extCommand.32 = "/usr/local/bin/cacti_ntp.sh offset"
    extNames.33 = "ntp jitter"
    extCommand.33 = "/usr/local/bin/cacti_ntp.sh jitter"
    extNames.34 = "users total"
    extCommand.34 = "/usr/local/bin/cacti_users.sh total"
    extNames.35 = "users logged"
    extCommand.35 = "/usr/local/bin/cacti_users.sh logged"
    extNames.36 = "users no_password"
    extCommand.36 = "/usr/local/bin/cacti_users.sh nopassword"
    extNames.37 = "files maxfiles"
    extCommand.37 = "/usr/local/bin/cacti_files.sh maxfiles"
    extNames.38 = "files openned"
    extCommand.38 = "/usr/local/bin/cacti_files.sh openned"
    extNames.39 = "tcp port total"
    extCommand.39 = "/usr/local/bin/cacti_tcp_connections.sh total"
    extNames.40 = "tcp port 21"
    extCommand.40 = "/usr/local/bin/cacti_tcp_connections.sh 21"
    extNames.41 = "tcp port 22"
    extCommand.41 = "/usr/local/bin/cacti_tcp_connections.sh 22"
    extNames.42 = "tcp port 25"
    extCommand.42 = "/usr/local/bin/cacti_tcp_connections.sh 25"
    extNames.43 = "tcp port 80"
    extCommand.43 = "/usr/local/bin/cacti_tcp_connections.sh 80"
    extNames.44 = "tcp port 110"
    extCommand.44 = "/usr/local/bin/cacti_tcp_connections.sh 110"
    extNames.45 = "tcp port 143"
    extCommand.45 = "/usr/local/bin/cacti_tcp_connections.sh 143"
    extNames.46 = "tcp port 443"
    extCommand.46 = "/usr/local/bin/cacti_tcp_connections.sh 443"
    extNames.47 = "uptime"
    extCommand.47 = "/usr/local/bin/cacti_uptime.sh"
    extNames.48 = "spam ham"
    extCommand.48 = "/usr/local/bin/cacti_spam.sh ham"
    extNames.49 = "spam blocked"
    extCommand.49 = "/usr/local/bin/cacti_spam.sh blocked"
    extNames.50 = "spam blacklist"
    extCommand.50 = "/usr/local/bin/cacti_spam.sh blacklist"
    extNames.51 = "spam undecided"
    extCommand.51 = "/usr/local/bin/cacti_spam.sh undecided"
    extNames.52 = "spam grey"
    extCommand.52 = "/usr/local/bin/cacti_spam.sh grey"
    extNames.53 = "spam greywhite"
    extCommand.53 = "/usr/local/bin/cacti_spam.sh greywhite"
    extNames.54 = "mailstats_from_count_local"
    extCommand.54 = "/usr/local/bin/cacti_mailstats.sh from count local"
    extNames.55 = "mailstats_from_count_smtp"
    extCommand.55 = "/usr/local/bin/cacti_mailstats.sh from count smtp"
    extNames.56 = "mailstats_to_count_local"
    extCommand.56 = "/usr/local/bin/cacti_mailstats.sh to count local"
    extNames.57 = "mailstats_to_count_smtp"
    extCommand.57 = "/usr/local/bin/cacti_mailstats.sh to count smtp"
    extNames.58 = "mailstats_from_bytes_local"
    extCommand.58 = "/usr/local/bin/cacti_mailstats.sh from bytes local"
    extNames.59 = "mailstats_from_bytes_smtp"
    extCommand.59 = "/usr/local/bin/cacti_mailstats.sh from bytes smtp"
    extNames.60 = "mailstats_to_bytes_local"
    extCommand.60 = "/usr/local/bin/cacti_mailstats.sh to bytes local"
    extNames.61 = "mailstats_to_bytes_smtp"
    extCommand.61 = "/usr/local/bin/cacti_mailstats.sh to bytes smtp"
    extNames.62 = "apcups linev"
    extCommand.62 = "/usr/local/bin/cacti_apcups.sh linev"
    extNames.63 = "apcups loadpct"
    extCommand.63 = "/usr/local/bin/cacti_apcups.sh loadpct"
    extNames.64 = "apcups bcharge"
    extCommand.64 = "/usr/local/bin/cacti_apcups.sh bcharge"
    extNames.65 = "apcups timeleft"
    extCommand.65 = "/usr/local/bin/cacti_apcups.sh timeleft"
    extNames.66 = "apcups itemp"
    extCommand.66 = "/usr/local/bin/cacti_apcups.sh itemp"

    Is there any way to add custom config to snmp service?
    I can add this config manually but when service is restarting config is generated with settings which can be edited from webGUI where I can't define needed settings.

    Best Regards,
    Tremark.


  • Rebel Alliance Developer Netgate

    It's not net-snmp, those won't work. It's bsnmpd.

    They won't work as expected, I mean. They are not executed on poll. They likely won't work how you're intending them to work.