rbicelli / pfsense-zabbix-template

Zabbix Template for pfSense
Apache License 2.0
242 stars 107 forks source link

not showing alerts on services though proxy #54

Closed killmasta93 closed 3 years ago

killmasta93 commented 3 years ago

Hi I was wondering if this has happened to someone else, currently i had pfSense working with the template as zabbix agent active, but i changed the agent that goes though the proxy then to the zabbix server, it shows all the info except the services, i tried to turning it off and back on but it does not show any alert i checked if there was an issue on the discovery so far nothing, only on the data shows out greyed out currently have the proxy as active rather then passive

image

rbicelli commented 3 years ago

I use this setup also. When you use Proxy please note that you have to configure the host in zabbix with IP address relative to the proxy and not the zabbix server. So, keeping proxy and agent on the same pfsense machine, you have to set host address of your pfsense monitored by proxy to 127.0.0.1. Please also check connection between Zabbix Server and Proxy.

killmasta93 commented 3 years ago

thanks for the reply, so olympuspetlight is my zabbix agent which is the pfSense i then point to my zabbix proxy which has an IP of 192.168.10.250 and that data is coming in to the zabbix server but the only data that is not coming is the services which is odd image

image

killmasta93 commented 3 years ago

so i ran the php manually and got this

-------------------
Services: 
Array
(
    [0] => Array
        (
            [name] => squid
            [rcfile] => squid.sh
            [executable] => squid
            [description] => Squid Proxy Server Service
        )

    [1] => Array
        (
            [name] => clamd
            [rcfile] => clamd.sh
            [executable] => clamd
            [description] => ClamAV Antivirus
        )

    [2] => Array
        (
            [name] => c-icap
            [rcfile] => c-icap.sh
            [executable] => c-icap
            [description] => ICAP Inteface for Squid and ClamAV integration
        )

    [3] => Array
        (
            [name] => squidGuard
            [description] => Proxy server filter Service
            [executable] => squidGuard
        )

    [4] => Array
        (
            [name] => pfb_dnsbl
            [rcfile] => pfb_dnsbl.sh
            [executable] => lighttpd_pfb
            [description] => pfBlockerNG DNSBL service
        )

    [5] => Array
        (
            [name] => pfb_filter
            [rcfile] => pfb_filter.sh
            [executable] => php_pfb
            [description] => pfBlockerNG firewall filter service
        )

    [6] => Array
        (
            [name] => zabbix_proxy
            [rcfile] => zabbix_proxy.sh
            [executable] => zabbix_proxy
            [description] => Zabbix Proxy Collection Daemon
        )

    [7] => Array
        (
            [name] => zabbix_agentd
            [rcfile] => zabbix_agentd.sh
            [executable] => zabbix_agentd
            [description] => Zabbix Agent Host Monitor Daemon
        )

    [8] => Array
        (
            [name] => unbound
            [description] => DNS Resolver
        )

    [9] => Array
        (
            [name] => ntpd
            [description] => NTP clock sync
        )

    [10] => Array
        (
            [name] => syslogd
            [description] => System Logger Daemon
        )

    [11] => Array
        (
            [name] => dpinger
            [description] => Gateway Monitoring Daemon
        )

    [12] => Array
        (
            [name] => sshd
            [description] => Secure Shell Daemon
        )

    [13] => Array
        (
            [name] => openvpn
            [mode] => server
            [id] => 0
            [vpnid] => 1
            [description] => OpenVPN server: Remote Access
        )

)
-------------------

Check the logs on pfSense didnt find anything odd

Thank you

rbicelli commented 3 years ago

I can't reproduce the issue.

killmasta93 commented 3 years ago

thanks for the reply, just want to make im doing it correctly, on pfSense agent i point to my zabbix proxy which is the 192.168.1.10

image

then on my zabbix proxy which is the 192.168.1.10 points to the zabbix server which is monitor.mydomain.com

whats odd is that everything goes though besides the services

sysgone commented 3 years ago

increase debug level on proxy and agent servers, look into logs

killmasta93 commented 3 years ago

so i put the debug on the proxy level 5 and found this which seems that the proxy is sending correctly which i think

  4655:20201022:230143.242 In substitute_key_macros_impl() data:'pfsense.value[service_value,pfb_dnsbl,status]'
  4655:20201022:230143.242 End of substitute_key_macros_impl():SUCCEED data:'pfsense.value[service_value,pfb_dnsbl,status]'
  4655:20201022:230143.242 In substitute_simple_macros_impl() data:'10050'
  4655:20201022:230143.242 In get_value() key:'pfsense.value[service_value,pfb_dnsbl,status]'
  4655:20201022:230143.242 In get_value_agent() host:'olympusanquimico' addr:'127.0.0.1' key:'pfsense.value[service_value,pfb_dnsbl,status]' conn:'unencrypted'
  4653:20201022:230143.242 zbx_setproctitle() title:'poller #2 [got 0 values in 0.001106 sec, getting values]'

also found this 4636:20201022:230141.481 send_list_of_active_checks_json() sending [{"response":"success","data":[{"key":"kernel.maxfiles","delay":3600,"lastlogsize":0,"mtime":0},{"key":"kernel.maxproc","delay":3600,"lastlogsize":0,"mtime":0},{"key":"pfsense.discovery[gw]","delay":600,"lastlogsize":0,"mtime":0},{"key":"pfsense.discovery[interfaces]","delay":3600,"lastlogsize":0,"mtime":0},{"key":"pfsense.discovery[openvpn_client]","delay":30,"lastlogsize":0,"mtime":0},{"key":"pfsense.discovery[openvpn_server]","delay":30,"lastlogsize":0,"mtime":0},{"key":"pfsense.discovery[openvpn_server_user]","delay":30,"lastlogsize":0,"mtime":0},{"key":"pfsense.discovery[services]","delay":30,"lastlogsize":0,"mtime":0},{"key":"pfsense.mbuf.cache","delay":60,"lastlogsize":0,"mtime":0},{"key":"pfsense.mbuf.current","delay":60,"lastlogsize":0,"mtime":0},{"key":"pfsense.mbuf.max","delay":600,"lastlogsize":0,"mtime":0},{"key":

only odd thing i found was this

 4655:20201022:230143.244 Sending [pfsense.value[service_value,pfb_dnsbl,status]]
  4655:20201022:230143.245 get value from agent result: 'sh: 1: /usr/local/bin/php: not found'
sysgone commented 3 years ago

Your agent can't find PHP. Try to find them ( find / -iname php)

rbicelli commented 3 years ago

From Diagnostic -> Command Prompt which php And it would report /usr/local/bin/php

Do you have Zabbix Proxy on pfSense or on another machine?

killmasta93 commented 3 years ago

thanks for the reply on the zabbix proxy server this is what i get

root@cloud:~# find / -iname php
/usr/local/bin/php
/usr/bin/php
/usr/include/php
/usr/share/php
/usr/lib/php
/var/www/nextcloud/3rdparty/patchwork/utf8/src/Patchwork/PHP
/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Crypt_Blowfish/Horde/Crypt/Blowfish/Php
/var/lib/dpkg/alternatives/php
/var/lib/php
/etc/cron.d/php
/etc/php
/etc/apparmor.d/abstractions/php
/etc/alternatives/php
/run/php

as for pfSense i ran the command


Shell Output - which php

/usr/local/bin/php

correct i have the zabbix proxy on another VM which pfSense sends the info to that VM which then that VM sends the info to the zabbix server

killmasta93 commented 3 years ago

i had to put the IP instead of 127.0.0.1