Smart farming with precise greenhouse monitoring in various scenarios is vital for improved agricultural growth management. The Internet of Things (IoT) leads to a modern age in computer networking that is gaining traction. This paper used a regression-based supervised machine learning approach to demonstrate a precise control of sensing parameters, CO2, soil moisture, temperature, humidity, and light intensity, in a smart greenhouse agricultural system. The proposed scheme comprised four main components: cloud, fog, edge, and sensor. It was found that the greenhouse could be remotely operated for the control of CO2, soil moisture, temperature, humidity, and light, resulting in improved management. Overall implementation was remotely monitored via the IoT using Message Query Telemetry Transport (MQTT), and sensor data were analysed for their standard and anomalous behaviours. Then, for practical computation over the cloud layer, an analytics and decision-making system was developed in the fog layer and constructed using supervised machine learning algorithms for precise management using regression modelling methods. The proposed framework improved its presentation and allowed us to properly accomplish the goal of the entire framework.